Add dark theme

This commit is contained in:
2022-09-10 19:00:35 +02:00
parent 71e4e42ed2
commit 03ca03debc
3 changed files with 96 additions and 73 deletions
+6 -1
View File
@@ -1,7 +1,7 @@
import { CompoundButton } from './CompoundButton.jsx'
import { Icon } from './Icon.jsx'
export const Toolbar = ({ mode, setMode, source, setSource, onShowMenu, onHelp }) => {
export const Toolbar = ({ mode, setMode, source, setSource, onShowMenu, onHelp, theme, setTheme }) => {
return (
<div class="toolbar">
<div class="mobile">
@@ -52,6 +52,11 @@ export const Toolbar = ({ mode, setMode, source, setSource, onShowMenu, onHelp }
<Icon name="print" />
</button>
</div>
<div class="item option">
<button class="icon" onClick={() => setTheme(theme==="dark"?"light":"dark")}>
<Icon name={theme==="dark"?"dark_mode":"light_mode"} />
</button>
</div>
<div class="item option">
<button class="icon" onClick={onHelp}>
<Icon name="question_mark" />