From 459e3a798c87928e09e1c7d79f5139ed4089a233 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 18 Oct 2022 09:04:02 -0700 Subject: Make events clickable --- modern/src/main/EventsDrawer.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'modern/src/main/EventsDrawer.js') diff --git a/modern/src/main/EventsDrawer.js b/modern/src/main/EventsDrawer.js index 69b7e1b8..46664f87 100644 --- a/modern/src/main/EventsDrawer.js +++ b/modern/src/main/EventsDrawer.js @@ -1,7 +1,8 @@ import React from 'react'; import { useDispatch, useSelector } from 'react-redux'; +import { useNavigate } from 'react-router-dom'; import { - Drawer, IconButton, List, ListItem, ListItemText, Toolbar, Typography, + Drawer, IconButton, List, ListItemButton, ListItemText, Toolbar, Typography, } from '@mui/material'; import { makeStyles } from '@mui/styles'; import DeleteIcon from '@mui/icons-material/Delete'; @@ -24,6 +25,7 @@ const useStyles = makeStyles((theme) => ({ const EventsDrawer = ({ open, onClose }) => { const classes = useStyles(); + const navigate = useNavigate(); const dispatch = useDispatch(); const t = useTranslation(); @@ -54,12 +56,16 @@ const EventsDrawer = ({ open, onClose }) => { {events.map((event) => ( - + navigate(`/event/${event.id}`)} + disabled={!event.id} + > dispatch(eventsActions.delete(event))}> - + ))} -- cgit v1.2.3