more changes as per review comments

pull/5370/head
Joseph Izang 2 years ago committed by Aniket
parent 238768d5fd
commit 3afcbfc0ae
  1. 4
      libs/remix-ui/workspace/src/lib/css/remix-ui-workspace.css
  2. 176
      libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx

@ -105,3 +105,7 @@
.remixui_topmenu { .remixui_topmenu {
padding-bottom: 0.1rem; padding-bottom: 0.1rem;
} }
.remixui_menuwidth {
width: 8rem;
}

@ -302,7 +302,14 @@ export function Workspace () {
</Tooltip> </Tooltip>
} }
> >
<div> <div
data-id='workspaceCreate'
onClick={(e) => {
e.stopPropagation()
createWorkspace()
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspaceCreate'])
}}
>
<span <span
hidden={currentWorkspace === LOCALHOST} hidden={currentWorkspace === LOCALHOST}
id='workspaceCreate' id='workspaceCreate'
@ -312,56 +319,108 @@ export function Workspace () {
createWorkspace() createWorkspace()
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspaceCreate']) _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspaceCreate'])
}} }}
className='far fa-plus remixui_menuicon' className='far fa-plus'
> >
</span> </span>
<span className="pl-3">Create</span> <span className="pl-3">Create</span>
</div> </div>
</OverlayTrigger>, </OverlayTrigger>,
<OverlayTrigger <OverlayTrigger
placement='right-start' placement="right-start"
overlay={ overlay={
<Tooltip id="workspaceRenametooltip"> <Tooltip id="createWorkspaceTooltip" className="text-nowrap">
<span>Rename Workspace</span> <span>Delete Workspace</span>
</Tooltip> </Tooltip>
} }
> >
<span <div
hidden={currentWorkspace === LOCALHOST || currentWorkspace === NO_WORKSPACE} data-id='workspaceDelete'
id='workspaceRename'
data-id='workspaceRename'
onClick={(e) => { onClick={(e) => {
e.stopPropagation() e.stopPropagation()
renameCurrentWorkspace() deleteCurrentWorkspace()
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspaceRename']) _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspaceDelete'])
hideIconsMenu(!showIconsMenu) hideIconsMenu(!showIconsMenu)
}} }}
className='far fa-edit w-100'> >
<span className="pl-2">{'Rename'}</span> <span
</span> hidden={currentWorkspace === LOCALHOST || currentWorkspace === NO_WORKSPACE}
id='workspaceDelete'
data-id='workspaceDelete'
onClick={(e) => {
e.stopPropagation()
deleteCurrentWorkspace()
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspaceDelete'])
hideIconsMenu(!showIconsMenu)
}}
className='far fa-trash'
>
</span>
<span className="pl-3">{'Delete'}</span>
</div>
</OverlayTrigger>, </OverlayTrigger>,
<OverlayTrigger <OverlayTrigger
placement="right-start" placement="right-start"
overlay={ overlay={
<Tooltip id="createWorkspaceTooltip" className="text-nowrap"> <Tooltip id="createWorkspaceTooltip" className="text-nowrap">
<span>Delete Workspace</span> <span>Clone Git Repository</span>
</Tooltip> </Tooltip>
} }
> >
<span <div
hidden={currentWorkspace === LOCALHOST || currentWorkspace === NO_WORKSPACE} data-id='cloneGitRepository'
id='workspaceDelete'
data-id='workspaceDelete'
onClick={(e) => { onClick={(e) => {
e.stopPropagation() e.stopPropagation()
deleteCurrentWorkspace() cloneGitRepository()
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspaceDelete']) _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'cloneGitRepository'])
hideIconsMenu(!showIconsMenu) hideIconsMenu(!showIconsMenu)
}} }}
className='far fa-trash w-100'
> >
<span className="pl-2">{'Delete'}</span> <span
</span> hidden={currentWorkspace === LOCALHOST}
id='cloneGitRepository'
data-id='cloneGitRepository'
onClick={(e) => {
e.stopPropagation()
cloneGitRepository()
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'cloneGitRepository'])
hideIconsMenu(!showIconsMenu)
}}
className='far fa-clone'
>
</span>
<span className="pl-3">{'Clone'}</span>
</div>
</OverlayTrigger>,
<OverlayTrigger
placement='right-start'
overlay={
<Tooltip id="workspaceRenametooltip">
<span>Rename Workspace</span>
</Tooltip>
}
>
<div onClick={(e) => {
e.stopPropagation()
renameCurrentWorkspace()
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspaceRename'])
hideIconsMenu(!showIconsMenu)
}}
data-id='workspaceRename'
>
<span
hidden={currentWorkspace === LOCALHOST || currentWorkspace === NO_WORKSPACE}
id='workspaceRename'
data-id='workspaceRename'
onClick={(e) => {
e.stopPropagation()
renameCurrentWorkspace()
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspaceRename'])
hideIconsMenu(!showIconsMenu)
}}
className='far fa-edit'>
</span>
<span className="pl-3">{'Rename'}</span>
</div>
</OverlayTrigger>, </OverlayTrigger>,
<OverlayTrigger <OverlayTrigger
placement="right-start" placement="right-start"
@ -371,9 +430,7 @@ export function Workspace () {
</Tooltip> </Tooltip>
} }
> >
<span <div
hidden={currentWorkspace === LOCALHOST || currentWorkspace === NO_WORKSPACE}
id='workspacesDownload'
data-id='workspacesDownload' data-id='workspacesDownload'
onClick={(e) => { onClick={(e) => {
e.stopPropagation() e.stopPropagation()
@ -381,10 +438,22 @@ export function Workspace () {
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspacesDownload']) _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspacesDownload'])
hideIconsMenu(!showIconsMenu) hideIconsMenu(!showIconsMenu)
}} }}
className='far fa-download w-100'
> >
<span className="pl-2">{'Download'}</span> <span
</span> hidden={currentWorkspace === LOCALHOST || currentWorkspace === NO_WORKSPACE}
id='workspacesDownload'
data-id='workspacesDownload'
onClick={(e) => {
e.stopPropagation()
downloadWorkspaces()
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspacesDownload'])
hideIconsMenu(!showIconsMenu)
}}
className='far fa-download'
>
</span>
<span className="pl-3">{'Download'}</span>
</div>
</OverlayTrigger>, </OverlayTrigger>,
<OverlayTrigger <OverlayTrigger
placement="right-start" placement="right-start"
@ -394,9 +463,7 @@ export function Workspace () {
</Tooltip> </Tooltip>
} }
> >
<span <div
hidden={currentWorkspace === LOCALHOST}
id='workspacesRestore'
data-id='workspacesRestore' data-id='workspacesRestore'
onClick={(e) => { onClick={(e) => {
e.stopPropagation() e.stopPropagation()
@ -404,34 +471,23 @@ export function Workspace () {
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspacesRestore']) _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspacesRestore'])
hideIconsMenu(!showIconsMenu) hideIconsMenu(!showIconsMenu)
}} }}
className='far fa-upload w-100'
> >
<span className="pl-2">{'Restore'}</span> <span
</span> hidden={currentWorkspace === LOCALHOST}
id='workspacesRestore'
data-id='workspacesRestore'
onClick={(e) => {
e.stopPropagation()
restoreBackup()
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspacesRestore'])
hideIconsMenu(!showIconsMenu)
}}
className='far fa-upload'
>
</span>
<span className="pl-3">{'Restore'}</span>
</div>
</OverlayTrigger>, </OverlayTrigger>,
<OverlayTrigger
placement="right-start"
overlay={
<Tooltip id="createWorkspaceTooltip" className="text-nowrap">
<span>Clone Git Repository</span>
</Tooltip>
}
>
<span
hidden={currentWorkspace === LOCALHOST}
id='cloneGitRepository'
data-id='cloneGitRepository'
onClick={(e) => {
e.stopPropagation()
cloneGitRepository()
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'cloneGitRepository'])
hideIconsMenu(!showIconsMenu)
}}
className='far fa-clone w-100'
>
<span className="pl-2">{'Clone'}</span>
</span>
</OverlayTrigger>
] ]
return ( return (
@ -478,7 +534,7 @@ export function Workspace () {
}} }}
icon={'fas fa-bars'} icon={'fas fa-bars'}
></Dropdown.Toggle> ></Dropdown.Toggle>
<Dropdown.Menu as={CustomMenu} data-id="wsdropdownMenu" className='custom-dropdown-items' align={'right'}> <Dropdown.Menu as={CustomMenu} data-id="wsdropdownMenu" className='custom-dropdown-items remixui_menuwidth' align={'right'}>
{ {
workspaceMenuIcons.map(m => ( workspaceMenuIcons.map(m => (
<Dropdown.Item> <Dropdown.Item>

Loading…
Cancel
Save