From 7647b62bb07f354eee5689adb0caf44aad3079a6 Mon Sep 17 00:00:00 2001 From: Kainoa Kanter <44733677+ThatOneCalculator@users.noreply.github.com> Date: Thu, 30 Nov 2023 22:43:35 -0800 Subject: [PATCH] Use Git (not Github) icon if package repository isn't on Github (#830) * Use Git (not Github) icon if package repository isn't on Github * check for github.com package could potentially be about github but not hosted on github (i.e. mygitforge.com/name/github-explorer) --- client/assets/git-logo.svg | 11 +++++++++++ .../SimilarPackageCard/SimilarPackageCard.tsx | 7 ++++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 client/assets/git-logo.svg diff --git a/client/assets/git-logo.svg b/client/assets/git-logo.svg new file mode 100644 index 00000000..cb9101fe --- /dev/null +++ b/client/assets/git-logo.svg @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/client/components/SimilarPackageCard/SimilarPackageCard.tsx b/client/components/SimilarPackageCard/SimilarPackageCard.tsx index a2000724..233d194a 100644 --- a/client/components/SimilarPackageCard/SimilarPackageCard.tsx +++ b/client/components/SimilarPackageCard/SimilarPackageCard.tsx @@ -8,6 +8,7 @@ import { sanitizeHTML } from '../../../utils/common.utils' import TreeShakeIcon from '../../assets/tree-shake.svg' import PlusIcon from '../../assets/plus.svg' import GithubIcon from '../../assets/github-logo.svg' +import GitIcon from '../../assets/git-logo.svg' type SimilarPackageCardProps = { category?: string } & ( | { pack: any; comparisonSizePercent: number } @@ -124,7 +125,11 @@ export default class SimilarPackageCard extends Component - + {pack.repository.includes('github.com') ? ( + + ) : ( + + )} )}