Break logic in single line

pull/5370/head
ioedeveloper 4 years ago committed by GitHub
parent b27a5c6b88
commit 4aa01513d1
  1. 10
      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 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) { if (file.isDirectory) {
return ( return (
<div key={index}> <div key={index}>
@ -909,7 +915,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
e.stopPropagation() e.stopPropagation()
handleContextMenuFolder(e.pageX, e.pageY, file.path, e.target.textContent) 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 } controlBehaviour={ state.ctrlKey }
expand={state.expandPath.includes(file.path)} expand={state.expandPath.includes(file.path)}
onMouseOver={(e) => { onMouseOver={(e) => {
@ -969,7 +975,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
handleContextMenuFile(e.pageX, e.pageY, file.path, e.target.textContent) handleContextMenuFile(e.pageX, e.pageY, file.path, e.target.textContent)
}} }}
icon='far fa-file' 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) => { onMouseOver={(e) => {
e.stopPropagation() e.stopPropagation()
handleMouseOver(file.path) handleMouseOver(file.path)

Loading…
Cancel
Save