import React from "react"; import { ActionManager } from "../actions/manager"; import { EVENT_CHANGE, trackEvent } from "../analytics"; import { AppState } from "../types"; import { DarkModeToggle } from "./DarkModeToggle"; export const BackgroundPickerAndDarkModeToggle = ({ appState, setAppState, actionManager, }: { actionManager: ActionManager; appState: AppState; setAppState: React.Component["setState"]; }) => (
{actionManager.renderAction("changeViewBackgroundColor")}
{ // TODO: track the theme on the first load too trackEvent(EVENT_CHANGE, "theme", appearance); setAppState({ appearance }); }} />
);