diff --git a/src/components/atoms/CustomIconButton.tsx b/src/components/atoms/CustomIconButton.tsx new file mode 100644 index 00000000..73e0b469 --- /dev/null +++ b/src/components/atoms/CustomIconButton.tsx @@ -0,0 +1,20 @@ +/* + * 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 { Button, ButtonProps, Stack, TypographyProps } from '@mui/material'; + +export const CustomIconButton = ({ + children, + ...props +}: ButtonProps & TypographyProps) => ( + +); diff --git a/src/components/manga/MangaDetails.tsx b/src/components/manga/MangaDetails.tsx index e1967855..82241d36 100644 --- a/src/components/manga/MangaDetails.tsx +++ b/src/components/manga/MangaDetails.tsx @@ -13,7 +13,7 @@ import { styled } from '@mui/material/styles'; import React, { useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { t as translate } from 'i18next'; -import Button from '@mui/material/Button'; +import { Link } from '@mui/material'; import { ISource, TManga } from '@/typings'; import { requestManager } from '@/lib/requests/RequestManager.ts'; import { makeToast } from '@/components/util/Toast'; @@ -23,6 +23,7 @@ import { Mangas } from '@/lib/data/Mangas.ts'; import { SpinnerImage } from '@/components/util/SpinnerImage.tsx'; import { defaultPromiseErrorHandler } from '@/util/defaultPromiseErrorHandler.ts'; import { Categories } from '@/lib/data/Categories.ts'; +import { CustomIconButton } from '@/components/atoms/CustomIconButton'; const DetailsWrapper = styled('div')(({ theme }) => ({ width: '100%', @@ -71,13 +72,10 @@ const Metadata = styled('div')(({ theme }) => ({ fontSize: '1.3em', }, })); -const MangaButtonsContainer = styled('div', { shouldForwardProp: (prop) => prop !== 'inLibrary' })<{ - inLibrary: boolean; -}>(({ theme, inLibrary }) => ({ +const MangaButtonsContainer = styled('div')(({ theme }) => ({ display: 'flex', justifyContent: 'space-around', - '& button': { - color: inLibrary ? '#2196f3' : 'inherit', + '& button, a': { borderRadius: '25px', textTransform: 'none', paddingLeft: '20px', @@ -87,13 +85,6 @@ const MangaButtonsContainer = styled('div', { shouldForwardProp: (prop) => prop fontSize: 'larger', }, }, - '& a': { - textDecoration: 'none', - color: '#858585', - '& button': { - color: 'inherit', - }, - }, })); const BottomContentWrapper = styled('div')(({ theme }) => ({ paddingLeft: '10px', @@ -133,21 +124,29 @@ const Genres = styled('div')(() => ({ const OpenSourceButton = ({ url }: { url?: string | null }) => { const { t } = useTranslation(); - if (!url) { - return ( - - ); + + ), + [url], + ); + + if (!url) { + return button; } - return ( - - - - ); + return button; }; interface IProps { @@ -249,17 +248,16 @@ export const MangaDetails: React.FC = ({ manga }) => {

{`${t('source.title')}: ${getSourceName(manga.source)}`}

- -
- -
+ + + {manga.inLibrary ? : } + {manga.inLibrary ? t('manga.button.in_library') : t('manga.button.add_to_library')} +