2020-08-13 04:35:31 -07:00
|
|
|
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;
|
2020-10-16 11:53:40 +02:00
|
|
|
setAppState: React.Component<any, AppState>["setState"];
|
2020-08-13 04:35:31 -07:00
|
|
|
}) => (
|
|
|
|
<div style={{ display: "flex" }}>
|
|
|
|
{actionManager.renderAction("changeViewBackgroundColor")}
|
|
|
|
<div style={{ marginInlineStart: "0.25rem" }}>
|
|
|
|
<DarkModeToggle
|
2021-03-13 18:58:06 +05:30
|
|
|
value={appState.theme}
|
|
|
|
onChange={(theme) => {
|
|
|
|
setAppState({ theme });
|
2020-08-13 04:35:31 -07:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|