mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
handle onClick
This commit is contained in:
parent
d8f529d044
commit
e004c4b2ab
@ -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>
|
||||
|
@ -48,9 +48,10 @@
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
|
||||
margin-left: 20px;
|
||||
margin-bottom: 10px;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user