{
uploadFolder={uploadFolder}
importFromIpfs={props.importFromIpfs}
importFromHttps={props.importFromHttps}
+ connectToLocalFileSystem={() => props.connectToLocalFileSystem()}
+ handleGitInit={handleGitInit}
/>
diff --git a/libs/remix-ui/workspace/src/lib/components/workspace-hamburger.tsx b/libs/remix-ui/workspace/src/lib/components/workspace-hamburger.tsx
index 860ac4042ed..c83313cb655 100644
--- a/libs/remix-ui/workspace/src/lib/components/workspace-hamburger.tsx
+++ b/libs/remix-ui/workspace/src/lib/components/workspace-hamburger.tsx
@@ -17,6 +17,7 @@ export interface HamburgerMenuProps {
downloadWorkspaces: () => void
restoreBackup: () => void
hideIconsMenu: (showMenu: boolean) => void
+ handleRemixdWorkspace: () => void
showIconsMenu: boolean
hideWorkspaceOptions: boolean
hideLocalhostOptions: boolean
@@ -139,6 +140,17 @@ export function HamburgerMenu(props: HamburgerMenuProps) {
}}
platforms={[appPlatformTypes.web]}
>
+
+
{
+ props.handleRemixdWorkspace()
+ props.hideIconsMenu(!showIconsMenu)
+ }}
+ platforms={[appPlatformTypes.web]}
+ >
>
)
}
diff --git a/libs/remix-ui/workspace/src/lib/contexts/index.ts b/libs/remix-ui/workspace/src/lib/contexts/index.ts
index 47fba81fedb..04e1b7f8a38 100644
--- a/libs/remix-ui/workspace/src/lib/contexts/index.ts
+++ b/libs/remix-ui/workspace/src/lib/contexts/index.ts
@@ -2,6 +2,8 @@ import { branch } from '@remix-ui/git'
import { customAction } from '@remixproject/plugin-api'
import { createContext, SyntheticEvent } from 'react'
import { BrowserState } from '../reducers/workspace'
+import { Plugin } from '@remixproject/engine'
+import { CustomRemixApi } from '@remix-api'
export const FileSystemContext = createContext<{
fs: any,
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 3673851d110..1c424a442f1 100644
--- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
+++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
@@ -917,6 +917,86 @@ export function Workspace() {
_paq.push(['trackEvent', 'Workspace', 'GIT', 'login'])
}
+ const IsGitRepoDropDownMenuItem = (props: { isGitRepo: boolean, mName: string}) => {
+ return (
+ <>
+ {props.isGitRepo ? (
+
+ {currentWorkspace === props.mName ? ✓ {props.mName} : {props.mName}}
+
+
+ ) : (
+
{currentWorkspace === props.mName ? ✓ {props.mName} : {props.mName}}
+ )}
+ >
+ )
+ }
+
+ const ShowNonLocalHostMenuItems = () => {
+ const cachedFilter = global.fs.browser.workspaces.filter(x => !x.name.includes('localhost'))
+ return (
+ <>
+ {
+ currentWorkspace === LOCALHOST && cachedFilter.length > 0 ? cachedFilter.map(({ name, isGitRepo }, index) => (
+
{
+ switchWorkspace(name)
+ }}
+ data-id={`dropdown-item-${name}`}
+ >
+
+
+ )) :
+ }
+ >
+ )
+ }
+
+ const ShowAllMenuItems = () => {
+ return (
+ <>
+ { global.fs.browser.workspaces.map(({ name, isGitRepo }, index) => (
+
{ switchWorkspace(name) }}
+ data-id={`dropdown-item-${name}`}
+ >
+
+
+ ))}
+ >
+ )
+ }
+ const [togglerText, setTogglerText] = useState<'Connecting' | 'Connected to Local FileSystem'>('Connecting')
+
+ useEffect(() => {
+ setTimeout(() => {
+ setTogglerText('Connected to Local FileSystem')
+ }, 1000)
+ }, [selectedWorkspace])
+
+ const WorkspaceDropdownToggle = () => {
+ const [togglerText, setTogglerText] = useState<'Connecting' | 'Connected to Local FileSystem'>('Connecting')
+
+ useEffect(() => {
+ setTimeout(() => {
+ setTogglerText('Connected to Local FileSystem')
+ }, 1000)
+ }, [selectedWorkspace])
+
+ return (
+
+ {selectedWorkspace ? selectedWorkspace.name === LOCALHOST ? togglerText : selectedWorkspace.name : currentWorkspace === LOCALHOST ? formatNameForReadonly('localhost') : NO_WORKSPACE}
+
+ )
+ }
+
return (
switchWorkspace(LOCALHOST)}
createBlankWorkspace={createBlankWorkspace}
renameCurrentWorkspace={renameCurrentWorkspace}
downloadCurrentWorkspace={downloadCurrentWorkspace}
@@ -1024,54 +1105,25 @@ export function Workspace() {
className="btn btn-light btn-block w-100 d-inline-block border border-dark form-control mt-1"
icon={selectedWorkspace && selectedWorkspace.isGitRepo && !(currentWorkspace === LOCALHOST) ? 'far fa-code-branch' : null}
>
- {selectedWorkspace ? selectedWorkspace.name : currentWorkspace === LOCALHOST ? formatNameForReadonly('localhost') : NO_WORKSPACE}
+ {selectedWorkspace ? selectedWorkspace.name === LOCALHOST ? togglerText : selectedWorkspace.name : currentWorkspace === LOCALHOST ? formatNameForReadonly('localhost') : NO_WORKSPACE}
-
- {
- createWorkspace()
- }}
- >
- {
-
- {' '}
- - -{' '}
-
- }
-
{
switchWorkspace(LOCALHOST)
}}
>
{currentWorkspace === LOCALHOST ? (
- ✓ localhost
+ ✓ Connected to Local Filesystem
) : (
-
- {' '}
- {' '}
-
+ //
+ // {' '}
+ // {' '}
+ //
+ null
)}
- {global.fs.browser.workspaces.map(({ name, isGitRepo }, index) => (
- {
- switchWorkspace(name)
- }}
- data-id={`dropdown-item-${name}`}
- >
- {isGitRepo ? (
-
- {currentWorkspace === name ? ✓ {name} : {name}}
-
-
- ) : (
- {currentWorkspace === name ? ✓ {name} : {name}}
- )}
-
- ))}
+
{(global.fs.browser.workspaces.length <= 0 || currentWorkspace === NO_WORKSPACE) && (
{
@@ -1105,8 +1157,7 @@ export function Workspace() {
switchWorkspace(LOCALHOST)}
canPaste={canPaste}
hasCopied={hasCopied}
setHasCopied={setHasCopied}
diff --git a/libs/remix-ui/workspace/src/lib/types/index.ts b/libs/remix-ui/workspace/src/lib/types/index.ts
index 214c1196b24..71fb5f7271f 100644
--- a/libs/remix-ui/workspace/src/lib/types/index.ts
+++ b/libs/remix-ui/workspace/src/lib/types/index.ts
@@ -159,6 +159,8 @@ export interface FileExplorerProps {
dragStatus: (status: boolean) => void
importFromIpfs: any
importFromHttps: any
+ connectToLocalFileSystem?: any
+ handleGitInit?: () => Promise
handleMultiCopies: any
feTarget: { key: string, type: 'file' | 'folder' }[]
setFeTarget: Dispatch void
importFromIpfs: any
importFromHttps: any
+ connectToLocalFileSystem?: any
+ handleGitInit?: () => Promise
tooltipPlacement?: Placement
}
export interface FileExplorerContextMenuProps {