From 447acbd6a00defb28fcb879dea560dd9dc96ffad Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Thu, 1 Feb 2024 14:57:40 +0530 Subject: [PATCH] chore: update cycle response (#106) --- web/components/cycles/active-cycles/header.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/web/components/cycles/active-cycles/header.tsx b/web/components/cycles/active-cycles/header.tsx index 061a5b3b2b..434055bd2a 100644 --- a/web/components/cycles/active-cycles/header.tsx +++ b/web/components/cycles/active-cycles/header.tsx @@ -9,6 +9,7 @@ import { ICycle, TCycleGroups } from "@plane/types"; // helpers import { truncateText } from "helpers/string.helper"; import { renderFormattedDate, findHowManyDaysLeft } from "helpers/date-time.helper"; +import { useMember } from "hooks/store"; export type ActiveCycleHeaderProps = { cycle: ICycle; @@ -18,10 +19,12 @@ export type ActiveCycleHeaderProps = { export const ActiveCycleHeader: FC = (props) => { const { cycle, workspaceSlug, projectId } = props; + // store + const { getUserDetails } = useMember(); + const cycleOwnerDetails = cycle ? getUserDetails(cycle.owned_by) : undefined; const daysLeft = findHowManyDaysLeft(cycle.end_date ?? new Date()); const currentCycleStatus = cycle.status.toLocaleLowerCase() as TCycleGroups; - return (
@@ -48,20 +51,20 @@ export const ActiveCycleHeader: FC = (props) => { Lead
- {cycle.owned_by.avatar && cycle.owned_by.avatar !== "" ? ( + {cycleOwnerDetails?.avatar && cycleOwnerDetails?.avatar !== "" ? ( {cycle.owned_by.display_name} ) : ( - {cycle.owned_by.display_name.charAt(0)} + {cycleOwnerDetails?.display_name.charAt(0)} )} - {cycle.owned_by.display_name} + {cycleOwnerDetails?.display_name}