Merge pull request #1359 from ethereum/labelcontextmenu

add label to context  menu
pull/1358/head^2
bunsenstraat 4 years ago committed by GitHub
commit 80b6f3f2d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx
  2. 36
      libs/remix-ui/file-explorer/src/lib/file-explorer.tsx
  3. 2
      libs/remix-ui/file-explorer/src/lib/types/index.ts

@ -101,7 +101,7 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) =>
break
}
hideContextMenu()
}}>{item.name}</li>
}}>{item.label || item.name}</li>
})
}

@ -35,7 +35,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [],
extension: [],
pattern: [],
multiselect: false
multiselect: false,
label: ''
}, {
id: 'newFolder',
name: 'New Folder',
@ -43,7 +44,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [],
extension: [],
pattern: [],
multiselect: false
multiselect: false,
label: ''
}, {
id: 'rename',
name: 'Rename',
@ -51,7 +53,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [],
extension: [],
pattern: [],
multiselect: false
multiselect: false,
label: ''
}, {
id: 'delete',
name: 'Delete',
@ -59,7 +62,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [],
extension: [],
pattern: [],
multiselect: false
multiselect: false,
label: ''
}, {
id: 'run',
name: 'Run',
@ -67,7 +71,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [],
extension: ['.js'],
pattern: [],
multiselect: false
multiselect: false,
label: ''
}, {
id: 'pushChangesToGist',
name: 'Push changes to gist',
@ -75,7 +80,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [],
extension: [],
pattern: [],
multiselect: false
multiselect: false,
label: ''
}, {
id: 'publishFolderToGist',
name: 'Publish folder to gist',
@ -83,7 +89,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [],
extension: [],
pattern: [],
multiselect: false
multiselect: false,
label: ''
}, {
id: 'publishFileToGist',
name: 'Publish file to gist',
@ -91,7 +98,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [],
extension: [],
pattern: [],
multiselect: false
multiselect: false,
label: ''
}, {
id: 'copy',
name: 'Copy',
@ -99,7 +107,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [],
extension: [],
pattern: [],
multiselect: false
multiselect: false,
label: ''
}, {
id: 'deleteAll',
name: 'Delete All',
@ -107,7 +116,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [],
extension: [],
pattern: [],
multiselect: true
multiselect: true,
label: ''
}],
focusContext: {
element: null,
@ -282,7 +292,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [],
extension: [],
pattern: [],
multiselect: false
multiselect: false,
label: ''
}])
} else {
removeMenuItems([{
@ -292,7 +303,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [],
extension: [],
pattern: [],
multiselect: false
multiselect: false,
label: ''
}])
}
}, [canPaste])

@ -32,7 +32,7 @@ export interface FileExplorerMenuProps {
uploadFile: (target: EventTarget & HTMLInputElement) => void
}
export type action = { name: string, type: string[], path: string[], extension: string[], pattern: string[], id: string, multiselect: boolean }
export type action = { name: string, type: string[], path: string[], extension: string[], pattern: string[], id: string, multiselect: boolean, label: string }
export type MenuItems = action[]
export interface FileExplorerContextMenuProps {

Loading…
Cancel
Save