Remove add/remove library button in migration mode from manga cards (#730)

This commit is contained in:
schroda
2024-04-11 02:02:31 +02:00
committed by GitHub
parent 37224122e6
commit 9d280577be
5 changed files with 10 additions and 4 deletions

View File

@@ -120,6 +120,7 @@ export const MangaCard = (props: MangaCardProps) => {
unread={unreadCount}
downloadCount={downloadCount}
updateLibraryState={updateLibraryState}
mode={mode}
/>
),
[inLibraryIndicator, isInLibrary, unreadCount, downloadCount, updateLibraryState],

View File

@@ -11,6 +11,7 @@ import { useTranslation } from 'react-i18next';
import Button from '@mui/material/Button/Button';
import Typography from '@mui/material/Typography/Typography';
import { useLibraryOptionsContext } from '@/components/context/LibraryOptionsContext.tsx';
import { MangaCardMode } from '@/components/manga/MangaCard.types.tsx';
const BadgeContainer = styled('div')({
display: 'flex',
@@ -31,12 +32,14 @@ export const MangaBadges = ({
isInLibrary,
unread,
downloadCount,
mode,
}: {
inLibraryIndicator?: boolean;
updateLibraryState: () => void;
isInLibrary: boolean;
unread?: number;
downloadCount?: number;
mode: MangaCardMode;
}) => {
const { t } = useTranslation();
@@ -46,7 +49,7 @@ export const MangaBadges = ({
return (
<BadgeContainer>
{inLibraryIndicator && (
{inLibraryIndicator && mode === 'source' && (
<Button
className="source-manga-library-state-button"
component="div"

View File

@@ -24,7 +24,7 @@ export interface MangaCardProps {
mode?: MangaCardMode;
}
export type SpecificMangaCardProps = Omit<MangaCardProps, 'mode'> &
export type SpecificMangaCardProps = MangaCardProps &
Pick<ReturnType<typeof useManageMangaLibraryState>, 'isInLibrary'> & {
longPressBind: LongPressResult<LongPressPointerHandlers>;
popupState: PopupState;

View File

@@ -56,6 +56,7 @@ export const MangaGridCard = ({
handleSelection,
continueReadingButton,
mangaBadges,
mode,
}: SpecificMangaCardProps) => {
const optionButtonRef = useRef<HTMLButtonElement>(null);
@@ -88,7 +89,7 @@ export const MangaGridCard = ({
display: isMobile ? 'none' : 'inline-flex',
},
'&:hover .source-manga-library-state-indicator': {
display: 'none',
display: mode === 'source' ? 'none' : 'flex',
},
}}
>

View File

@@ -34,6 +34,7 @@ export const MangaListCard = ({
handleSelection,
continueReadingButton,
mangaBadges,
mode,
}: SpecificMangaCardProps) => {
const optionButtonRef = useRef<HTMLButtonElement>(null);
@@ -58,7 +59,7 @@ export const MangaListCard = ({
display: isMobile ? 'none' : 'inline-flex',
},
'&:hover .source-manga-library-state-indicator': {
display: 'none',
display: mode === 'source' ? 'none' : 'inline-flex',
},
}}
>