From a7dee69d4d8de65fdaa59fabca41a661ac265512 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 17 May 2021 15:20:47 +0200 Subject: [PATCH] remove items that are not sticky --- apps/remix-ide/src/app/panels/file-panel.js | 4 +- .../file-explorer/src/lib/file-explorer.tsx | 44 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/panels/file-panel.js b/apps/remix-ide/src/app/panels/file-panel.js index 09d697acea..3021372b94 100644 --- a/apps/remix-ide/src/app/panels/file-panel.js +++ b/apps/remix-ide/src/app/panels/file-panel.js @@ -72,6 +72,7 @@ module.exports = class Filepanel extends ViewPlugin { } renderComponent () { + console.log("render", this.registeredMenuItems) ReactDOM.render( { - return item.id !== plugin.name + return item.id !== plugin.name || item.sticky === true }) + this.renderComponent() } async getCurrentWorkspace () { diff --git a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx index d862c19fc1..d104a3e16c 100644 --- a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx +++ b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx @@ -17,6 +17,50 @@ import './css/file-explorer.css' const queryParams = new QueryParams() +const initialActions = [{ + id: 'newFile', + name: 'New File', + type: ['folder'], + path: [], + extension: [], + pattern: [] +}, { + id: 'newFolder', + name: 'New Folder', + type: ['folder'], + path: [], + extension: [], + pattern: [] +}, { + id: 'rename', + name: 'Rename', + type: ['file', 'folder'], + path: [], + extension: [], + pattern: [] +}, { + id: 'delete', + name: 'Delete', + type: ['file', 'folder'], + path: [], + extension: [], + pattern: [] +}, { + id: 'pushChangesToGist', + name: 'Push changes to gist', + type: [], + path: [], + extension: [], + pattern: ['^browser/gists/([0-9]|[a-z])*$'] +}, { + id: 'run', + name: 'Run', + type: [], + path: [], + extension: ['.js'], + pattern: [] +}] + export const FileExplorer = (props: FileExplorerProps) => { const { name, registry, plugin, focusRoot, contextMenuItems, displayInput, externalUploads } = props const [state, setState] = useState({