rm gist and upload download

LianaHus-patch-7
bunsenstraat 11 months ago
parent f488b5bb33
commit de18410b40
  1. 2
      apps/remixdesktop/package.json
  2. 23
      libs/remix-ui/workspace/src/lib/components/file-explorer-menu.tsx

@ -1,6 +1,6 @@
{
"name": "remixdesktop",
"version": "0.0.6-Alpha",
"version": "0.0.7-Alpha",
"main": "build/main.js",
"license": "MIT",
"type": "commonjs",

@ -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) => {
<>
<span data-id="spanContaining" className="pl-0 pb-1 w-50">
{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 (
<CustomTooltip

Loading…
Cancel
Save