mirror of
https://github.com/navidrome/navidrome.git
synced 2025-06-17 15:51:22 +03:00
Rename List view mode to Table
This commit is contained in:
parent
882519738f
commit
d9f268266c
@ -1,6 +1,6 @@
|
|||||||
export const ALBUM_MODE_GRID = 'ALBUM_GRID_MODE'
|
export const ALBUM_MODE_GRID = 'ALBUM_GRID_MODE'
|
||||||
export const ALBUM_MODE_LIST = 'ALBUM_LIST_MODE'
|
export const ALBUM_MODE_TABLE = 'ALBUM_TABLE_MODE'
|
||||||
|
|
||||||
export const albumViewGrid = () => ({ type: ALBUM_MODE_GRID })
|
export const albumViewGrid = () => ({ type: ALBUM_MODE_GRID })
|
||||||
|
|
||||||
export const albumViewList = () => ({ type: ALBUM_MODE_LIST })
|
export const albumViewTable = () => ({ type: ALBUM_MODE_TABLE })
|
||||||
|
@ -15,7 +15,7 @@ import FavoriteIcon from '@material-ui/icons/Favorite'
|
|||||||
import { withWidth } from '@material-ui/core'
|
import { withWidth } from '@material-ui/core'
|
||||||
import { List, QuickFilter, Title, useAlbumsPerPage } from '../common'
|
import { List, QuickFilter, Title, useAlbumsPerPage } from '../common'
|
||||||
import AlbumListActions from './AlbumListActions'
|
import AlbumListActions from './AlbumListActions'
|
||||||
import AlbumListView from './AlbumListView'
|
import AlbumTableView from './AlbumTableView'
|
||||||
import AlbumGridView from './AlbumGridView'
|
import AlbumGridView from './AlbumGridView'
|
||||||
import { AddToPlaylistDialog } from '../dialogs'
|
import { AddToPlaylistDialog } from '../dialogs'
|
||||||
import albumLists, { defaultAlbumList } from './albumLists'
|
import albumLists, { defaultAlbumList } from './albumLists'
|
||||||
@ -112,7 +112,7 @@ const AlbumList = (props) => {
|
|||||||
{albumView.grid ? (
|
{albumView.grid ? (
|
||||||
<AlbumGridView albumListType={albumListType} {...props} />
|
<AlbumGridView albumListType={albumListType} {...props} />
|
||||||
) : (
|
) : (
|
||||||
<AlbumListView {...props} />
|
<AlbumTableView {...props} />
|
||||||
)}
|
)}
|
||||||
</List>
|
</List>
|
||||||
<AddToPlaylistDialog />
|
<AddToPlaylistDialog />
|
||||||
|
@ -14,7 +14,7 @@ import {
|
|||||||
import ViewHeadlineIcon from '@material-ui/icons/ViewHeadline'
|
import ViewHeadlineIcon from '@material-ui/icons/ViewHeadline'
|
||||||
import ViewModuleIcon from '@material-ui/icons/ViewModule'
|
import ViewModuleIcon from '@material-ui/icons/ViewModule'
|
||||||
import { useDispatch, useSelector } from 'react-redux'
|
import { useDispatch, useSelector } from 'react-redux'
|
||||||
import { albumViewGrid, albumViewList } from '../actions'
|
import { albumViewGrid, albumViewTable } from '../actions'
|
||||||
import ToggleFieldsMenu from '../common/ToggleFieldsMenu'
|
import ToggleFieldsMenu from '../common/ToggleFieldsMenu'
|
||||||
|
|
||||||
const useStyles = makeStyles({
|
const useStyles = makeStyles({
|
||||||
@ -57,7 +57,7 @@ const AlbumViewToggler = React.forwardRef(
|
|||||||
className={classes.rightButton}
|
className={classes.rightButton}
|
||||||
label={translate('ra.toggleFieldsMenu.table')}
|
label={translate('ra.toggleFieldsMenu.table')}
|
||||||
color={albumView.grid ? 'secondary' : 'primary'}
|
color={albumView.grid ? 'secondary' : 'primary'}
|
||||||
onClick={() => dispatch(albumViewList())}
|
onClick={() => dispatch(albumViewTable())}
|
||||||
>
|
>
|
||||||
<ViewHeadlineIcon fontSize="inherit" />
|
<ViewHeadlineIcon fontSize="inherit" />
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -100,7 +100,7 @@ const AlbumDetails = (props) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const AlbumListView = ({
|
const AlbumTableView = ({
|
||||||
hasShow,
|
hasShow,
|
||||||
hasEdit,
|
hasEdit,
|
||||||
hasList,
|
hasList,
|
||||||
@ -198,4 +198,4 @@ const AlbumListView = ({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default AlbumListView
|
export default AlbumTableView
|
@ -1,4 +1,4 @@
|
|||||||
import { ALBUM_MODE_GRID, ALBUM_MODE_LIST } from '../actions'
|
import { ALBUM_MODE_GRID, ALBUM_MODE_TABLE } from '../actions'
|
||||||
|
|
||||||
export const albumViewReducer = (
|
export const albumViewReducer = (
|
||||||
previousState = {
|
previousState = {
|
||||||
@ -9,7 +9,7 @@ export const albumViewReducer = (
|
|||||||
const { type } = payload
|
const { type } = payload
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ALBUM_MODE_GRID:
|
case ALBUM_MODE_GRID:
|
||||||
case ALBUM_MODE_LIST:
|
case ALBUM_MODE_TABLE:
|
||||||
return { ...previousState, grid: type === ALBUM_MODE_GRID }
|
return { ...previousState, grid: type === ALBUM_MODE_GRID }
|
||||||
default:
|
default:
|
||||||
return previousState
|
return previousState
|
||||||
|
Loading…
x
Reference in New Issue
Block a user