diff --git a/resources/js/pages/theme/ColorModeIconDropdown.jsx b/resources/js/pages/theme/ColorModeIconDropdown.jsx index 288816f..1e6d475 100644 --- a/resources/js/pages/theme/ColorModeIconDropdown.jsx +++ b/resources/js/pages/theme/ColorModeIconDropdown.jsx @@ -1,89 +1,29 @@ import * as React from 'react'; import DarkModeIcon from '@mui/icons-material/DarkModeRounded'; import LightModeIcon from '@mui/icons-material/LightModeRounded'; -import Box from '@mui/material/Box'; import IconButton from '@mui/material/IconButton'; -import Menu from '@mui/material/Menu'; -import MenuItem from '@mui/material/MenuItem'; import { useColorScheme } from '@mui/material/styles'; -export default function ColorModeIconDropdown(props) { - const { mode, systemMode, setMode } = useColorScheme(); - const [anchorEl, setAnchorEl] = React.useState(null); - const open = Boolean(anchorEl); - const handleClick = (event) => { - setAnchorEl(event.currentTarget); +export default function ColorModeToggle(props) { + const { mode, setMode } = useColorScheme(); + + const handleToggle = () => { + if (mode === 'light') { + setMode('dark'); + } else { + setMode('light'); + } }; - const handleClose = () => { - setAnchorEl(null); - }; - const handleMode = (targetMode) => () => { - setMode(targetMode); - handleClose(); - }; - if (!mode) { - return ( - ({ - verticalAlign: 'bottom', - display: 'inline-flex', - width: '2.25rem', - height: '2.25rem', - borderRadius: (theme.vars || theme).shape.borderRadius, - border: '1px solid', - borderColor: (theme.vars || theme).palette.divider, - })} - /> - ); - } - const resolvedMode = (systemMode || mode); - const icon = { - light: , - dark: , - }[resolvedMode]; + + const icon = mode === 'light' ? : ; + return ( - - - {icon} - - - - System - - - Light - - - Dark - - - + + {icon} + ); }