From 3fbbe86c5007ac82069feb342a462202d6a1a2b5 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Thu, 11 Feb 2021 11:25:06 +0100 Subject: semi-working dark mode toggle + color pickers --- components/ui.tsx | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) (limited to 'components') diff --git a/components/ui.tsx b/components/ui.tsx index bb2a2ff..e6fdceb 100644 --- a/components/ui.tsx +++ b/components/ui.tsx @@ -3,6 +3,7 @@ import { Component, CSSProperties, ReactNode } from "react"; import SearchIcon from '@material-ui/icons/Search'; import CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank'; import CheckBoxIcon from '@material-ui/icons/CheckBox'; +import EditOutlinedIcon from '@material-ui/icons/EditOutlined'; export function Vierkant(props: { href?: string; @@ -154,9 +155,13 @@ export class CheckBox extends Component<{ state?: boolean; style?: CSSProperties; id?: string; + onclick?: (state: boolean) => void; }> { state = { on: this.props.state || false } - public toggle = () => this.setState({ on: !this.state.on }) + public toggle = () => { + this.setState({ on: !this.state.on }); + this.props.onclick && this.props.onclick(!this.state.on); + } render() { return
{ + state: { + color: string; + dark: boolean; + } = { + color: "#012345", + dark: true + } + render() { + return + } +} -- cgit v1.2.3