mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add filters status indicator
This commit is contained in:
parent
72989172ae
commit
d714c3ceb6
1 changed files with 10 additions and 2 deletions
|
@ -10,6 +10,7 @@ import MuiAccordionSummary, {
|
||||||
AccordionSummaryProps
|
AccordionSummaryProps
|
||||||
} from '@mui/material/AccordionSummary';
|
} from '@mui/material/AccordionSummary';
|
||||||
import IconButton from '@mui/material/IconButton';
|
import IconButton from '@mui/material/IconButton';
|
||||||
|
import { Badge } from '@mui/material';
|
||||||
import { styled } from '@mui/material/styles';
|
import { styled } from '@mui/material/styles';
|
||||||
import Typography from '@mui/material/Typography';
|
import Typography from '@mui/material/Typography';
|
||||||
|
|
||||||
|
@ -152,6 +153,9 @@ const FilterButton: FC<FilterButtonProps> = ({
|
||||||
return viewType === LibraryTab.Episodes;
|
return viewType === LibraryTab.Episodes;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const hasFilters =
|
||||||
|
Object.values(libraryViewSettings.Filters || {}).some((filter) => !!filter);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<IconButton
|
<IconButton
|
||||||
|
@ -161,7 +165,9 @@ const FilterButton: FC<FilterButtonProps> = ({
|
||||||
className='paper-icon-button-light btnShuffle autoSize'
|
className='paper-icon-button-light btnShuffle autoSize'
|
||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
>
|
>
|
||||||
|
<Badge color='info' variant='dot' invisible={!hasFilters}>
|
||||||
<FilterListIcon />
|
<FilterListIcon />
|
||||||
|
</Badge>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<Popover
|
<Popover
|
||||||
id={id}
|
id={id}
|
||||||
|
@ -239,7 +245,9 @@ const FilterButton: FC<FilterButtonProps> = ({
|
||||||
id='filtersEpisodesStatus-header'
|
id='filtersEpisodesStatus-header'
|
||||||
>
|
>
|
||||||
<Typography>
|
<Typography>
|
||||||
{globalize.translate('HeaderEpisodesStatus')}
|
{globalize.translate(
|
||||||
|
'HeaderEpisodesStatus'
|
||||||
|
)}
|
||||||
</Typography>
|
</Typography>
|
||||||
</AccordionSummary>
|
</AccordionSummary>
|
||||||
<AccordionDetails>
|
<AccordionDetails>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue