From de18410b40c137991240ba408ca0de404d1b90ca Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 6 Jan 2024 09:54:04 +0100 Subject: [PATCH] rm gist and upload download --- apps/remixdesktop/package.json | 2 +- .../src/lib/components/file-explorer-menu.tsx | 23 +++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/apps/remixdesktop/package.json b/apps/remixdesktop/package.json index 7fe7a291e2..6cb373b8b2 100644 --- a/apps/remixdesktop/package.json +++ b/apps/remixdesktop/package.json @@ -1,6 +1,6 @@ { "name": "remixdesktop", - "version": "0.0.6-Alpha", + "version": "0.0.7-Alpha", "main": "build/main.js", "license": "MIT", "type": "commonjs", diff --git a/libs/remix-ui/workspace/src/lib/components/file-explorer-menu.tsx b/libs/remix-ui/workspace/src/lib/components/file-explorer-menu.tsx index 313512cd67..243f68e1a9 100644 --- a/libs/remix-ui/workspace/src/lib/components/file-explorer-menu.tsx +++ b/libs/remix-ui/workspace/src/lib/components/file-explorer-menu.tsx @@ -4,47 +4,55 @@ import {FormattedMessage} from 'react-intl' import {Placement} from 'react-bootstrap/esm/Overlay' import {FileExplorerMenuProps} from '../types' import { FileSystemContext } from '../contexts' +import { appPlatformTypes, platformContext } from '@remix-ui/app' const _paq = (window._paq = window._paq || []) export const FileExplorerMenu = (props: FileExplorerMenuProps) => { const global = useContext(FileSystemContext) + const platform = useContext(platformContext) const [state, setState] = useState({ menuItems: [ { action: 'createNewFile', title: 'Create new file', icon: 'far fa-file', - placement: 'top' + placement: 'top', + platforms:[appPlatformTypes.web, appPlatformTypes.desktop] }, { action: 'createNewFolder', title: 'Create new folder', icon: 'far fa-folder', - placement: 'top' + placement: 'top', + platforms:[appPlatformTypes.web, appPlatformTypes.desktop] }, { action: 'publishToGist', title: 'Publish current workspace to GitHub gist', icon: 'fab fa-github', - placement: 'top' + placement: 'top', + platforms:[appPlatformTypes.web] }, { action: 'uploadFile', title: 'Upload files into current workspace', icon: 'far fa-upload', - placement: 'top' + placement: 'top', + platforms:[appPlatformTypes.web] }, { action: 'uploadFolder', title: 'Upload folder into current workspace', icon: 'far fa-folder-upload', - placement: 'top' + placement: 'top', + platforms:[appPlatformTypes.web] }, { action: 'updateGist', title: 'Update the current [gist] explorer', icon: 'fab fa-github', - placement: 'bottom-start' + placement: 'bottom-start', + platforms:[appPlatformTypes.web] } ].filter( (item) => @@ -72,7 +80,8 @@ export const FileExplorerMenu = (props: FileExplorerMenuProps) => { <> - {state.menuItems.map(({action, title, icon, placement}, index) => { + {state.menuItems.map(({ action, title, icon, placement, platforms }, index) => { + if (platforms && !platforms.includes(platform)) return null if (action === 'uploadFile') { return (