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:
schroda
2024-01-09 22:09:31 +01:00
committed by GitHub
parent 684ae69470
commit fd1fa63064
8 changed files with 203 additions and 34 deletions

View File

@@ -22,7 +22,7 @@ import { makeToast } from '@/components/util/Toast.tsx';
interface IProps {
extension: PartialExtension;
handleUpdate: () => void;
usesCustomRepos: boolean;
showSourceRepo: boolean;
}
enum ExtensionAction {
@@ -94,7 +94,7 @@ export function ExtensionCard(props: IProps) {
const {
extension: { name, lang, versionName, isInstalled, hasUpdate, isObsolete, pkgName, iconUrl, isNsfw, repo },
handleUpdate,
usesCustomRepos,
showSourceRepo,
} = props;
const [installedState, setInstalledState] = useState<InstalledStates>(
getInstalledState(isInstalled, isObsolete, hasUpdate),
@@ -162,7 +162,7 @@ export function ExtensionCard(props: IProps) {
},
}}
>
<Box sx={{ display: 'flex' }}>
<Box sx={{ display: 'flex', alignItems: 'center' }}>
<Avatar
variant="rounded"
sx={{
@@ -186,7 +186,7 @@ export function ExtensionCard(props: IProps) {
</Typography>
)}
</Typography>
{usesCustomRepos && (
{showSourceRepo && (
<Typography variant="caption" display="block">
{repo}
</Typography>