mirror of
https://github.com/navidrome/navidrome.git
synced 2026-08-31 07:30:32 +00:00
feat(ui): add Scan buttonsto the LibraryList
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
8cebf82590
commit
6ea249608c
@ -11,6 +11,7 @@ import {
|
||||
import { useMediaQuery } from '@material-ui/core'
|
||||
import { List, DateField, useResourceRefresh, SizeField } from '../common'
|
||||
import LibraryListBulkActions from './LibraryListBulkActions'
|
||||
import LibraryListActions from './LibraryListActions'
|
||||
|
||||
const LibraryFilter = (props) => (
|
||||
<Filter {...props} variant={'outlined'}>
|
||||
@ -29,6 +30,7 @@ const LibraryList = (props) => {
|
||||
exporter={false}
|
||||
bulkActionButtons={!isXsmall && <LibraryListBulkActions />}
|
||||
filters={<LibraryFilter />}
|
||||
actions={<LibraryListActions />}
|
||||
>
|
||||
{isXsmall ? (
|
||||
<SimpleList
|
||||
|
||||
30
ui/src/library/LibraryListActions.jsx
Normal file
30
ui/src/library/LibraryListActions.jsx
Normal file
@ -0,0 +1,30 @@
|
||||
import React, { cloneElement } from 'react'
|
||||
import { sanitizeListRestProps, TopToolbar } from 'react-admin'
|
||||
import LibraryScanButton from './LibraryScanButton'
|
||||
|
||||
const LibraryListActions = ({
|
||||
className,
|
||||
filters,
|
||||
resource,
|
||||
showFilter,
|
||||
displayedFilters,
|
||||
filterValues,
|
||||
...rest
|
||||
}) => {
|
||||
return (
|
||||
<TopToolbar className={className} {...sanitizeListRestProps(rest)}>
|
||||
{filters &&
|
||||
cloneElement(filters, {
|
||||
resource,
|
||||
showFilter,
|
||||
displayedFilters,
|
||||
filterValues,
|
||||
context: 'button',
|
||||
})}
|
||||
<LibraryScanButton fullScan={false} />
|
||||
<LibraryScanButton fullScan={true} />
|
||||
</TopToolbar>
|
||||
)
|
||||
}
|
||||
|
||||
export default LibraryListActions
|
||||
Loading…
x
Reference in New Issue
Block a user