Remove add/remove library button in migration mode from manga cards (#730)
This commit is contained in:
@@ -120,6 +120,7 @@ export const MangaCard = (props: MangaCardProps) => {
|
|||||||
unread={unreadCount}
|
unread={unreadCount}
|
||||||
downloadCount={downloadCount}
|
downloadCount={downloadCount}
|
||||||
updateLibraryState={updateLibraryState}
|
updateLibraryState={updateLibraryState}
|
||||||
|
mode={mode}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
[inLibraryIndicator, isInLibrary, unreadCount, downloadCount, updateLibraryState],
|
[inLibraryIndicator, isInLibrary, unreadCount, downloadCount, updateLibraryState],
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { useTranslation } from 'react-i18next';
|
|||||||
import Button from '@mui/material/Button/Button';
|
import Button from '@mui/material/Button/Button';
|
||||||
import Typography from '@mui/material/Typography/Typography';
|
import Typography from '@mui/material/Typography/Typography';
|
||||||
import { useLibraryOptionsContext } from '@/components/context/LibraryOptionsContext.tsx';
|
import { useLibraryOptionsContext } from '@/components/context/LibraryOptionsContext.tsx';
|
||||||
|
import { MangaCardMode } from '@/components/manga/MangaCard.types.tsx';
|
||||||
|
|
||||||
const BadgeContainer = styled('div')({
|
const BadgeContainer = styled('div')({
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
@@ -31,12 +32,14 @@ export const MangaBadges = ({
|
|||||||
isInLibrary,
|
isInLibrary,
|
||||||
unread,
|
unread,
|
||||||
downloadCount,
|
downloadCount,
|
||||||
|
mode,
|
||||||
}: {
|
}: {
|
||||||
inLibraryIndicator?: boolean;
|
inLibraryIndicator?: boolean;
|
||||||
updateLibraryState: () => void;
|
updateLibraryState: () => void;
|
||||||
isInLibrary: boolean;
|
isInLibrary: boolean;
|
||||||
unread?: number;
|
unread?: number;
|
||||||
downloadCount?: number;
|
downloadCount?: number;
|
||||||
|
mode: MangaCardMode;
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
@@ -46,7 +49,7 @@ export const MangaBadges = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<BadgeContainer>
|
<BadgeContainer>
|
||||||
{inLibraryIndicator && (
|
{inLibraryIndicator && mode === 'source' && (
|
||||||
<Button
|
<Button
|
||||||
className="source-manga-library-state-button"
|
className="source-manga-library-state-button"
|
||||||
component="div"
|
component="div"
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export interface MangaCardProps {
|
|||||||
mode?: MangaCardMode;
|
mode?: MangaCardMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SpecificMangaCardProps = Omit<MangaCardProps, 'mode'> &
|
export type SpecificMangaCardProps = MangaCardProps &
|
||||||
Pick<ReturnType<typeof useManageMangaLibraryState>, 'isInLibrary'> & {
|
Pick<ReturnType<typeof useManageMangaLibraryState>, 'isInLibrary'> & {
|
||||||
longPressBind: LongPressResult<LongPressPointerHandlers>;
|
longPressBind: LongPressResult<LongPressPointerHandlers>;
|
||||||
popupState: PopupState;
|
popupState: PopupState;
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ export const MangaGridCard = ({
|
|||||||
handleSelection,
|
handleSelection,
|
||||||
continueReadingButton,
|
continueReadingButton,
|
||||||
mangaBadges,
|
mangaBadges,
|
||||||
|
mode,
|
||||||
}: SpecificMangaCardProps) => {
|
}: SpecificMangaCardProps) => {
|
||||||
const optionButtonRef = useRef<HTMLButtonElement>(null);
|
const optionButtonRef = useRef<HTMLButtonElement>(null);
|
||||||
|
|
||||||
@@ -88,7 +89,7 @@ export const MangaGridCard = ({
|
|||||||
display: isMobile ? 'none' : 'inline-flex',
|
display: isMobile ? 'none' : 'inline-flex',
|
||||||
},
|
},
|
||||||
'&:hover .source-manga-library-state-indicator': {
|
'&:hover .source-manga-library-state-indicator': {
|
||||||
display: 'none',
|
display: mode === 'source' ? 'none' : 'flex',
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ export const MangaListCard = ({
|
|||||||
handleSelection,
|
handleSelection,
|
||||||
continueReadingButton,
|
continueReadingButton,
|
||||||
mangaBadges,
|
mangaBadges,
|
||||||
|
mode,
|
||||||
}: SpecificMangaCardProps) => {
|
}: SpecificMangaCardProps) => {
|
||||||
const optionButtonRef = useRef<HTMLButtonElement>(null);
|
const optionButtonRef = useRef<HTMLButtonElement>(null);
|
||||||
|
|
||||||
@@ -58,7 +59,7 @@ export const MangaListCard = ({
|
|||||||
display: isMobile ? 'none' : 'inline-flex',
|
display: isMobile ? 'none' : 'inline-flex',
|
||||||
},
|
},
|
||||||
'&:hover .source-manga-library-state-indicator': {
|
'&:hover .source-manga-library-state-indicator': {
|
||||||
display: 'none',
|
display: mode === 'source' ? 'none' : 'inline-flex',
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user