@@ -15,45 +15,47 @@ export default ({ file }: { file: FileObject }) => {
1515 const directory = ServerContext . useStoreState ( state => state . files . directory ) ;
1616
1717 return (
18- < a
18+ < div
1919 key = { file . name }
20- href = { file . isFile ? undefined : `#${ directory } /${ file . name } ` }
2120 className = { `
22- flex bg-neutral-700 text-neutral-300 rounded-sm mb-px text-sm
21+ flex bg-neutral-700 rounded-sm mb-px text-sm
2322 hover:text-neutral-100 cursor-pointer items-center no-underline hover:bg-neutral-600
2423 ` }
25- onClick = { ( e ) => {
26- if ( file . isFile ) {
27- return e . preventDefault ( ) ;
28- }
29- } }
3024 >
31- < div className = { 'flex-none text-neutral-400 mr-4 text-lg pl-3' } >
32- { file . isFile ?
33- < FontAwesomeIcon icon = { file . isSymlink ? faFileImport : faFileAlt } />
34- :
35- < FontAwesomeIcon icon = { faFolder } />
36- }
37- </ div >
38- < div className = { 'flex-1' } >
39- { file . name }
40- </ div >
41- { file . isFile &&
42- < div className = { 'w-1/6 text-right mr-4' } >
43- { bytesToHuman ( file . size ) }
44- </ div >
45- }
46- < div
47- className = { 'w-1/5 text-right mr-4' }
48- title = { file . modifiedAt . toString ( ) }
25+ < a
26+ href = { file . isFile ? undefined : `#${ directory } /${ file . name } ` }
27+ className = { 'flex flex-1 text-neutral-300 no-underline' }
28+ onClick = { e => {
29+ file . isFile && e . preventDefault ( ) ;
30+ } }
4931 >
50- { Math . abs ( differenceInHours ( file . modifiedAt , new Date ( ) ) ) > 48 ?
51- format ( file . modifiedAt , 'MMM Do, YYYY h:mma' )
52- :
53- distanceInWordsToNow ( file . modifiedAt , { includeSeconds : true } )
32+ < div className = { 'flex-none text-neutral-400 mr-4 text-lg pl-3' } >
33+ { file . isFile ?
34+ < FontAwesomeIcon icon = { file . isSymlink ? faFileImport : faFileAlt } />
35+ :
36+ < FontAwesomeIcon icon = { faFolder } />
37+ }
38+ </ div >
39+ < div className = { 'flex-1' } >
40+ { file . name }
41+ </ div >
42+ { file . isFile &&
43+ < div className = { 'w-1/6 text-right mr-4' } >
44+ { bytesToHuman ( file . size ) }
45+ </ div >
5446 }
55- </ div >
47+ < div
48+ className = { 'w-1/5 text-right mr-4' }
49+ title = { file . modifiedAt . toString ( ) }
50+ >
51+ { Math . abs ( differenceInHours ( file . modifiedAt , new Date ( ) ) ) > 48 ?
52+ format ( file . modifiedAt , 'MMM Do, YYYY h:mma' )
53+ :
54+ distanceInWordsToNow ( file . modifiedAt , { includeSeconds : true } )
55+ }
56+ </ div >
57+ </ a >
5658 < FileDropdownMenu uuid = { file . uuid } />
57- </ a >
59+ </ div >
5860 ) ;
5961} ;
0 commit comments