$ git clone [email protected]:cieloazul310/gatsby-material-ui-darkmode.git
$ cd gatsby-material-ui-darkmode
# develop
$ yarn run develop
# build
$ yarn run build
import * as React from 'react';
import Button from '@mui/material/Button';
import ColorModeContext from './ColorModeContext';
function ToggleButton() {
const colorMode = React.useContext(ColorModeContext);
return (
<Button onClick={colorMode.toggleColorMode}>
Toggle Color Mode
</Button>
);
}