mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-29 03:16:22 -05:00
Shortening refresh button for mobile.
This commit is contained in:
parent
1c5b277f24
commit
ae5d47fc21
3 changed files with 9 additions and 25 deletions
|
|
@ -17,7 +17,7 @@ import {deleteFile, ignoreDirectory, makeDirectory, movePaths, renamePath, unign
|
|||
import _ from 'lodash';
|
||||
import {SortableTable} from "./SortableTable";
|
||||
import {useBrowseFiles, useMediaDirectory, useWROLMode} from "../hooks/customHooks";
|
||||
import {DirectoryRefreshButton, FileRowTagIcon, FilesRefreshButton} from "./Files";
|
||||
import {FileRowTagIcon, FilesRefreshButton} from "./Files";
|
||||
import {FilePreviewContext} from "./FilePreview";
|
||||
import {SettingsContext} from "../contexts/contexts";
|
||||
|
||||
|
|
@ -217,10 +217,7 @@ export function FileBrowser() {
|
|||
const footer = <TableFooter fullWidth>
|
||||
<TableRow>
|
||||
<TableHeaderCell colSpan={3}>
|
||||
{selectedPathsCount ?
|
||||
<DirectoryRefreshButton paths={selectedPaths}/>
|
||||
: <FilesRefreshButton/>
|
||||
}
|
||||
<FilesRefreshButton paths={selectedPaths}/>
|
||||
<APIButton
|
||||
icon='trash'
|
||||
color='red'
|
||||
|
|
|
|||
|
|
@ -606,29 +606,15 @@ const useRefresh = () => {
|
|||
}
|
||||
}
|
||||
|
||||
export function FilesRefreshButton() {
|
||||
const {refreshing, refreshingDirectory, wrolModeEnabled, loading, refreshFiles} = useRefresh();
|
||||
|
||||
return <Button icon
|
||||
labelPosition='left'
|
||||
loading={loading || refreshing || refreshingDirectory}
|
||||
onClick={() => refreshFiles()}
|
||||
disabled={wrolModeEnabled || loading || refreshing}>
|
||||
<Icon name='refresh'/>
|
||||
Refresh All
|
||||
</Button>;
|
||||
}
|
||||
|
||||
export function DirectoryRefreshButton({paths}) {
|
||||
export function FilesRefreshButton({paths}) {
|
||||
const {refreshing, refreshingDirectory, wrolModeEnabled, loading, refreshFiles} = useRefresh();
|
||||
|
||||
return <Button icon
|
||||
labelPosition='left'
|
||||
loading={loading || refreshing || refreshingDirectory}
|
||||
onClick={() => refreshFiles(paths)}
|
||||
disabled={wrolModeEnabled || loading || refreshing || refreshingDirectory}
|
||||
>
|
||||
disabled={wrolModeEnabled || loading || refreshing}>
|
||||
<Icon name='refresh'/>
|
||||
Refresh
|
||||
</Button>
|
||||
</Button>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue