excalidraw/src/components/BackgroundPickerAndDarkModeToggle.tsx
Michal Srb c0dd870c6e
Dark mode (#2006)
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-08-13 13:35:31 +02:00

27 lines
676 B
TypeScript

import React from "react";
import { ActionManager } from "../actions/manager";
import { AppState } from "../types";
import { DarkModeToggle } from "./DarkModeToggle";
export const BackgroundPickerAndDarkModeToggle = ({
appState,
setAppState,
actionManager,
}: {
actionManager: ActionManager;
appState: AppState;
setAppState: any;
}) => (
<div style={{ display: "flex" }}>
{actionManager.renderAction("changeViewBackgroundColor")}
<div style={{ marginInlineStart: "0.25rem" }}>
<DarkModeToggle
value={appState.appearance}
onChange={(appearance) => {
setAppState({ appearance });
}}
/>
</div>
</div>
);