do not show localhost explorer if it is not required

pull/5370/head
lianahus 2 years ago committed by GitHub
parent 012954387c
commit 5c672782d5
  1. 151
      libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx

@ -309,83 +309,80 @@ export function Workspace () {
<div className='h-100 remixui_fileExplorerTree' onFocus={() => { toggleDropdown(false) }}> <div className='h-100 remixui_fileExplorerTree' onFocus={() => { toggleDropdown(false) }}>
<div className='h-100'> <div className='h-100'>
{ (global.fs.browser.isRequestingWorkspace || global.fs.browser.isRequestingCloning) && <div className="text-center py-5"><i className="fas fa-spinner fa-pulse fa-2x"></i></div>} { (global.fs.browser.isRequestingWorkspace || global.fs.browser.isRequestingCloning) && <div className="text-center py-5"><i className="fas fa-spinner fa-pulse fa-2x"></i></div>}
{ !(global.fs.browser.isRequestingWorkspace || { !(global.fs.browser.isRequestingWorkspace || global.fs.browser.isRequestingCloning) &&
global.fs.browser.isRequestingCloning) && (global.fs.mode === 'browser') && (currentWorkspace !== NO_WORKSPACE) &&
(global.fs.mode === 'browser') && (currentWorkspace !== NO_WORKSPACE) && <div className='h-100 remixui_treeview' data-id='filePanelFileExplorerTree'>
<div className='h-100 remixui_treeview' data-id='filePanelFileExplorerTree'> <FileExplorer
<FileExplorer name={currentWorkspace}
name={currentWorkspace} menuItems={['createNewFile', 'createNewFolder', 'publishToGist', canUpload ? 'uploadFile' : '']}
menuItems={['createNewFile', 'createNewFolder', 'publishToGist', canUpload ? 'uploadFile' : '']} contextMenuItems={global.fs.browser.contextMenu.registeredMenuItems}
contextMenuItems={global.fs.browser.contextMenu.registeredMenuItems} removedContextMenuItems={global.fs.browser.contextMenu.removedMenuItems}
removedContextMenuItems={global.fs.browser.contextMenu.removedMenuItems} files={global.fs.browser.files}
files={global.fs.browser.files} fileState={global.fs.browser.fileState}
fileState={global.fs.browser.fileState} expandPath={global.fs.browser.expandPath}
expandPath={global.fs.browser.expandPath} focusEdit={global.fs.focusEdit}
focusEdit={global.fs.focusEdit} focusElement={global.fs.focusElement}
focusElement={global.fs.focusElement} dispatchCreateNewFile={global.dispatchCreateNewFile}
dispatchCreateNewFile={global.dispatchCreateNewFile} modal={global.modal}
modal={global.modal} dispatchCreateNewFolder={global.dispatchCreateNewFolder}
dispatchCreateNewFolder={global.dispatchCreateNewFolder} readonly={global.fs.readonly}
readonly={global.fs.readonly} toast={global.toast}
toast={global.toast} dispatchDeletePath={global.dispatchDeletePath}
dispatchDeletePath={global.dispatchDeletePath} dispatchRenamePath={global.dispatchRenamePath}
dispatchRenamePath={global.dispatchRenamePath} dispatchUploadFile={global.dispatchUploadFile}
dispatchUploadFile={global.dispatchUploadFile} dispatchCopyFile={global.dispatchCopyFile}
dispatchCopyFile={global.dispatchCopyFile} dispatchCopyFolder={global.dispatchCopyFolder}
dispatchCopyFolder={global.dispatchCopyFolder} dispatchPublishToGist={global.dispatchPublishToGist}
dispatchPublishToGist={global.dispatchPublishToGist} dispatchRunScript={global.dispatchRunScript}
dispatchRunScript={global.dispatchRunScript} dispatchEmitContextMenuEvent={global.dispatchEmitContextMenuEvent}
dispatchEmitContextMenuEvent={global.dispatchEmitContextMenuEvent} dispatchHandleClickFile={global.dispatchHandleClickFile}
dispatchHandleClickFile={global.dispatchHandleClickFile} dispatchSetFocusElement={global.dispatchSetFocusElement}
dispatchSetFocusElement={global.dispatchSetFocusElement} dispatchFetchDirectory={global.dispatchFetchDirectory}
dispatchFetchDirectory={global.dispatchFetchDirectory} dispatchRemoveInputField={global.dispatchRemoveInputField}
dispatchRemoveInputField={global.dispatchRemoveInputField} dispatchAddInputField={global.dispatchAddInputField}
dispatchAddInputField={global.dispatchAddInputField} dispatchHandleExpandPath={global.dispatchHandleExpandPath}
dispatchHandleExpandPath={global.dispatchHandleExpandPath} dispatchMoveFile={global.dispatchMoveFile}
dispatchMoveFile={global.dispatchMoveFile} dispatchMoveFolder={global.dispatchMoveFolder}
dispatchMoveFolder={global.dispatchMoveFolder} />
/> </div>
</div> }
} { global.fs.localhost.isRequestingLocalhost && <div className="text-center py-5"><i className="fas fa-spinner fa-pulse fa-2x"></i></div> }
{ { (global.fs.mode === 'localhost' && global.fs.localhost.isSuccessfulLocalhost) &&
global.fs.localhost.isRequestingLocalhost ? <div className="text-center py-5"><i className="fas fa-spinner fa-pulse fa-2x"></i></div> <div className='h-100 filesystemexplorer remixui_treeview'>
: <div className='h-100 filesystemexplorer remixui_treeview'> <FileExplorer
{ global.fs.mode === 'localhost' && global.fs.localhost.isSuccessfulLocalhost && name='localhost'
<FileExplorer menuItems={['createNewFile', 'createNewFolder']}
name='localhost' contextMenuItems={global.fs.localhost.contextMenu.registeredMenuItems}
menuItems={['createNewFile', 'createNewFolder']} removedContextMenuItems={global.fs.localhost.contextMenu.removedMenuItems}
contextMenuItems={global.fs.localhost.contextMenu.registeredMenuItems} files={global.fs.localhost.files}
removedContextMenuItems={global.fs.localhost.contextMenu.removedMenuItems} fileState={[]}
files={global.fs.localhost.files} expandPath={global.fs.localhost.expandPath}
fileState={[]} focusEdit={global.fs.focusEdit}
expandPath={global.fs.localhost.expandPath} focusElement={global.fs.focusElement}
focusEdit={global.fs.focusEdit} dispatchCreateNewFile={global.dispatchCreateNewFile}
focusElement={global.fs.focusElement} modal={global.modal}
dispatchCreateNewFile={global.dispatchCreateNewFile} dispatchCreateNewFolder={global.dispatchCreateNewFolder}
modal={global.modal} readonly={global.fs.readonly}
dispatchCreateNewFolder={global.dispatchCreateNewFolder} toast={global.toast}
readonly={global.fs.readonly} dispatchDeletePath={global.dispatchDeletePath}
toast={global.toast} dispatchRenamePath={global.dispatchRenamePath}
dispatchDeletePath={global.dispatchDeletePath} dispatchUploadFile={global.dispatchUploadFile}
dispatchRenamePath={global.dispatchRenamePath} dispatchCopyFile={global.dispatchCopyFile}
dispatchUploadFile={global.dispatchUploadFile} dispatchCopyFolder={global.dispatchCopyFolder}
dispatchCopyFile={global.dispatchCopyFile} dispatchPublishToGist={global.dispatchPublishToGist}
dispatchCopyFolder={global.dispatchCopyFolder} dispatchRunScript={global.dispatchRunScript}
dispatchPublishToGist={global.dispatchPublishToGist} dispatchEmitContextMenuEvent={global.dispatchEmitContextMenuEvent}
dispatchRunScript={global.dispatchRunScript} dispatchHandleClickFile={global.dispatchHandleClickFile}
dispatchEmitContextMenuEvent={global.dispatchEmitContextMenuEvent} dispatchSetFocusElement={global.dispatchSetFocusElement}
dispatchHandleClickFile={global.dispatchHandleClickFile} dispatchFetchDirectory={global.dispatchFetchDirectory}
dispatchSetFocusElement={global.dispatchSetFocusElement} dispatchRemoveInputField={global.dispatchRemoveInputField}
dispatchFetchDirectory={global.dispatchFetchDirectory} dispatchAddInputField={global.dispatchAddInputField}
dispatchRemoveInputField={global.dispatchRemoveInputField} dispatchHandleExpandPath={global.dispatchHandleExpandPath}
dispatchAddInputField={global.dispatchAddInputField} dispatchMoveFile={global.dispatchMoveFile}
dispatchHandleExpandPath={global.dispatchHandleExpandPath} dispatchMoveFolder={global.dispatchMoveFolder}
dispatchMoveFile={global.dispatchMoveFile} />
dispatchMoveFolder={global.dispatchMoveFolder} </div>
/> }
}
</div>
}
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save