From 076b866430828d1b983be8f04d564f6904562e07 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Wed, 26 Jul 2023 15:24:29 +0100 Subject: [PATCH] Personal progress indicator in teams --- .../TeamProgress/GroupRoadmapItem.tsx | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/components/TeamProgress/GroupRoadmapItem.tsx b/src/components/TeamProgress/GroupRoadmapItem.tsx index 17975ffc8..f81c9815b 100644 --- a/src/components/TeamProgress/GroupRoadmapItem.tsx +++ b/src/components/TeamProgress/GroupRoadmapItem.tsx @@ -3,6 +3,7 @@ import type { GroupByRoadmap, TeamMember } from './TeamProgressPage'; import { MemberProgressModal } from './MemberProgressModal'; import { getUrlParams } from '../../lib/browser'; import ExternalLinkIcon from '../../icons/external-link.svg'; +import { useAuth } from '../../hooks/use-auth'; type GroupRoadmapItemProps = { roadmap: GroupByRoadmap; @@ -11,6 +12,7 @@ type GroupRoadmapItemProps = { export function GroupRoadmapItem(props: GroupRoadmapItemProps) { const { members, resourceTitle, resourceId } = props.roadmap; const { t: teamId } = getUrlParams(); + const user = useAuth(); const [showAll, setShowAll] = useState(false); const [detailResourceId, setDetailResourceId] = useState(null); @@ -49,10 +51,15 @@ export function GroupRoadmapItem(props: GroupRoadmapItemProps) {
{(showAll ? members : members.slice(0, 4)).map((member) => { - if (!member.progress) return null; + const isMyProgress = user?.email === member?.member?.email; + + if (!member.progress) { + return null; + } + return (