aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/components/Themer.tsx
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2022-03-01 20:57:43 +0100
committerGitHub <noreply@github.com>2022-03-01 20:57:43 +0100
commit2dbe0fd5fc3f3f74848df9499cddf32663e771ee (patch)
treefa162059dd8732ab3d6b22fb6df1fa10a353985f /webui/src/components/Themer.tsx
parent08e00b4eb8f8cf8e614cae8dee46862a398f465d (diff)
parent8229e80d1eeee73bd4eab46c90d9f97f802ab063 (diff)
downloadgit-bug-2dbe0fd5fc3f3f74848df9499cddf32663e771ee.tar.gz
Merge pull request #750 from MichaelMure/sandhose/webui-upgrade
Upgrade webui dependencies
Diffstat (limited to 'webui/src/components/Themer.tsx')
-rw-r--r--webui/src/components/Themer.tsx22
1 files changed, 15 insertions, 7 deletions
diff --git a/webui/src/components/Themer.tsx b/webui/src/components/Themer.tsx
index edf1f352..9934888d 100644
--- a/webui/src/components/Themer.tsx
+++ b/webui/src/components/Themer.tsx
@@ -1,10 +1,15 @@
-import React, { createContext, useContext, useState } from 'react';
+import { NightsStayRounded, WbSunnyRounded } from '@mui/icons-material';
+import { ThemeProvider, StyledEngineProvider } from '@mui/material';
+import IconButton from '@mui/material/IconButton';
+import Tooltip from '@mui/material/Tooltip';
+import { Theme } from '@mui/material/styles';
+import * as React from 'react';
+import { createContext, useContext, useState } from 'react';
-import { ThemeProvider } from '@material-ui/core';
-import IconButton from '@material-ui/core/IconButton';
-import Tooltip from '@material-ui/core/Tooltip';
-import { Theme } from '@material-ui/core/styles';
-import { NightsStayRounded, WbSunnyRounded } from '@material-ui/icons';
+declare module '@mui/styles/defaultTheme' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface DefaultTheme extends Theme {}
+}
const ThemeContext = createContext({
toggleMode: () => {},
@@ -25,6 +30,7 @@ const LightSwitch = ({ className }: LightSwitchProps) => {
onClick={toggleMode}
aria-label={description}
className={className}
+ size="large"
>
{mode === 'light' ? <WbSunnyRounded /> : <NightsStayRounded />}
</IconButton>
@@ -52,7 +58,9 @@ const Themer = ({ children, lightTheme, darkTheme }: Props) => {
return (
<ThemeContext.Provider value={{ toggleMode: toggleMode, mode: mode }}>
- <ThemeProvider theme={preferedTheme}>{children}</ThemeProvider>
+ <StyledEngineProvider injectFirst>
+ <ThemeProvider theme={preferedTheme}>{children}</ThemeProvider>
+ </StyledEngineProvider>
</ThemeContext.Provider>
);
};