From 446f27c7180bca08f5def27b673fc898c4c5c7d6 Mon Sep 17 00:00:00 2001 From: Nick Taylor Date: Thu, 8 Aug 2024 17:06:36 -0400 Subject: [PATCH] fix: excluded OSCR from old contributor card list component (#3901) --- .../ContributorCard/contributor-card.tsx | 25 ++++++++++++++----- .../organisms/Contributors/contributors.tsx | 1 + 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/components/organisms/ContributorCard/contributor-card.tsx b/components/organisms/ContributorCard/contributor-card.tsx index 996c52b76..60fd4b443 100644 --- a/components/organisms/ContributorCard/contributor-card.tsx +++ b/components/organisms/ContributorCard/contributor-card.tsx @@ -27,10 +27,21 @@ interface ContributorCardProps { topic: string; repositories?: number[]; range?: string; + // whether to show the OSCR rating or the login button showOscr: boolean; + // exclude OSCR rating from the card + excludeOscr?: boolean; } -const ContributorCard = ({ className, contributor, topic, repositories, range, showOscr }: ContributorCardProps) => { +const ContributorCard = ({ + className, + contributor, + topic, + repositories, + range, + showOscr, + excludeOscr = false, +}: ContributorCardProps) => { const username = "author_login" in contributor ? contributor.author_login : contributor.login; const [showPRs, setShowPRs] = useState(false); const githubAvatar = getAvatarByUsername(username); @@ -59,11 +70,13 @@ const ContributorCard = ({ className, contributor, topic, repositories, range, s {username} - + {excludeOscr ? null : ( + + )}
diff --git a/components/organisms/Contributors/contributors.tsx b/components/organisms/Contributors/contributors.tsx index 4de3f2981..b6e84c6ec 100644 --- a/components/organisms/Contributors/contributors.tsx +++ b/components/organisms/Contributors/contributors.tsx @@ -204,6 +204,7 @@ const Contributors = ({ topic={topic} repositories={repositories} showOscr={loggedIn} + excludeOscr={true} /> ))}