Browse Source

hide export menu and save file based on UIOptions

zsviczian 2 years ago
parent
commit
49b74cddb9
1 changed files with 11 additions and 8 deletions
  1. 11 8
      src/components/LayerUI.tsx

+ 11 - 8
src/components/LayerUI.tsx

@@ -216,16 +216,19 @@ const LayerUI = ({
               {actionManager.renderAction("loadScene")}
               {actionManager.renderAction("loadScene")}
               {/* // TODO barnabasmolnar/editor-redesign  */}
               {/* // TODO barnabasmolnar/editor-redesign  */}
               {/* is this fine here? */}
               {/* is this fine here? */}
-              {appState.fileHandle &&
+              {UIOptions.canvasActions.saveToActiveFile &&
+                appState.fileHandle &&
                 actionManager.renderAction("saveToActiveFile")}
                 actionManager.renderAction("saveToActiveFile")}
               {renderJSONExportDialog()}
               {renderJSONExportDialog()}
-              <MenuItem
-                label={t("buttons.exportImage")}
-                icon={ExportImageIcon}
-                dataTestId="image-export-button"
-                onClick={() => setAppState({ openDialog: "imageExport" })}
-                shortcut={getShortcutFromShortcutName("imageExport")}
-              />
+              {UIOptions.canvasActions.export && (
+                <MenuItem
+                  label={t("buttons.exportImage")}
+                  icon={ExportImageIcon}
+                  dataTestId="image-export-button"
+                  onClick={() => setAppState({ openDialog: "imageExport" })}
+                  shortcut={getShortcutFromShortcutName("imageExport")}
+                />
+              )}
               {onCollabButtonClick && (
               {onCollabButtonClick && (
                 <CollabButton
                 <CollabButton
                   isCollaborating={isCollaborating}
                   isCollaborating={isCollaborating}