From ff62338359d35bb4d195e7a6220c6df10ae2a102 Mon Sep 17 00:00:00 2001 From: Paul Armstrong Date: Wed, 3 Feb 2021 16:00:54 -0800 Subject: [PATCH] feat(web): icons and better menu handling for dark mode --- web/src/components/AppBar.jsx | 12 ++++++++---- web/src/components/Menu.jsx | 12 ++++++++++-- web/src/icons/AutoAwesome.jsx | 10 ++++++++++ web/src/icons/DarkMode.jsx | 10 ++++++++++ web/src/icons/LightMode.jsx | 10 ++++++++++ 5 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 web/src/icons/AutoAwesome.jsx create mode 100644 web/src/icons/DarkMode.jsx create mode 100644 web/src/icons/LightMode.jsx diff --git a/web/src/components/AppBar.jsx b/web/src/components/AppBar.jsx index f668a7498..0238e3f95 100644 --- a/web/src/components/AppBar.jsx +++ b/web/src/components/AppBar.jsx @@ -1,9 +1,12 @@ import { h } from 'preact'; import Button from './Button'; import LinkedLogo from './LinkedLogo'; -import Menu, { MenuItem } from './Menu'; +import Menu, { MenuItem, MenuSeparator } from './Menu'; import MenuIcon from '../icons/Menu'; import MoreIcon from '../icons/More'; +import AutoAwesomeIcon from '../icons/AutoAwesome'; +import LightModeIcon from '../icons/LightMode'; +import DarkModeIcon from '../icons/DarkMode'; import { useDarkMode, useSidebar } from '../context'; import { useLayoutEffect, useCallback, useRef, useState } from 'preact/hooks'; @@ -87,9 +90,10 @@ export default function AppBar({ title }) { {showMoreMenu ? ( - - - + + + + ) : null} diff --git a/web/src/components/Menu.jsx b/web/src/components/Menu.jsx index d7c678c38..831b6c920 100644 --- a/web/src/components/Menu.jsx +++ b/web/src/components/Menu.jsx @@ -31,14 +31,22 @@ export function MenuItem({ focus, icon: Icon, label, onSelect, value }) { return (
- {Icon ? : null} + {Icon ? ( +
+ +
+ ) : null} {label}
); } + +export function MenuSeparator() { + return
; +} diff --git a/web/src/icons/AutoAwesome.jsx b/web/src/icons/AutoAwesome.jsx new file mode 100644 index 000000000..2db782fb5 --- /dev/null +++ b/web/src/icons/AutoAwesome.jsx @@ -0,0 +1,10 @@ +import { h } from 'preact'; + +export default function ArrowDropdown() { + return ( + + + + + ); +} diff --git a/web/src/icons/DarkMode.jsx b/web/src/icons/DarkMode.jsx new file mode 100644 index 000000000..d85691a3a --- /dev/null +++ b/web/src/icons/DarkMode.jsx @@ -0,0 +1,10 @@ +import { h } from 'preact'; + +export default function DarkMode() { + return ( + + + + + ); +} diff --git a/web/src/icons/LightMode.jsx b/web/src/icons/LightMode.jsx new file mode 100644 index 000000000..73b07ae44 --- /dev/null +++ b/web/src/icons/LightMode.jsx @@ -0,0 +1,10 @@ +import { h } from 'preact'; + +export default function ArrowDropdown() { + return ( + + + + + ); +}