diff --git a/src/modules/core/components/cards/list/ListCardContent.tsx b/src/modules/core/components/cards/list/ListCardContent.tsx new file mode 100644 index 00000000..cdcf6bac --- /dev/null +++ b/src/modules/core/components/cards/list/ListCardContent.tsx @@ -0,0 +1,24 @@ +/* + * Copyright (C) Contributors to the Suwayomi project + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +import CardContent, { CardContentProps } from '@mui/material/CardContent'; + +export const ListCardContent = ({ children, ...props }: CardContentProps) => ( + + {children} + +); diff --git a/src/modules/extension/components/ExtensionCard.tsx b/src/modules/extension/components/ExtensionCard.tsx index 1cc85b59..d05442b4 100644 --- a/src/modules/extension/components/ExtensionCard.tsx +++ b/src/modules/extension/components/ExtensionCard.tsx @@ -8,7 +8,6 @@ import { useEffect, useState } from 'react'; import Card from '@mui/material/Card'; -import CardContent from '@mui/material/CardContent'; import Button from '@mui/material/Button'; import Typography from '@mui/material/Typography'; import { useTranslation } from 'react-i18next'; @@ -35,6 +34,7 @@ import { getInstalledState } from '@/modules/extension/Extensions.utils.ts'; import { getErrorMessage } from '@/lib/HelperFunctions.ts'; import { CustomTooltip } from '@/modules/core/components/CustomTooltip'; import { ListCardAvatar } from '@/modules/core/components/cards/list/ListCardAvatar.tsx'; +import { ListCardContent } from '@/modules/core/components/cards/list/ListCardContent.tsx'; interface IProps { extension: TExtension; @@ -118,17 +118,7 @@ export function ExtensionCard(props: IProps) { return ( - + {t(INSTALLED_STATE_TO_TRANSLATION_KEY_MAP[installedState])} - + ); } diff --git a/src/modules/history/components/ChapterHistoryCard.tsx b/src/modules/history/components/ChapterHistoryCard.tsx index 8c0ff853..fcb750fa 100644 --- a/src/modules/history/components/ChapterHistoryCard.tsx +++ b/src/modules/history/components/ChapterHistoryCard.tsx @@ -9,7 +9,6 @@ import Box from '@mui/material/Box'; import CardActionArea from '@mui/material/CardActionArea'; import Card from '@mui/material/Card'; -import CardContent from '@mui/material/CardContent'; import { Link } from 'react-router-dom'; import { memo } from 'react'; import { DownloadStateIndicator } from '@/modules/core/components/DownloadStateIndicator.tsx'; @@ -21,6 +20,7 @@ import { ChapterCardThumbnail } from '@/modules/chapter/components/cards/Chapter import { ChapterCardMetadata } from '@/modules/chapter/components/cards/ChapterCardMetadata.tsx'; import { ChapterDownloadButton } from '@/modules/chapter/components/buttons/ChapterDownloadButton.tsx'; import { ChapterDownloadRetryButton } from '@/modules/chapter/components/buttons/ChapterDownloadRetryButton.tsx'; +import { ListCardContent } from '@/modules/core/components/cards/list/ListCardContent'; export const ChapterHistoryCard = memo(({ chapter }: { chapter: ChapterHistoryListFieldsFragment }) => { const { manga } = chapter; @@ -35,14 +35,7 @@ export const ChapterHistoryCard = memo(({ chapter }: { chapter: ChapterHistoryLi color: (theme) => theme.palette.text[chapter.isRead ? 'disabled' : 'primary'], }} > - + - + ); diff --git a/src/modules/manga/components/cards/MangaListCard.tsx b/src/modules/manga/components/cards/MangaListCard.tsx index ab13292f..19c5d533 100644 --- a/src/modules/manga/components/cards/MangaListCard.tsx +++ b/src/modules/manga/components/cards/MangaListCard.tsx @@ -7,7 +7,6 @@ */ import Card from '@mui/material/Card'; -import CardContent from '@mui/material/CardContent'; import CardActionArea from '@mui/material/CardActionArea'; import Box from '@mui/material/Box'; import Stack from '@mui/material/Stack'; @@ -19,6 +18,7 @@ import { SpecificMangaCardProps } from '@/modules/manga/Manga.types.ts'; import { Mangas } from '@/modules/manga/services/Mangas.ts'; import { MangaOptionButton } from '@/modules/manga/components/MangaOptionButton.tsx'; import { ListCardAvatar } from '@/modules/core/components/cards/list/ListCardAvatar.tsx'; +import { ListCardContent } from '@/modules/core/components/cards/list/ListCardContent'; export const MangaListCard = memo( ({ @@ -63,14 +63,10 @@ export const MangaListCard = memo( }, }} > - - + ); diff --git a/src/modules/migration/components/MigrationCard.tsx b/src/modules/migration/components/MigrationCard.tsx index 7ff8e60e..64035f05 100644 --- a/src/modules/migration/components/MigrationCard.tsx +++ b/src/modules/migration/components/MigrationCard.tsx @@ -7,7 +7,6 @@ */ import Card from '@mui/material/Card'; -import CardContent from '@mui/material/CardContent'; import Box from '@mui/material/Box'; import CardActionArea from '@mui/material/CardActionArea'; import Chip from '@mui/material/Chip'; @@ -19,6 +18,7 @@ import { GetMigratableSourcesQuery } from '@/lib/graphql/generated/graphql.ts'; import { translateExtensionLanguage } from '@/modules/extension/Extensions.utils.ts'; import { AppRoutes } from '@/modules/core/AppRoute.constants.ts'; import { ListCardAvatar } from '@/modules/core/components/cards/list/ListCardAvatar.tsx'; +import { ListCardContent } from '@/modules/core/components/cards/list/ListCardContent.tsx'; export type TMigratableSource = NonNullable & { mangaCount: number; @@ -34,14 +34,7 @@ export const MigrationCard = ({ id, name, lang, iconUrl, mangaCount }: TMigratab return ( - + @@ -59,7 +52,7 @@ export const MigrationCard = ({ id, name, lang, iconUrl, mangaCount }: TMigratab - + ); diff --git a/src/modules/source/components/SourceCard.tsx b/src/modules/source/components/SourceCard.tsx index fc151ae7..0e3097ab 100644 --- a/src/modules/source/components/SourceCard.tsx +++ b/src/modules/source/components/SourceCard.tsx @@ -9,7 +9,6 @@ import CardActionArea from '@mui/material/CardActionArea'; import Button from '@mui/material/Button'; import Card from '@mui/material/Card'; -import CardContent from '@mui/material/CardContent'; import Typography from '@mui/material/Typography'; import React from 'react'; import { useTranslation } from 'react-i18next'; @@ -24,6 +23,7 @@ import { AppRoutes } from '@/modules/core/AppRoute.constants.ts'; import { MUIUtil } from '@/lib/mui/MUI.util.ts'; import { Sources } from '@/modules/source/services/Sources.ts'; import { ListCardAvatar } from '@/modules/core/components/cards/list/ListCardAvatar.tsx'; +import { ListCardContent } from '@/modules/core/components/cards/list/ListCardContent.tsx'; interface IProps { source: GetSourcesListQuery['sources']['nodes'][number]; @@ -60,14 +60,7 @@ export const SourceCard: React.FC = (props: IProps) => { to={AppRoutes.sources.childRoutes.browse.path(id)} state={{ contentType: SourceContentType.POPULAR, clearCache: true }} > - + = (props: IProps) => { {t('global.button.popular')} )} - + ); diff --git a/src/modules/updates/components/ChapterUpdateCard.tsx b/src/modules/updates/components/ChapterUpdateCard.tsx index 68e2f0db..f200f45a 100644 --- a/src/modules/updates/components/ChapterUpdateCard.tsx +++ b/src/modules/updates/components/ChapterUpdateCard.tsx @@ -9,7 +9,6 @@ import Box from '@mui/material/Box'; import CardActionArea from '@mui/material/CardActionArea'; import Card from '@mui/material/Card'; -import CardContent from '@mui/material/CardContent'; import { Link } from 'react-router-dom'; import { memo } from 'react'; import { DownloadStateIndicator } from '@/modules/core/components/DownloadStateIndicator.tsx'; @@ -20,6 +19,7 @@ import { ChapterCardMetadata } from '@/modules/chapter/components/cards/ChapterC import { ChapterDownloadButton } from '@/modules/chapter/components/buttons/ChapterDownloadButton.tsx'; import { ChapterDownloadRetryButton } from '@/modules/chapter/components/buttons/ChapterDownloadRetryButton.tsx'; import { Chapters } from '@/modules/chapter/services/Chapters.ts'; +import { ListCardContent } from '@/modules/core/components/cards/list/ListCardContent.tsx'; export const ChapterUpdateCard = memo(({ chapter }: { chapter: ChapterUpdateListFieldsFragment }) => { const { manga } = chapter; @@ -34,14 +34,7 @@ export const ChapterUpdateCard = memo(({ chapter }: { chapter: ChapterUpdateList color: (theme) => theme.palette.text[chapter.isRead ? 'disabled' : 'primary'], }} > - + - + );