mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-07 01:27:10 +02:00
feat: Add shortcut for dark mode (#3543)
* Create and move toggle into an action * Add shortcut on help dialog
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import React from "react";
|
||||
import { ActionManager } from "../actions/manager";
|
||||
import { AppState } from "../types";
|
||||
import { DarkModeToggle } from "./DarkModeToggle";
|
||||
|
||||
export const BackgroundPickerAndDarkModeToggle = ({
|
||||
appState,
|
||||
@@ -16,15 +15,6 @@ export const BackgroundPickerAndDarkModeToggle = ({
|
||||
}) => (
|
||||
<div style={{ display: "flex" }}>
|
||||
{actionManager.renderAction("changeViewBackgroundColor")}
|
||||
{showThemeBtn && (
|
||||
<div style={{ marginInlineStart: "0.25rem" }}>
|
||||
<DarkModeToggle
|
||||
value={appState.theme}
|
||||
onChange={(theme) => {
|
||||
setAppState({ theme });
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{showThemeBtn && <>{actionManager.renderAction("toggleTheme")}</>}
|
||||
</div>
|
||||
);
|
||||
|
Reference in New Issue
Block a user