Commit 92ae0b3b authored by filip mertens's avatar filip mertens

label to context menu

parent b04203ec
...@@ -101,7 +101,7 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) => ...@@ -101,7 +101,7 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) =>
break break
} }
hideContextMenu() hideContextMenu()
}}>{item.name}</li> }}>{item.label || item.name}</li>
}) })
} }
......
...@@ -35,7 +35,8 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -35,7 +35,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [], path: [],
extension: [], extension: [],
pattern: [], pattern: [],
multiselect: false multiselect: false,
label: ''
}, { }, {
id: 'newFolder', id: 'newFolder',
name: 'New Folder', name: 'New Folder',
...@@ -43,7 +44,8 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -43,7 +44,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [], path: [],
extension: [], extension: [],
pattern: [], pattern: [],
multiselect: false multiselect: false,
label: ''
}, { }, {
id: 'rename', id: 'rename',
name: 'Rename', name: 'Rename',
...@@ -51,7 +53,8 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -51,7 +53,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [], path: [],
extension: [], extension: [],
pattern: [], pattern: [],
multiselect: false multiselect: false,
label: ''
}, { }, {
id: 'delete', id: 'delete',
name: 'Delete', name: 'Delete',
...@@ -59,7 +62,8 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -59,7 +62,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [], path: [],
extension: [], extension: [],
pattern: [], pattern: [],
multiselect: false multiselect: false,
label: ''
}, { }, {
id: 'run', id: 'run',
name: 'Run', name: 'Run',
...@@ -67,7 +71,8 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -67,7 +71,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [], path: [],
extension: ['.js'], extension: ['.js'],
pattern: [], pattern: [],
multiselect: false multiselect: false,
label: ''
}, { }, {
id: 'pushChangesToGist', id: 'pushChangesToGist',
name: 'Push changes to gist', name: 'Push changes to gist',
...@@ -75,7 +80,8 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -75,7 +80,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [], path: [],
extension: [], extension: [],
pattern: [], pattern: [],
multiselect: false multiselect: false,
label: ''
}, { }, {
id: 'publishFolderToGist', id: 'publishFolderToGist',
name: 'Publish folder to gist', name: 'Publish folder to gist',
...@@ -83,7 +89,8 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -83,7 +89,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [], path: [],
extension: [], extension: [],
pattern: [], pattern: [],
multiselect: false multiselect: false,
label: ''
}, { }, {
id: 'publishFileToGist', id: 'publishFileToGist',
name: 'Publish file to gist', name: 'Publish file to gist',
...@@ -91,7 +98,8 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -91,7 +98,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [], path: [],
extension: [], extension: [],
pattern: [], pattern: [],
multiselect: false multiselect: false,
label: ''
}, { }, {
id: 'copy', id: 'copy',
name: 'Copy', name: 'Copy',
...@@ -99,7 +107,8 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -99,7 +107,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [], path: [],
extension: [], extension: [],
pattern: [], pattern: [],
multiselect: false multiselect: false,
label: ''
}, { }, {
id: 'deleteAll', id: 'deleteAll',
name: 'Delete All', name: 'Delete All',
...@@ -107,7 +116,8 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -107,7 +116,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [], path: [],
extension: [], extension: [],
pattern: [], pattern: [],
multiselect: true multiselect: true,
label: ''
}], }],
focusContext: { focusContext: {
element: null, element: null,
...@@ -282,7 +292,8 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -282,7 +292,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [], path: [],
extension: [], extension: [],
pattern: [], pattern: [],
multiselect: false multiselect: false,
label: ''
}]) }])
} else { } else {
removeMenuItems([{ removeMenuItems([{
...@@ -292,7 +303,8 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -292,7 +303,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
path: [], path: [],
extension: [], extension: [],
pattern: [], pattern: [],
multiselect: false multiselect: false,
label: ''
}]) }])
} }
}, [canPaste]) }, [canPaste])
......
...@@ -32,7 +32,7 @@ export interface FileExplorerMenuProps { ...@@ -32,7 +32,7 @@ export interface FileExplorerMenuProps {
uploadFile: (target: EventTarget & HTMLInputElement) => void 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 type MenuItems = action[]
export interface FileExplorerContextMenuProps { export interface FileExplorerContextMenuProps {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment