Add admin functionality and improve UI styling

This commit is contained in:
Your Name
2025-04-29 14:08:56 -04:00
parent 55aae01652
commit 0816456068
5 changed files with 237 additions and 11 deletions

View File

@@ -7,7 +7,10 @@ import {
CardContent,
Typography,
Grid,
CardActions,
IconButton,
} from '@mui/material';
import AdminPanelSettingsIcon from '@mui/icons-material/AdminPanelSettings';
import axios from 'axios';
interface Event {
@@ -40,6 +43,10 @@ const EventList: React.FC = () => {
navigate(`/events/${event.slug}/rsvp`);
};
const handleAdminClick = (event: Event) => {
navigate(`/events/${event.slug}/admin`);
};
return (
<Box>
<Box sx={{ display: 'flex', justifyContent: 'space-between', mb: 4 }}>
@@ -78,6 +85,18 @@ const EventList: React.FC = () => {
{event.description}
</Typography>
</CardContent>
<CardActions>
<IconButton
onClick={(e) => {
e.stopPropagation();
handleAdminClick(event);
}}
color="primary"
aria-label="admin"
>
<AdminPanelSettingsIcon />
</IconButton>
</CardActions>
</Card>
</Grid>
))}