mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 20:47:35 +03:00
Hide togglable columns when in Album Grid view mode. Fixes #2064
This commit is contained in:
parent
b6233e57b3
commit
4a054de3d5
2 changed files with 9 additions and 2 deletions
|
@ -86,6 +86,7 @@ const AlbumListActions = ({
|
|||
...rest
|
||||
}) => {
|
||||
const isNotSmall = useMediaQuery((theme) => theme.breakpoints.up('sm'))
|
||||
const albumView = useSelector((state) => state.albumView)
|
||||
return (
|
||||
<TopToolbar className={className} {...sanitizeListRestProps(rest)}>
|
||||
{filters &&
|
||||
|
@ -97,7 +98,11 @@ const AlbumListActions = ({
|
|||
context: 'button',
|
||||
})}
|
||||
{isNotSmall ? (
|
||||
<ToggleFieldsMenu resource="album" topbarComponent={AlbumViewToggler} />
|
||||
<ToggleFieldsMenu
|
||||
resource="album"
|
||||
topbarComponent={AlbumViewToggler}
|
||||
hideColumns={albumView.grid}
|
||||
/>
|
||||
) : (
|
||||
<AlbumViewToggler showTitle={false} />
|
||||
)}
|
||||
|
|
|
@ -30,6 +30,7 @@ const useStyles = makeStyles({
|
|||
export const ToggleFieldsMenu = ({
|
||||
resource,
|
||||
topbarComponent: TopBarComponent,
|
||||
hideColumns,
|
||||
}) => {
|
||||
const [anchorEl, setAnchorEl] = useState(null)
|
||||
const dispatch = useDispatch()
|
||||
|
@ -82,7 +83,7 @@ export const ToggleFieldsMenu = ({
|
|||
}}
|
||||
>
|
||||
{TopBarComponent && <TopBarComponent />}
|
||||
{toggleableColumns ? (
|
||||
{!hideColumns && toggleableColumns ? (
|
||||
<div>
|
||||
<Typography className={classes.title}>
|
||||
{translate('ra.toggleFieldsMenu.columnsToDisplay')}
|
||||
|
@ -107,4 +108,5 @@ export const ToggleFieldsMenu = ({
|
|||
ToggleFieldsMenu.propTypes = {
|
||||
resource: PropTypes.string.isRequired,
|
||||
topbarComponent: PropTypes.elementType,
|
||||
hideColumns: PropTypes.bool,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue