Refactor and fix sorting in library (#197)

This commit is contained in:
Valter Martinek
2022-11-24 21:04:30 +01:00
committed by GitHub
parent 154b357c40
commit 62816338f3
5 changed files with 75 additions and 76 deletions

View File

@@ -73,6 +73,7 @@ interface IProps {
manga: IMangaCard
gridLayout: number | undefined
dimensions: number
inLibraryIndicator?: boolean
}
const MangaCard = React.forwardRef<HTMLDivElement, IProps>((props: IProps, ref) => {
const {
@@ -82,6 +83,7 @@ const MangaCard = React.forwardRef<HTMLDivElement, IProps>((props: IProps, ref)
},
gridLayout,
dimensions,
inLibraryIndicator,
} = props;
const { options: { showUnreadBadge, showDownloadBadge } } = useLibraryOptionsContext();
@@ -119,7 +121,7 @@ const MangaCard = React.forwardRef<HTMLDivElement, IProps>((props: IProps, ref)
>
<BadgeContainer>
{inLibrary && (
{inLibraryIndicator && inLibrary && (
<Typography
sx={{ backgroundColor: 'primary.dark', zIndex: '1' }}
>
@@ -145,7 +147,7 @@ const MangaCard = React.forwardRef<HTMLDivElement, IProps>((props: IProps, ref)
<SpinnerImage
alt={title}
src={`${serverAddress}${thumbnailUrl}?useCache=${useCache}`}
imgStyle={inLibrary
imgStyle={inLibraryIndicator && inLibrary
? {
height: '100%',
width: '100%',