Improve mobile responsiveness: Fix scrolling and button wrapping issues - Changed container position, added button wrapping, responsive padding and table scrolling

This commit is contained in:
Starstrike
2025-05-01 15:08:22 -04:00
parent 3e9e1d835a
commit 9ca6c4e883
2 changed files with 54 additions and 17 deletions

View File

@@ -435,25 +435,30 @@ const EventAdmin: React.FC = () => {
backgroundPosition: 'center', backgroundPosition: 'center',
backgroundRepeat: 'no-repeat', backgroundRepeat: 'no-repeat',
backgroundAttachment: 'fixed', backgroundAttachment: 'fixed',
position: 'fixed', position: 'relative',
top: 0,
left: 0,
right: 0,
bottom: 0,
overflowY: 'auto', overflowY: 'auto',
py: 4, py: 4,
}} }}
> >
<Container maxWidth="lg"> <Container maxWidth="lg">
<Paper elevation={3} sx={{ p: 4, mt: 4 }}> <Paper elevation={3} sx={{ p: { xs: 2, sm: 4 }, mt: 4 }}>
<Box sx={{ mb: 4 }}> <Box sx={{ mb: 4 }}>
<Typography variant="h4" component="h2" color="primary" gutterBottom> <Typography variant="h4" component="h2" color="primary" gutterBottom>
{event.title} - Admin {event.title} - Admin
</Typography> </Typography>
<Box sx={{ display: 'flex', gap: 2, mb: 3 }}> <Box sx={{
display: 'flex',
flexWrap: 'wrap',
gap: 2,
mb: 3
}}>
<Button <Button
variant="outlined" variant="outlined"
onClick={() => navigate('/')} onClick={() => navigate('/')}
sx={{
minWidth: 'fit-content',
whiteSpace: 'nowrap'
}}
> >
Back to Events Back to Events
</Button> </Button>
@@ -461,6 +466,10 @@ const EventAdmin: React.FC = () => {
variant="outlined" variant="outlined"
onClick={handleUpdateInfoClick} onClick={handleUpdateInfoClick}
startIcon={<EditIcon />} startIcon={<EditIcon />}
sx={{
minWidth: 'fit-content',
whiteSpace: 'nowrap'
}}
> >
Update Info Update Info
</Button> </Button>
@@ -468,6 +477,10 @@ const EventAdmin: React.FC = () => {
variant="outlined" variant="outlined"
startIcon={<AddIcon />} startIcon={<AddIcon />}
onClick={() => setManageItemsDialogOpen(true)} onClick={() => setManageItemsDialogOpen(true)}
sx={{
minWidth: 'fit-content',
whiteSpace: 'nowrap'
}}
> >
Manage Items Manage Items
</Button> </Button>
@@ -476,6 +489,10 @@ const EventAdmin: React.FC = () => {
color="error" color="error"
startIcon={<DeleteIcon />} startIcon={<DeleteIcon />}
onClick={() => setDeleteEventDialogOpen(true)} onClick={() => setDeleteEventDialogOpen(true)}
sx={{
minWidth: 'fit-content',
whiteSpace: 'nowrap'
}}
> >
Delete Event Delete Event
</Button> </Button>
@@ -504,7 +521,12 @@ const EventAdmin: React.FC = () => {
<Typography variant="h6"> <Typography variant="h6">
Items Status Items Status
</Typography> </Typography>
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3, maxWidth: '60%' }}> <Box sx={{
display: 'flex',
flexDirection: 'column',
gap: 3,
maxWidth: { xs: '100%', sm: '60%' }
}}>
<Box> <Box>
<Typography variant="subtitle1" gutterBottom> <Typography variant="subtitle1" gutterBottom>
Still Needed: Still Needed:
@@ -551,7 +573,12 @@ const EventAdmin: React.FC = () => {
RSVPs ({rsvps.length}) RSVPs ({rsvps.length})
</Typography> </Typography>
<TableContainer> <TableContainer sx={{
overflowX: 'auto',
'& .MuiTable-root': {
minWidth: { xs: '100%', sm: 650 }
}
}}>
<Table> <Table>
<TableHead> <TableHead>
<TableRow> <TableRow>

View File

@@ -142,25 +142,30 @@ const EventView: React.FC = () => {
backgroundPosition: 'center', backgroundPosition: 'center',
backgroundRepeat: 'no-repeat', backgroundRepeat: 'no-repeat',
backgroundAttachment: 'fixed', backgroundAttachment: 'fixed',
position: 'fixed', position: 'relative',
top: 0,
left: 0,
right: 0,
bottom: 0,
overflowY: 'auto', overflowY: 'auto',
py: 4, py: 4,
}} }}
> >
<Container maxWidth="lg"> <Container maxWidth="lg">
<Paper elevation={3} sx={{ p: 4, mt: 4 }}> <Paper elevation={3} sx={{ p: { xs: 2, sm: 4 }, mt: 4 }}>
<Box sx={{ mb: 4 }}> <Box sx={{ mb: 4 }}>
<Typography variant="h4" component="h2" color="primary" gutterBottom> <Typography variant="h4" component="h2" color="primary" gutterBottom>
{event.title} - RSVPs {event.title} - RSVPs
</Typography> </Typography>
<Box sx={{ display: 'flex', gap: 2, mb: 3 }}> <Box sx={{
display: 'flex',
flexWrap: 'wrap',
gap: 2,
mb: 3
}}>
<Button <Button
variant="outlined" variant="outlined"
onClick={() => navigate('/')} onClick={() => navigate('/')}
sx={{
minWidth: 'fit-content',
whiteSpace: 'nowrap'
}}
> >
Back to Events Back to Events
</Button> </Button>
@@ -235,7 +240,12 @@ const EventView: React.FC = () => {
RSVPs ({rsvps.length}) RSVPs ({rsvps.length})
</Typography> </Typography>
<TableContainer> <TableContainer sx={{
overflowX: 'auto',
'& .MuiTable-root': {
minWidth: { xs: '100%', sm: 650 }
}
}}>
<Table> <Table>
<TableHead> <TableHead>
<TableRow> <TableRow>