label to context menu

pull/1359/head
filip mertens 4 years ago
parent b04203ec43
commit 92ae0b3b3b
  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 break
} }
hideContextMenu() hideContextMenu()
}}>{item.name}</li> }}>{item.label || item.name}</li>
}) })
} }

@ -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) => {
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) => {
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) => {
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) => {
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) => {
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) => {
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) => {
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) => {
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) => {
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) => {
path: [], path: [],
extension: [], extension: [],
pattern: [], pattern: [],
multiselect: false multiselect: false,
label: ''
}]) }])
} else { } else {
removeMenuItems([{ removeMenuItems([{
@ -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 {
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 {

Loading…
Cancel
Save