fix key prop warning for file explorer menu

pull/3096/head
Joseph Izang 2 years ago committed by Aniket
parent a4d15eebc3
commit a8d4f1744b
  1. 4
      libs/remix-ui/workspace/src/lib/components/file-explorer-menu.tsx
  2. 6
      libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx

@ -70,12 +70,13 @@ export const FileExplorerMenu = (props: FileExplorerMenuProps) => {
tooltipId="uploadFileTooltip" tooltipId="uploadFileTooltip"
tooltipClasses="text-nowrap" tooltipClasses="text-nowrap"
tooltipText={title} tooltipText={title}
key={`index-${action}-${placement}-${icon}`}
> >
<label <label
id={action} id={action}
data-id={'fileExplorerUploadFile' + action } data-id={'fileExplorerUploadFile' + action }
className={icon + ' mb-0 remixui_newFile'} className={icon + ' mb-0 remixui_newFile'}
key={index} key={`index-${action}-${placement}-${icon}`}
> >
<input id="fileUpload" data-id="fileExplorerFileUpload" type="file" onChange={(e) => { <input id="fileUpload" data-id="fileExplorerFileUpload" type="file" onChange={(e) => {
e.stopPropagation() e.stopPropagation()
@ -93,6 +94,7 @@ export const FileExplorerMenu = (props: FileExplorerMenuProps) => {
tooltipId={`${action}-${title}-${icon}-${index}`} tooltipId={`${action}-${title}-${icon}-${index}`}
tooltipClasses="text-nowrap" tooltipClasses="text-nowrap"
tooltipText={title} tooltipText={title}
key={`${action}-${title}-${index}`}
> >
<span <span
id={action} id={action}

@ -355,6 +355,7 @@ export function Workspace () {
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspaceCreate']) _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspaceCreate'])
hideIconsMenu(!showIconsMenu) hideIconsMenu(!showIconsMenu)
}} }}
key={`workspacesCreate-fe-ws`}
> >
<span <span
hidden={currentWorkspace === LOCALHOST} hidden={currentWorkspace === LOCALHOST}
@ -384,6 +385,7 @@ export function Workspace () {
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspaceDelete']) _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspaceDelete'])
hideIconsMenu(!showIconsMenu) hideIconsMenu(!showIconsMenu)
}} }}
key={`workspacesDelete-fe-ws`}
> >
<span <span
hidden={currentWorkspace === LOCALHOST || currentWorkspace === NO_WORKSPACE} hidden={currentWorkspace === LOCALHOST || currentWorkspace === NO_WORKSPACE}
@ -412,6 +414,7 @@ export function Workspace () {
hideIconsMenu(!showIconsMenu) hideIconsMenu(!showIconsMenu)
}} }}
data-id='workspaceRename' data-id='workspaceRename'
key={`workspacesRename-fe-ws`}
> >
<span <span
hidden={currentWorkspace === LOCALHOST || currentWorkspace === NO_WORKSPACE} hidden={currentWorkspace === LOCALHOST || currentWorkspace === NO_WORKSPACE}
@ -441,6 +444,7 @@ export function Workspace () {
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'cloneGitRepository']) _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'cloneGitRepository'])
hideIconsMenu(!showIconsMenu) hideIconsMenu(!showIconsMenu)
}} }}
key={`cloneGitRepository-fe-ws`}
> >
<span <span
hidden={currentWorkspace === LOCALHOST} hidden={currentWorkspace === LOCALHOST}
@ -471,6 +475,7 @@ export function Workspace () {
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspacesDownload']) _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspacesDownload'])
hideIconsMenu(!showIconsMenu) hideIconsMenu(!showIconsMenu)
}} }}
key={`workspacesDownload-fe-ws`}
> >
<span <span
hidden={currentWorkspace === LOCALHOST || currentWorkspace === NO_WORKSPACE} hidden={currentWorkspace === LOCALHOST || currentWorkspace === NO_WORKSPACE}
@ -500,6 +505,7 @@ export function Workspace () {
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspacesRestore']) _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspacesRestore'])
hideIconsMenu(!showIconsMenu) hideIconsMenu(!showIconsMenu)
}} }}
key={`workspacesRestore-fe-ws`}
> >
<span <span
hidden={currentWorkspace === LOCALHOST} hidden={currentWorkspace === LOCALHOST}

Loading…
Cancel
Save