fix SwitchThemeMenu issues
This commit is contained in:
parent
3344439ef4
commit
1a305dc74c
@ -8,18 +8,17 @@ import "@szhsin/react-menu/dist/transitions/slide.css"
|
|||||||
const ThemeSwitchMenu: FunctionComponent<{ context: Context, textColor: string }> = (props) => {
|
const ThemeSwitchMenu: FunctionComponent<{ context: Context, textColor: string }> = (props) => {
|
||||||
const { context, textColor } = props;
|
const { context, textColor } = props;
|
||||||
const menuButton = <span
|
const menuButton = <span
|
||||||
style={{ color: textColor }}
|
style={{ color: textColor, cursor: 'pointer', userSelect: 'none' }}
|
||||||
className="material-symbols-outlined">
|
className="material-symbols-outlined">
|
||||||
light_mode
|
light_mode
|
||||||
</span>;
|
</span>;
|
||||||
const menuItems = context.themeManager.themes.map((theme, index) => {
|
const menuItems = context.themeManager.themes.map((theme, index) => {
|
||||||
const themeBackground = context.themeManager.theme.background;
|
|
||||||
return (
|
return (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
key={index}
|
key={index}
|
||||||
style={{ color: textColor }}
|
style={{ color: textColor }}
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
onMouseOver={(event) => (event.target.style.background = themeBackground)}
|
onMouseOver={(event) => (event.target.style.background = "transparent")}
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
onMouseOut={(event) => (event.target.style.background = "transparent")}
|
onMouseOut={(event) => (event.target.style.background = "transparent")}
|
||||||
onClick={() => (context.themeManager.theme = theme)}>
|
onClick={() => (context.themeManager.theme = theme)}>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user