toggle fix
This commit is contained in:
+3
-3
@@ -5,12 +5,12 @@ import { ColorModeContext } from 'App';
|
|||||||
import WbSunnyOutlinedIcon from '@mui/icons-material/WbSunnyOutlined';
|
import WbSunnyOutlinedIcon from '@mui/icons-material/WbSunnyOutlined';
|
||||||
import NightsStayOutlinedIcon from '@mui/icons-material/NightsStayOutlined';
|
import NightsStayOutlinedIcon from '@mui/icons-material/NightsStayOutlined';
|
||||||
|
|
||||||
const DarkModeToogle = () => {
|
const DarkModeToggle = () => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const colorMode = useContext(ColorModeContext);
|
const colorMode = useContext(ColorModeContext);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<IconButton disableRipple onClick={colorMode.toggleColorMode} sx={{ color: theme.palette.text.secondary }} >
|
<IconButton onClick={colorMode.toggleColorMode} sx={{ color: theme.palette.text.secondary }} >
|
||||||
{theme.palette.mode === 'dark' ? (
|
{theme.palette.mode === 'dark' ? (
|
||||||
<WbSunnyOutlinedIcon />
|
<WbSunnyOutlinedIcon />
|
||||||
) : (
|
) : (
|
||||||
@@ -20,4 +20,4 @@ const DarkModeToogle = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default DarkModeToogle;
|
export default DarkModeToggle;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default } from './DarkModeToggle';
|
||||||
@@ -1 +0,0 @@
|
|||||||
export { default } from './DarkModeToogle';
|
|
||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
import { useTheme } from '@mui/material/styles';
|
import { useTheme } from '@mui/material/styles';
|
||||||
import ThreeSixtyOutlinedIcon from '@mui/icons-material/ThreeSixtyOutlined';
|
import ThreeSixtyOutlinedIcon from '@mui/icons-material/ThreeSixtyOutlined';
|
||||||
|
|
||||||
import DarkModeToogle from 'layouts/common/darkModeToogle';
|
import DarkModeToggle from 'layouts/common/darkModeToggle';
|
||||||
import HideOnScroll from 'layouts/common/hideOnScroll';
|
import HideOnScroll from 'layouts/common/hideOnScroll';
|
||||||
|
|
||||||
const handleScrollDown = (event) => {
|
const handleScrollDown = (event) => {
|
||||||
@@ -75,7 +75,7 @@ const Header = () => {
|
|||||||
<ThreeSixtyOutlinedIcon />
|
<ThreeSixtyOutlinedIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Link>
|
</Link>
|
||||||
<DarkModeToogle />
|
<DarkModeToggle />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
|
|
||||||
import { AppBar, Toolbar, CssBaseline, Box } from '@mui/material';
|
import { AppBar, Toolbar, CssBaseline, Box } from '@mui/material';
|
||||||
|
|
||||||
import DarkModeToogle from 'layouts/common/darkModeToogle';
|
import DarkModeToggle from 'layouts/common/darkModeToggle';
|
||||||
import HideOnScroll from 'layouts/common/hideOnScroll';
|
import HideOnScroll from 'layouts/common/hideOnScroll';
|
||||||
import Navigation from './navigation';
|
import Navigation from './navigation';
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ const Header = () => {
|
|||||||
<Toolbar>
|
<Toolbar>
|
||||||
<Navigation />
|
<Navigation />
|
||||||
<Box sx={{ display: { sm: 'block', xs: 'none' } }}>
|
<Box sx={{ display: { sm: 'block', xs: 'none' } }}>
|
||||||
<DarkModeToogle />
|
<DarkModeToggle />
|
||||||
</Box>
|
</Box>
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
</AppBar>
|
</AppBar>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import { useTheme } from '@mui/material/styles';
|
|||||||
import MenuIcon from '@mui/icons-material/Menu';
|
import MenuIcon from '@mui/icons-material/Menu';
|
||||||
import MenuOpenIcon from '@mui/icons-material/MenuOpen';
|
import MenuOpenIcon from '@mui/icons-material/MenuOpen';
|
||||||
|
|
||||||
import DarkModeToogle from 'layouts/common/darkModeToogle';
|
import DarkModeToggle from 'layouts/common/darkModeToggle';
|
||||||
|
|
||||||
const Navigation = () => {
|
const Navigation = () => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
@@ -109,7 +109,7 @@ const Navigation = () => {
|
|||||||
<MenuIcon fontSize='inherit' />
|
<MenuIcon fontSize='inherit' />
|
||||||
)}
|
)}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<DarkModeToogle style={{ alignSelf: 'right', color: 'inherit' }} />
|
<DarkModeToggle style={{ alignSelf: 'right', color: 'inherit' }} />
|
||||||
</Paper>
|
</Paper>
|
||||||
|
|
||||||
{matches ? (
|
{matches ? (
|
||||||
|
|||||||
Reference in New Issue
Block a user