feat: add props zenModeEnabled and gridModeEnabled so host can control completely (#2901)
* feat: add props zenModeEnabled and gridModeEnabled so host can control completely * dnt show exit zenmode button when prop present * fix * update when props change * Add tests * Add tests * update changelog and readme * update * Update src/tests/excalidrawPackage.test.tsx * Update src/packages/excalidraw/README.md Co-authored-by: Lipis <lipiridis@gmail.com> * Update src/packages/excalidraw/README.md Co-authored-by: David Luzar <luzar.david@gmail.com> * Apply suggestions from code review Co-authored-by: David Luzar <luzar.david@gmail.com> * fix specs Co-authored-by: Lipis <lipiridis@gmail.com> Co-authored-by: David Luzar <luzar.david@gmail.com>
This commit is contained in:
@ -52,6 +52,7 @@ interface LayerUIProps {
|
||||
onLockToggle: () => void;
|
||||
onInsertElements: (elements: readonly NonDeletedExcalidrawElement[]) => void;
|
||||
zenModeEnabled: boolean;
|
||||
showExitZenModeBtn: boolean;
|
||||
toggleZenMode: () => void;
|
||||
langCode: Language["code"];
|
||||
isCollaborating: boolean;
|
||||
@ -296,6 +297,7 @@ const LayerUI = ({
|
||||
onLockToggle,
|
||||
onInsertElements,
|
||||
zenModeEnabled,
|
||||
showExitZenModeBtn,
|
||||
toggleZenMode,
|
||||
isCollaborating,
|
||||
onExportToBackend,
|
||||
@ -579,7 +581,7 @@ const LayerUI = ({
|
||||
</div>
|
||||
<button
|
||||
className={clsx("disable-zen-mode", {
|
||||
"disable-zen-mode--visible": zenModeEnabled,
|
||||
"disable-zen-mode--visible": showExitZenModeBtn,
|
||||
})}
|
||||
onClick={toggleZenMode}
|
||||
>
|
||||
|
Reference in New Issue
Block a user