mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-16 12:10:36 +03:00
Change default album view mode to Grid
This commit is contained in:
parent
a8d3466b0e
commit
8880294ee7
@ -58,12 +58,6 @@ const getPerPageOptions = (width) => {
|
||||
const AlbumList = (props) => {
|
||||
const { width } = props
|
||||
const albumView = useSelector((state) => state.albumView)
|
||||
let sort
|
||||
if (albumView.mode === ALBUM_MODE_LIST) {
|
||||
sort = { field: 'name', order: 'ASC' }
|
||||
} else {
|
||||
sort = { field: 'created_at', order: 'DESC' }
|
||||
}
|
||||
return (
|
||||
<List
|
||||
{...props}
|
||||
@ -73,7 +67,7 @@ const AlbumList = (props) => {
|
||||
exporter={false}
|
||||
bulkActionButtons={false}
|
||||
actions={<AlbumListActions />}
|
||||
sort={sort}
|
||||
sort={{ field: 'created_at', order: 'DESC' }}
|
||||
filters={<AlbumFilter />}
|
||||
perPage={getPerPage(width)}
|
||||
pagination={<Pagination rowsPerPageOptions={getPerPageOptions(width)} />}
|
||||
|
@ -42,13 +42,6 @@ const AlbumListActions = ({
|
||||
color="primary"
|
||||
aria-label="text primary button group"
|
||||
>
|
||||
<Button
|
||||
size="small"
|
||||
color={albumView.mode === ALBUM_MODE_LIST ? 'primary' : 'secondary'}
|
||||
onClick={() => dispatch(selectViewMode(ALBUM_MODE_LIST))}
|
||||
>
|
||||
<ViewHeadlineIcon fontSize="inherit" />
|
||||
</Button>
|
||||
<Button
|
||||
size="small"
|
||||
color={albumView.mode === ALBUM_MODE_GRID ? 'primary' : 'secondary'}
|
||||
@ -56,6 +49,13 @@ const AlbumListActions = ({
|
||||
>
|
||||
<ViewModuleIcon fontSize="inherit" />
|
||||
</Button>
|
||||
<Button
|
||||
size="small"
|
||||
color={albumView.mode === ALBUM_MODE_LIST ? 'primary' : 'secondary'}
|
||||
onClick={() => dispatch(selectViewMode(ALBUM_MODE_LIST))}
|
||||
>
|
||||
<ViewHeadlineIcon fontSize="inherit" />
|
||||
</Button>
|
||||
</ButtonGroup>
|
||||
</TopToolbar>
|
||||
)
|
||||
|
@ -22,7 +22,7 @@ const selectAlbumList = (mode) => ({ type: mode })
|
||||
|
||||
const albumViewReducer = (
|
||||
previousState = {
|
||||
mode: ALBUM_MODE_LIST,
|
||||
mode: ALBUM_MODE_GRID,
|
||||
list: ALBUM_LIST_ALL,
|
||||
params: { sort: {}, filter: {} },
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user