handle onClick

This commit is contained in:
srgooglo 2022-10-20 13:36:08 +02:00
parent d8f529d044
commit e004c4b2ab
2 changed files with 13 additions and 2 deletions

View File

@ -4,7 +4,16 @@ import { Icons } from "components/Icons"
import "./index.less"
export default (props) => {
const { backgroundImg, backgroundStyle, logoImg, title, description } = props.data ?? {}
const { backgroundImg, backgroundStyle, logoImg, title, description } = props.data?.announcement ?? {}
const onClickEvent = () => {
if (!props.data?._id) {
console.error("No event ID provided")
return false
}
app.setLocation(`/featured-event/${props.data?._id}`)
}
return <div
key={props.index}
@ -13,6 +22,7 @@ export default (props) => {
backgroundImage: `url(${backgroundImg})`,
...backgroundStyle
}}
onClick={onClickEvent}
>
<div className="indicator">
<Icons.Target /> <span>Featured event</span>

View File

@ -48,9 +48,10 @@
.content {
display: flex;
flex-direction: column;
flex-direction: column;
align-items: flex-start;
margin-left: 20px;
margin-bottom: 10px;