Skip to content

Commit 04f7831

Browse files
authored
Use proper button radius (#393)
1 parent 83c6851 commit 04f7831

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

src/components/manga/MangaDetails.tsx

+20-13
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import React, { useEffect } from 'react';
1616
import { useTranslation } from 'react-i18next';
1717
import { mutate } from 'swr';
1818
import { t as translate } from 'i18next';
19+
import Button from '@mui/material/Button';
1920
import { IManga, ISource } from '@/typings';
2021
import requestManager from '@/lib/RequestManager';
2122
import makeToast from '@/components/util/Toast';
@@ -69,11 +70,19 @@ const Metadata = styled('div')(({ theme }) => ({
6970
}));
7071
const MangaButtonsContainer = styled('div', { shouldForwardProp: (prop) => prop !== 'inLibrary' })<{
7172
inLibrary: boolean;
72-
}>(({ inLibrary }) => ({
73+
}>(({ theme, inLibrary }) => ({
7374
display: 'flex',
7475
justifyContent: 'space-around',
7576
'& button': {
7677
color: inLibrary ? '#2196f3' : 'inherit',
78+
borderRadius: '25px',
79+
textTransform: 'none',
80+
paddingLeft: '20px',
81+
paddingRight: '20px',
82+
fontSize: 'x-large',
83+
[theme.breakpoints.down('sm')]: {
84+
fontSize: 'larger',
85+
},
7786
},
7887
'& a': {
7988
textDecoration: 'none',
@@ -176,20 +185,18 @@ const MangaDetails: React.FC<IProps> = ({ manga }) => {
176185
</ThumbnailMetadataWrapper>
177186
<MangaButtonsContainer inLibrary={manga.inLibrary}>
178187
<div>
179-
<IconButton onClick={manga.inLibrary ? removeFromLibrary : addToLibrary} size="large">
180-
{manga.inLibrary ? <FavoriteIcon sx={{ mr: 1 }} /> : <FavoriteBorderIcon sx={{ mr: 1 }} />}
181-
<Typography sx={{ fontSize: { xs: '0.75em', sm: '0.85em' } }}>
182-
{manga.inLibrary ? t('manga.button.in_library') : t('manga.button.add_to_library')}
183-
</Typography>
184-
</IconButton>
188+
<Button
189+
startIcon={manga.inLibrary ? <FavoriteIcon /> : <FavoriteBorderIcon />}
190+
onClick={manga.inLibrary ? removeFromLibrary : addToLibrary}
191+
size="large"
192+
>
193+
{manga.inLibrary ? t('manga.button.in_library') : t('manga.button.add_to_library')}
194+
</Button>
185195
</div>
186196
<a href={manga.realUrl} target="_blank" rel="noreferrer">
187-
<IconButton size="large">
188-
<PublicIcon sx={{ mr: 1 }} />
189-
<Typography sx={{ fontSize: { xs: '0.75em', sm: '0.85em' } }}>
190-
{t('global.button.open_site')}
191-
</Typography>
192-
</IconButton>
197+
<Button startIcon={<PublicIcon />} size="large">
198+
{t('global.button.open_site')}
199+
</Button>
193200
</a>
194201
</MangaButtonsContainer>
195202
</TopContentWrapper>

0 commit comments

Comments
 (0)