From 2a51299f3a94c5281e5cf43377a7e50b127dd194 Mon Sep 17 00:00:00 2001 From: Hayden Cleary <5160414+haydencleary@users.noreply.github.com> Date: Mon, 18 Nov 2024 10:48:58 +0100 Subject: [PATCH] refactor: plugged back for assigned by user card (#656) --- .../_features/user-card/user-card.tsx | 2 ++ .../_features/user-card/user-card.types.ts | 2 +- .../contributions-sidepanel.hooks.tsx | 7 ++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/shared/panels/contribution-sidepanel/_features/user-card/user-card.tsx b/shared/panels/contribution-sidepanel/_features/user-card/user-card.tsx index 1c7b35ba..d8bfb22f 100644 --- a/shared/panels/contribution-sidepanel/_features/user-card/user-card.tsx +++ b/shared/panels/contribution-sidepanel/_features/user-card/user-card.tsx @@ -8,6 +8,8 @@ import { SocialIconLink } from "@/shared/features/social-link/social-icon-link/s import { UserCardProps } from "./user-card.types"; export function UserCard({ title, user }: UserCardProps) { + if (!user) return null; + return ( ; - user: UserPublicInterface; + user?: Pick; } diff --git a/shared/panels/contribution-sidepanel/contributions-sidepanel.hooks.tsx b/shared/panels/contribution-sidepanel/contributions-sidepanel.hooks.tsx index 1e6fe14a..aa7e3a8e 100644 --- a/shared/panels/contribution-sidepanel/contributions-sidepanel.hooks.tsx +++ b/shared/panels/contribution-sidepanel/contributions-sidepanel.hooks.tsx @@ -12,6 +12,7 @@ import { GithubComment } from "@/shared/panels/contribution-sidepanel/_features/ import { IssueAppliedKpi } from "@/shared/panels/contribution-sidepanel/_features/issue-applied-kpi/issue-applied-kpi"; import { IssueOverview } from "@/shared/panels/contribution-sidepanel/_features/issue-overview/issue-overview"; import { LinkedIssues } from "@/shared/panels/contribution-sidepanel/_features/linked-issues/linked-issues"; +import { UserCard } from "@/shared/panels/contribution-sidepanel/_features/user-card/user-card"; import { ContributionsPanelData } from "@/shared/panels/contribution-sidepanel/contributions-sidepanel.types"; import { Helper } from "./_features/helper/helper"; @@ -131,11 +132,15 @@ function useContributionBlocksAsContributor({ contribution }: UseContributionBlo // Assigned issue if (contribution.isInProgress()) { + const assignedBy = contribution.contributors.find( + contributor => contributor.githubUserId === githubUserId + )?.assignedBy; + return ( <> - {/**/} + {/*// Timeline*/}