From d9b2128b8dc064dd38b7901da7236b994b053667 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 25 Jan 2023 12:56:43 +0100 Subject: [PATCH] clean up file-explorer and context menu --- .../src/lib/components/file-explorer-context-menu.tsx | 6 ++---- .../remix-ui/workspace/src/lib/components/file-explorer.tsx | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/libs/remix-ui/workspace/src/lib/components/file-explorer-context-menu.tsx b/libs/remix-ui/workspace/src/lib/components/file-explorer-context-menu.tsx index 268ea3c5f0..66432f6872 100644 --- a/libs/remix-ui/workspace/src/lib/components/file-explorer-context-menu.tsx +++ b/libs/remix-ui/workspace/src/lib/components/file-explorer-context-menu.tsx @@ -13,7 +13,7 @@ declare global { const _paq = window._paq = window._paq || [] //eslint-disable-line export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) => { - const { actions, createNewFile, createNewFolder, deletePath, renamePath, hideContextMenu, pushChangesToGist, publishFileToGist, publishFolderToGist, copy, copyFileName, copyPath, paste, runScript, emit, pageX, pageY, path, type, focus, generateUml, ...otherProps } = props + const { actions, createNewFile, createNewFolder, deletePath, renamePath, hideContextMenu, pushChangesToGist, publishFileToGist, publishFolderToGist, copy, copyFileName, copyPath, paste, runScript, emit, pageX, pageY, path, type, focus, ...otherProps } = props const contextMenuRef = useRef(null) const intl = useIntl() useEffect(() => { @@ -64,9 +64,7 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) => } const menu = () => { - return actions.filter(item => filterItem(item)).sort((a, b) => { - return a.name > b.name ? -1 : a.name < b.name ? 1 : 0 - }).reverse().map((item, index) => { + return actions.filter(item => filterItem(item)).map((item, index) => { return
  • { - const { name, contextMenuItems, removedContextMenuItems, files, fileState, plugin } = props + const { name, contextMenuItems, removedContextMenuItems, files, fileState } = props const [state, setState] = useState({ ctrlKey: false, newFileName: '', @@ -38,8 +38,6 @@ export const FileExplorer = (props: FileExplorerProps) => { }) const [canPaste, setCanPaste] = useState(false) const treeRef = useRef(null) - const [contentForAST, setContentForAST] = useState('') - useEffect(() => { if (contextMenuItems) {