From 1e092d94568f82cb4f30d6a13e06cc05b8f64612 Mon Sep 17 00:00:00 2001 From: Halit Aksoy Date: Fri, 15 Jul 2022 17:45:35 +0300 Subject: [PATCH] add ThemeSwitchMenu --- src/components/headerbar/ThemeSwitchMenu.tsx | 57 ++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/components/headerbar/ThemeSwitchMenu.tsx diff --git a/src/components/headerbar/ThemeSwitchMenu.tsx b/src/components/headerbar/ThemeSwitchMenu.tsx new file mode 100644 index 0000000..8740671 --- /dev/null +++ b/src/components/headerbar/ThemeSwitchMenu.tsx @@ -0,0 +1,57 @@ +import { Menu, MenuItem } from "@szhsin/react-menu"; +import * as React from "react"; +import { FunctionComponent } from "react"; +import { Context } from "../../context/context"; + +const ThemeSwitchMenu: FunctionComponent<{ context: Context, textColor: string }> = (props) => { + const { context, textColor } = props; + const menuButton = + light_mode + ; + const menuItems = context.themeManager.themes.map((theme, index) => { + const themeBackground = context.themeManager.theme.background; + return ( + (event.target.style.background = themeBackground)} + //@ts-ignore + onMouseOut={(event) => (event.target.style.background = "transparent")} + onClick={() => (context.themeManager.theme = theme)}> +
+ {theme.name} + + + ); + }) + return ( +
+ + {menuItems} + + +
+ ); +} + +export default ThemeSwitchMenu; \ No newline at end of file