got new theme system to work without re-rendering
This commit is contained in:
parent
a452cf9444
commit
3454d16f36
12 changed files with 100 additions and 361 deletions
|
|
@ -14,6 +14,7 @@ import { useNavigate } from "react-router-dom";
|
|||
import TeamDialog from "teams/TeamDialog";
|
||||
import AccessObject from "./AccessObject";
|
||||
import { useSnackbar, useUserAPI } from "hooks";
|
||||
import { useThemeMode } from "theme/AppThemeProvider";
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) => ({
|
||||
accessIcon: {
|
||||
|
|
@ -72,14 +73,10 @@ const useStyles = makeStyles((theme: Theme) => ({
|
|||
borderColor: getSignatureAccentColour()
|
||||
},
|
||||
}));
|
||||
|
||||
interface Props {
|
||||
toggleTheme: () => void;
|
||||
}
|
||||
|
||||
export default function UserMenu(props: Props) {
|
||||
export default function UserMenu() {
|
||||
|
||||
const { toggleTheme } = props;
|
||||
const { toggleMode } = useThemeMode()
|
||||
const [{ user, team, as }, dispatch] = useGlobalState();
|
||||
const { loginWithRedirect } = useAuth0();
|
||||
const classes = useStyles();
|
||||
|
|
@ -167,7 +164,7 @@ export default function UserMenu(props: Props) {
|
|||
)}
|
||||
</Button>
|
||||
|
||||
<IconButton onClick={toggleTheme} className={classes.rightIcon} aria-label="Toggle Theme">
|
||||
<IconButton onClick={/*toggleMode*/ () => {}} className={classes.rightIcon} aria-label="Toggle Theme">
|
||||
<ThemeIcon />
|
||||
</IconButton>
|
||||
</>
|
||||
|
|
@ -229,7 +226,7 @@ export default function UserMenu(props: Props) {
|
|||
</ListItemIcon>
|
||||
<ListItemText primary="User Settings" />
|
||||
</MenuItem>
|
||||
<MenuItem onClick={toggleTheme} aria-label="Toggle Theme" dense>
|
||||
<MenuItem onClick={toggleMode} aria-label="Toggle Theme" dense>
|
||||
<ListItemIcon>
|
||||
<ThemeIcon />
|
||||
</ListItemIcon>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue