From 89763b712791a66254d203292fa86e8996029ef1 Mon Sep 17 00:00:00 2001 From: Ahmad Abdolsaheb Date: Wed, 8 May 2024 18:53:42 +0300 Subject: [PATCH] fix: show profile properly (#54704) Co-authored-by: Oliver Eyton-Williams --- .../__snapshots__/profile.test.tsx.snap | 50 ++----------------- .../src/components/profile/components/bio.tsx | 38 +++++++------- .../components/profile/components/camper.tsx | 30 ++++++++++- 3 files changed, 51 insertions(+), 67 deletions(-) diff --git a/client/src/components/profile/__snapshots__/profile.test.tsx.snap b/client/src/components/profile/__snapshots__/profile.test.tsx.snap index ba99723108a..e1a66221e60 100644 --- a/client/src/components/profile/__snapshots__/profile.test.tsx.snap +++ b/client/src/components/profile/__snapshots__/profile.test.tsx.snap @@ -179,59 +179,17 @@ exports[` renders correctly 1`] = ` @ string -

- string -

+
-

- string -

+
-
- - - profile.joined - -
-
- - - profile.from - -
+ +
{ +const Bio = ({ + joinDate, + location, + username, + name, + about, + githubProfile, + linkedin, + twitter, + website, + isDonating, + yearsTopContributor, + picture +}: CamperProps) => { const { t } = useTranslation(); - const { - joinDate, - location, - username, - name, - about, - githubProfile, - linkedin, - twitter, - website, - isDonating, - yearsTopContributor, - picture - } = useSelector(userSelector) as User; + + const isTopContributor = + yearsTopContributor && yearsTopContributor.length > 0; return (
0} + isTopContributor={isTopContributor} picture={picture} />
diff --git a/client/src/components/profile/components/camper.tsx b/client/src/components/profile/components/camper.tsx index 5890ebd6606..c1a7fadee65 100644 --- a/client/src/components/profile/components/camper.tsx +++ b/client/src/components/profile/components/camper.tsx @@ -24,12 +24,38 @@ export type CamperProps = Pick< | 'joinDate' >; -function Camper({ yearsTopContributor }: CamperProps): JSX.Element { +function Camper({ + name, + username, + location, + picture, + about, + yearsTopContributor, + githubProfile, + isDonating, + joinDate, + linkedin, + twitter, + website +}: CamperProps): JSX.Element { const { t } = useTranslation(); return (
- + {yearsTopContributor.filter(Boolean).length > 0 && (