mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
chore: clean code
This commit is contained in:
parent
9b18b039ca
commit
eb5ebce5bf
2 changed files with 24 additions and 14 deletions
|
|
@ -59,11 +59,7 @@ export default class FileExplorer extends React.Component {
|
|||
renderFiles(visibleNodes, onNodeClick) {
|
||||
const { nodes, depths, focusedNode, expandedNodes } = visibleNodes
|
||||
if (nodes.length === 0) {
|
||||
return (
|
||||
<label className={'no-results'}>
|
||||
No results found.
|
||||
</label>
|
||||
)
|
||||
return <label className={'no-results'}>No results found.</label>
|
||||
}
|
||||
return (
|
||||
<div className={'files'}>
|
||||
|
|
@ -82,19 +78,33 @@ export default class FileExplorer extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { stateText, visibleNodes, freeze, handleKeyDown, handleSearchKeyChange, onNodeClick, toggleShowSettings, onFocusSearchBar } = this.props
|
||||
const {
|
||||
stateText,
|
||||
visibleNodes,
|
||||
freeze,
|
||||
handleKeyDown,
|
||||
handleSearchKeyChange,
|
||||
onNodeClick,
|
||||
toggleShowSettings,
|
||||
onFocusSearchBar,
|
||||
} = this.props
|
||||
return (
|
||||
<div className={cx(`file-explorer`, { freeze })} tabIndex={-1} onKeyDown={handleKeyDown} onClick={ freeze ? toggleShowSettings : null}>
|
||||
{
|
||||
stateText
|
||||
? <LoadingIndicator text={stateText} />
|
||||
: visibleNodes && (
|
||||
<div
|
||||
className={cx(`file-explorer`, { freeze })}
|
||||
tabIndex={-1}
|
||||
onKeyDown={handleKeyDown}
|
||||
onClick={freeze ? toggleShowSettings : null}
|
||||
>
|
||||
{stateText ? (
|
||||
<LoadingIndicator text={stateText} />
|
||||
) : (
|
||||
visibleNodes && (
|
||||
<React.Fragment>
|
||||
<SearchBar onSearchKeyChange={handleSearchKeyChange} onFocus={onFocusSearchBar} />
|
||||
{this.renderFiles(visibleNodes, onNodeClick)}
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import * as React from 'react'
|
||||
import * as ReactDOM from 'react-dom'
|
||||
import React from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
import Gitako from 'components/Gitako'
|
||||
import { addMiddleware } from 'driver/connect'
|
||||
import { withErrorLog } from 'analytics'
|
||||
|
|
|
|||
Loading…
Reference in a new issue