From f3f7d0040c81f230b8eed97e8cd3b720616589f3 Mon Sep 17 00:00:00 2001 From: Guilherme Minozzi Date: Tue, 18 Jul 2023 18:49:00 -0300 Subject: [PATCH] fix(components/main-menu): not show canvasBackground --- src/components/main-menu/DefaultItems.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/main-menu/DefaultItems.tsx b/src/components/main-menu/DefaultItems.tsx index 919443d123..f32fe21c74 100644 --- a/src/components/main-menu/DefaultItems.tsx +++ b/src/components/main-menu/DefaultItems.tsx @@ -4,6 +4,7 @@ import { useExcalidrawSetAppState, useExcalidrawActionManager, useExcalidrawElements, + useAppProps, } from "../App"; import { ExportIcon, @@ -198,8 +199,12 @@ export const ChangeCanvasBackground = () => { const { t } = useI18n(); const appState = useUIAppState(); const actionManager = useExcalidrawActionManager(); + const appProps = useAppProps(); - if (appState.viewModeEnabled) { + if ( + appState.viewModeEnabled || + !appProps.UIOptions.canvasActions.changeViewBackgroundColor + ) { return null; } return (