Use useNavigate hook
This commit is contained in:
@@ -1,9 +1,12 @@
|
|||||||
import styles from "./Event.module.css";
|
import styles from "./Event.module.css";
|
||||||
import {useState, useEffect} from "react";
|
import { useState, useEffect } from "react";
|
||||||
import {Link} from "react-router";
|
import { useNavigate } from "react-router";
|
||||||
import Button from "/src/components/ui/button/button.jsx"
|
import Button from "/src/components/ui/button/button.jsx"
|
||||||
|
|
||||||
function Event({event}){
|
function Event({event}){
|
||||||
|
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const [eventMenu, seteventMenu] = useState(false);
|
const [eventMenu, seteventMenu] = useState(false);
|
||||||
const [windowSize, setWindowSize] = useState({
|
const [windowSize, setWindowSize] = useState({
|
||||||
width: null,
|
width: null,
|
||||||
@@ -66,11 +69,9 @@ function Event({event}){
|
|||||||
</div>
|
</div>
|
||||||
<div className={styles.eventContainerBottom}>
|
<div className={styles.eventContainerBottom}>
|
||||||
{(windowSize.width <= 768 || eventMenu) ? (
|
{(windowSize.width <= 768 || eventMenu) ? (
|
||||||
<Link
|
|
||||||
to={`/event/` + event.id}
|
<Button onClick={() => navigate(`/event/` + event.id)}>Voir plus</Button>
|
||||||
className={styles.moreLink}>
|
|
||||||
<Button>Voir plus</Button>
|
|
||||||
</Link>
|
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user