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 eb166a70698..67f3eb3046b 100644 --- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx +++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx @@ -962,6 +962,35 @@ export function Workspace() { ) } + 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 (
- {selectedWorkspace ? selectedWorkspace.name === LOCALHOST ? 'Connected to Local FileSystem' : selectedWorkspace.name : currentWorkspace === LOCALHOST ? formatNameForReadonly('localhost') : NO_WORKSPACE} + {selectedWorkspace ? selectedWorkspace.name === LOCALHOST ? togglerText : selectedWorkspace.name : currentWorkspace === LOCALHOST ? formatNameForReadonly('localhost') : NO_WORKSPACE} {