-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for multiple models - moved Version and model to main menu
- Loading branch information
John Rogers
committed
May 28, 2024
1 parent
a0497ff
commit 55f6a45
Showing
6 changed files
with
122 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,36 @@ | ||
import React from 'react'; | ||
import { IconButton, Box } from '@mui/material'; | ||
import { useTheme } from '@mui/material/styles'; | ||
import Brightness4Icon from '@mui/icons-material/Brightness4'; | ||
import Brightness7Icon from '@mui/icons-material/Brightness7'; | ||
import { ColorModeContext } from "../contexts/ColorModeContext" | ||
import React from "react"; | ||
import { IconButton, Box } from "@mui/material"; | ||
import { useTheme } from "@mui/material/styles"; | ||
import Brightness4Icon from "@mui/icons-material/Brightness4"; | ||
import Brightness7Icon from "@mui/icons-material/Brightness7"; | ||
import { ColorModeContext } from "../contexts/ColorModeContext"; | ||
|
||
export default function ThemeToggle() { | ||
const theme = useTheme(); | ||
const colorMode = React.useContext(ColorModeContext); | ||
|
||
return ( | ||
<Box | ||
onClick={colorMode.toggleColorMode} | ||
sx={{ | ||
display: 'flex', | ||
width: '100%', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
bgcolor: 'background.default', | ||
display: "flex", | ||
width: "100%", | ||
alignItems: "center", | ||
justifyContent: "center", | ||
bgcolor: "background.default", | ||
color: theme.palette.text.primary, | ||
borderRadius: 1, | ||
p: 0, | ||
}} | ||
> | ||
{theme.palette.mode} mode | ||
<IconButton | ||
sx={{ ml: 1 }} | ||
onClick={colorMode.toggleColorMode} | ||
color="inherit" | ||
> | ||
{theme.palette.mode === 'dark' ? ( | ||
<IconButton sx={{ ml: 1 }} color="inherit"> | ||
{theme.palette.mode === "dark" ? ( | ||
<Brightness7Icon /> | ||
) : ( | ||
<Brightness4Icon /> | ||
)} | ||
</IconButton> | ||
</Box> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters