fix(components/main-menu): not show canvasBackground

This commit is contained in:
Guilherme Minozzi 2023-07-18 18:49:00 -03:00
parent 9f76f8677b
commit f3f7d0040c
No known key found for this signature in database
GPG key ID: EEDE4CCEC467F10E

View file

@ -4,6 +4,7 @@ import {
useExcalidrawSetAppState, useExcalidrawSetAppState,
useExcalidrawActionManager, useExcalidrawActionManager,
useExcalidrawElements, useExcalidrawElements,
useAppProps,
} from "../App"; } from "../App";
import { import {
ExportIcon, ExportIcon,
@ -198,8 +199,12 @@ export const ChangeCanvasBackground = () => {
const { t } = useI18n(); const { t } = useI18n();
const appState = useUIAppState(); const appState = useUIAppState();
const actionManager = useExcalidrawActionManager(); const actionManager = useExcalidrawActionManager();
const appProps = useAppProps();
if (appState.viewModeEnabled) { if (
appState.viewModeEnabled ||
!appProps.UIOptions.canvasActions.changeViewBackgroundColor
) {
return null; return null;
} }
return ( return (