aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/components/Themer.tsx
diff options
context:
space:
mode:
authorSascha <GlancingMind@outlook.com>2021-05-06 16:31:12 +0200
committerSascha <GlancingMind@outlook.com>2021-05-06 16:33:28 +0200
commitd9646a8674e044c3195cd6469fe2135613aab8ed (patch)
tree75ebf2b0eaf88e9070c0e094b1ae87fc955fdb00 /webui/src/components/Themer.tsx
parent59912ec6965c9c830707af81688233c57dafd337 (diff)
downloadgit-bug-d9646a8674e044c3195cd6469fe2135613aab8ed.tar.gz
Fix theme switcher icon color in release
Diffstat (limited to 'webui/src/components/Themer.tsx')
-rw-r--r--webui/src/components/Themer.tsx21
1 files changed, 8 insertions, 13 deletions
diff --git a/webui/src/components/Themer.tsx b/webui/src/components/Themer.tsx
index b4877974..edf1f352 100644
--- a/webui/src/components/Themer.tsx
+++ b/webui/src/components/Themer.tsx
@@ -1,35 +1,30 @@
import React, { createContext, useContext, useState } from 'react';
-import { fade, ThemeProvider } from '@material-ui/core';
-import IconButton from '@material-ui/core/IconButton/IconButton';
-import Tooltip from '@material-ui/core/Tooltip/Tooltip';
+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';
-import { makeStyles } from '@material-ui/styles';
const ThemeContext = createContext({
toggleMode: () => {},
mode: '',
});
-const useStyles = makeStyles((theme: Theme) => ({
- iconButton: {
- color: fade(theme.palette.primary.contrastText, 0.5),
- },
-}));
-
-const LightSwitch = () => {
+type LightSwitchProps = {
+ className?: string;
+};
+const LightSwitch = ({ className }: LightSwitchProps) => {
const { mode, toggleMode } = useContext(ThemeContext);
const nextMode = mode === 'light' ? 'dark' : 'light';
const description = `Switch to ${nextMode} theme`;
- const classes = useStyles();
return (
<Tooltip title={description}>
<IconButton
onClick={toggleMode}
aria-label={description}
- className={classes.iconButton}
+ className={className}
>
{mode === 'light' ? <WbSunnyRounded /> : <NightsStayRounded />}
</IconButton>