From 61dc91dbd51737eb38af7009aa507dd4252cdbf5 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Thu, 20 Jun 2024 09:17:10 +0100 Subject: [PATCH] move ipfs and https button to FE menu --- .../home-tab/src/lib/components/homeTabFile.tsx | 2 +- .../src/lib/components/file-explorer-menu.tsx | 4 ++++ .../workspace/src/lib/components/file-explorer.tsx | 2 ++ .../remix-ui/workspace/src/lib/remix-ui-workspace.tsx | 11 ++++++++--- libs/remix-ui/workspace/src/lib/types/index.ts | 4 ++++ 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx index 06e5bee036..50d27574c5 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx @@ -310,7 +310,7 @@ function HomeTabFile({ plugin }: HomeTabFileProps) { } tooltipTextClasses="border bg-light text-dark p-1 pr-3" > diff --git a/libs/remix-ui/workspace/src/lib/components/file-explorer-menu.tsx b/libs/remix-ui/workspace/src/lib/components/file-explorer-menu.tsx index 5434ca8abf..6976044603 100644 --- a/libs/remix-ui/workspace/src/lib/components/file-explorer-menu.tsx +++ b/libs/remix-ui/workspace/src/lib/components/file-explorer-menu.tsx @@ -157,6 +157,10 @@ export const FileExplorerMenu = (props: FileExplorerMenuProps) => { props.createNewFolder() } else if (action === 'publishToGist' || action == 'updateGist') { props.publishToGist() + } else if (action === 'importFromIpfs') { + props.importFromIpfs() + } else if (action === 'importFromHttps') { + props.importFromHttps } else { state.actions[action]() } diff --git a/libs/remix-ui/workspace/src/lib/components/file-explorer.tsx b/libs/remix-ui/workspace/src/lib/components/file-explorer.tsx index 9b90deb035..788e6270f9 100644 --- a/libs/remix-ui/workspace/src/lib/components/file-explorer.tsx +++ b/libs/remix-ui/workspace/src/lib/components/file-explorer.tsx @@ -383,6 +383,8 @@ export const FileExplorer = (props: FileExplorerProps) => { publishToGist={publishToGist} uploadFile={uploadFile} uploadFolder={uploadFolder} + importFromHttps={props.importFromHttps} + importFromIpfs={props.importFromIpfs} /> diff --git a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx index d57b4618a2..dea454b894 100644 --- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx +++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx @@ -241,11 +241,11 @@ export function Workspace() { } const importFromIpfs = () => { - + return '' } const importFromHttps = () => { - + return '' } const cloneGitRepository = () => { @@ -1093,7 +1093,8 @@ export function Workspace() { )} @@ -1209,6 +1212,8 @@ export function Workspace() { deletePath={deletePath} renamePath={editModeOn} dragStatus={dragStatus} + importFromHttps={importFromHttps} + importFromIpfs={importFromIpfs} /> )} diff --git a/libs/remix-ui/workspace/src/lib/types/index.ts b/libs/remix-ui/workspace/src/lib/types/index.ts index 7d812c75ec..1d8b515759 100644 --- a/libs/remix-ui/workspace/src/lib/types/index.ts +++ b/libs/remix-ui/workspace/src/lib/types/index.ts @@ -153,6 +153,8 @@ export interface FileExplorerProps { createNewFolder:(parentFolder?: string) => Promise renamePath:(path: string, type: string, isNew?: boolean) => void dragStatus: (status: boolean) => void + importFromIpfs: any + importFromHttps: any } export interface FileExplorerMenuProps { @@ -163,6 +165,8 @@ export interface FileExplorerMenuProps { publishToGist: (path?: string) => void uploadFile: (target: EventTarget & HTMLInputElement) => void uploadFolder: (target: EventTarget & HTMLInputElement) => void + importFromIpfs: any + importFromHttps: any tooltipPlacement?: Placement } export interface FileExplorerContextMenuProps {