From 4aa01513d17dcda1d1a610d22f1831a00e06cc38 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 16 Feb 2021 13:44:25 +0100 Subject: [PATCH] Break logic in single line --- libs/remix-ui/file-explorer/src/lib/file-explorer.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx index 880b08e258..63ac44ea01 100644 --- a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx +++ b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx @@ -891,6 +891,12 @@ export const FileExplorer = (props: FileExplorerProps) => { } const renderFiles = (file: File, index: number) => { + const labelClass = state.focusEdit.element === file.path + ? 'bg-light' : state.focusElement.findIndex(item => item.key === file.path) !== -1 + ? 'bg-secondary' : state.mouseOverElement === file.path + ? 'bg-secondary' : (state.focusContext.element === file.path) && (state.focusEdit.element !== file.path) + ? 'bg-secondary' : '' + if (file.isDirectory) { return (
@@ -909,7 +915,7 @@ export const FileExplorer = (props: FileExplorerProps) => { e.stopPropagation() handleContextMenuFolder(e.pageX, e.pageY, file.path, e.target.textContent) }} - labelClass={ state.focusEdit.element === file.path ? 'bg-light' : state.focusElement.findIndex(item => item.key === file.path) !== -1 ? 'bg-secondary' : state.mouseOverElement === file.path ? 'bg-secondary' : (state.focusContext.element === file.path) && (state.focusEdit.element !== file.path) ? 'bg-secondary' : '' } + labelClass={labelClass} controlBehaviour={ state.ctrlKey } expand={state.expandPath.includes(file.path)} onMouseOver={(e) => { @@ -969,7 +975,7 @@ export const FileExplorer = (props: FileExplorerProps) => { handleContextMenuFile(e.pageX, e.pageY, file.path, e.target.textContent) }} icon='far fa-file' - labelClass={ state.focusEdit.element === file.path ? 'bg-light' : state.focusElement.findIndex(item => item.key === file.path) !== -1 ? 'bg-secondary' : state.mouseOverElement === file.path ? 'bg-secondary' : (state.focusContext.element === file.path) && (state.focusEdit.element !== file.path) ? 'bg-secondary' : '' } + labelClass={labelClass} onMouseOver={(e) => { e.stopPropagation() handleMouseOver(file.path)