Feature/show extension repo only in case more than one repo is set (#543)
* Rename "isSingleRepoSet" prop to "showSourceRepo" * Show repo of source in case sources of different repos are installed * Center the source icon
This commit is contained in:
@@ -15,7 +15,7 @@ import Typography from '@mui/material/Typography';
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { ISource } from '@/typings';
|
||||
import { TPartialSource } from '@/typings';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { translateExtensionLanguage } from '@/screens/util/Extensions';
|
||||
import { SourceContentType } from '@/screens/SourceMangas';
|
||||
@@ -39,14 +39,24 @@ const WiderWidthButtons = styled('div')(({ theme }) => ({
|
||||
}));
|
||||
|
||||
interface IProps {
|
||||
source: ISource;
|
||||
source: TPartialSource;
|
||||
showSourceRepo: boolean;
|
||||
}
|
||||
|
||||
export const SourceCard: React.FC<IProps> = (props: IProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const {
|
||||
source: { id, name, lang, iconUrl, supportsLatest, isNsfw },
|
||||
source: {
|
||||
id,
|
||||
name,
|
||||
lang,
|
||||
iconUrl,
|
||||
supportsLatest,
|
||||
isNsfw,
|
||||
extension: { repo },
|
||||
},
|
||||
showSourceRepo,
|
||||
} = props;
|
||||
|
||||
return (
|
||||
@@ -69,7 +79,7 @@ export const SourceCard: React.FC<IProps> = (props: IProps) => {
|
||||
padding: 2,
|
||||
}}
|
||||
>
|
||||
<Box sx={{ display: 'flex' }}>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center' }}>
|
||||
<Avatar
|
||||
variant="rounded"
|
||||
alt={name}
|
||||
@@ -99,6 +109,11 @@ export const SourceCard: React.FC<IProps> = (props: IProps) => {
|
||||
{' 18+'}
|
||||
</Typography>
|
||||
)}
|
||||
{showSourceRepo && (
|
||||
<Typography variant="caption" display="block">
|
||||
{repo}
|
||||
</Typography>
|
||||
)}
|
||||
</Typography>
|
||||
)}
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user