Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
792 changes: 541 additions & 251 deletions client/src/api/api.ts

Large diffs are not rendered by default.

723 changes: 499 additions & 224 deletions client/src/components/AttendeeInput.tsx

Large diffs are not rendered by default.

2,062 changes: 1,661 additions & 401 deletions client/src/components/EventCard.tsx

Large diffs are not rendered by default.

171 changes: 171 additions & 0 deletions client/src/components/ThemeModeToggle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
import { Box, ToggleButton, ToggleButtonGroup, Typography } from '@mui/material';

import LightModeIcon from '@mui/icons-material/LightMode';

import DarkModeIcon from '@mui/icons-material/DarkMode';

import SettingsBrightnessIcon from '@mui/icons-material/SettingsBrightness';

import { usePreferences } from '@/context/PreferencesContext';



export default function ThemeModeToggle() {

const { preferences, setPreferences } = usePreferences();



const handleThemeChange = (_event: React.MouseEvent<HTMLElement>, newMode: 'system' | 'light' | 'dark' | null) => {

if (newMode !== null) {

setPreferences({

...preferences,

themeMode: newMode,

});

}

};



return (

<Box>

<Typography variant="body2" color="text.secondary" sx={{ mb: 1, ml: 1 }}>

Theme

</Typography>

<ToggleButtonGroup

value={preferences.themeMode || 'system'}

exclusive

onChange={handleThemeChange}

fullWidth

sx={{

bgcolor: 'background.paper',

borderRadius: 2,

}}

>

<ToggleButton

value="light"

sx={{

py: 1.5,

textTransform: 'none',

borderRadius: 2,

'&.Mui-selected': {

bgcolor: 'action.selected',

},

}}

>

<Box display="flex" flexDirection="column" alignItems="center" gap={0.5}>

<LightModeIcon />

<Typography variant="body2">Light</Typography>

</Box>

</ToggleButton>

<ToggleButton

value="system"

sx={{

py: 1.5,

textTransform: 'none',

borderRadius: 2,

'&.Mui-selected': {

bgcolor: 'action.selected',

},

}}

>

<Box display="flex" flexDirection="column" alignItems="center" gap={0.5}>

<SettingsBrightnessIcon />

<Typography variant="body2">System</Typography>

</Box>

</ToggleButton>

<ToggleButton

value="dark"

sx={{

py: 1.5,

textTransform: 'none',

borderRadius: 2,

'&.Mui-selected': {

bgcolor: 'action.selected',

},

}}

>

<Box display="flex" flexDirection="column" alignItems="center" gap={0.5}>

<DarkModeIcon />

<Typography variant="body2">Dark</Typography>

</Box>

</ToggleButton>

</ToggleButtonGroup>

</Box>

);

}


Loading