2020-08-13 04:35:31 -07:00
|
|
|
import React from "react";
|
|
|
|
import { ActionManager } from "../actions/manager";
|
|
|
|
import { AppState } from "../types";
|
|
|
|
|
|
|
|
export const BackgroundPickerAndDarkModeToggle = ({
|
|
|
|
appState,
|
|
|
|
setAppState,
|
|
|
|
actionManager,
|
2021-03-15 11:33:46 -07:00
|
|
|
showThemeBtn,
|
2020-08-13 04:35:31 -07:00
|
|
|
}: {
|
|
|
|
actionManager: ActionManager;
|
|
|
|
appState: AppState;
|
2020-10-16 11:53:40 +02:00
|
|
|
setAppState: React.Component<any, AppState>["setState"];
|
2021-03-15 11:33:46 -07:00
|
|
|
showThemeBtn: boolean;
|
2020-08-13 04:35:31 -07:00
|
|
|
}) => (
|
|
|
|
<div style={{ display: "flex" }}>
|
|
|
|
{actionManager.renderAction("changeViewBackgroundColor")}
|
2021-05-25 21:37:14 +02:00
|
|
|
{showThemeBtn && actionManager.renderAction("toggleTheme")}
|
|
|
|
{appState.fileHandle && (
|
|
|
|
<div style={{ marginInlineStart: "0.25rem" }}>
|
2021-05-28 02:10:33 +05:30
|
|
|
{actionManager.renderAction("saveToActiveFile")}
|
2021-05-25 21:37:14 +02:00
|
|
|
</div>
|
|
|
|
)}
|
2020-08-13 04:35:31 -07:00
|
|
|
</div>
|
|
|
|
);
|