diff --git a/src/components/TeamProgress/MemberCustomProgressModal.tsx b/src/components/TeamProgress/MemberCustomProgressModal.tsx index 56bf7babd..4876e57b4 100644 --- a/src/components/TeamProgress/MemberCustomProgressModal.tsx +++ b/src/components/TeamProgress/MemberCustomProgressModal.tsx @@ -28,6 +28,7 @@ import { calculateDimensions } from '../../../editor/utils/roadmap'; import { isMobile } from '../../../editor/utils/is-mobile'; import { useKeydown } from '../../hooks/use-keydown'; import { useOutsideClick } from '../../hooks/use-outside-click'; +import { MemberProgressModalHeader } from './MemberProgressModalHeader'; export type ProgressMapProps = { member: TeamMember; @@ -39,7 +40,7 @@ export type ProgressMapProps = { isCustomResource?: boolean; }; -type MemberProgressResponse = { +export type MemberProgressResponse = { removed: string[]; done: string[]; learning: string[]; @@ -227,22 +228,6 @@ export function MemberCustomProgressModal(props: ProgressMapProps) { } }, []); - const removedTopics = memberProgress?.removed || []; - const memberDone = - memberProgress?.done.filter((id) => !removedTopics.includes(id)).length || - 0; - const memberLearning = - memberProgress?.learning.filter((id) => !removedTopics.includes(id)) - .length || 0; - const memberSkipped = - memberProgress?.skipped.filter((id) => !removedTopics.includes(id)) - .length || 0; - - const currProgress = member.progress.find((p) => p.resourceId === resourceId); - const memberTotal = currProgress?.total || 0; - - const progressPercentage = Math.round((memberDone / memberTotal) * 100); - return (
- You are looking at {member.name}'s progress.{' '} - - . -
-- -
-- - {progressPercentage}% Done - - - - {memberDone} of {memberTotal} done - -
-- - {progressPercentage}% Done - - - - {memberDone} completed - - · - - {memberLearning} in - progress - - - {memberSkipped > 0 && ( - <> - · - - {memberSkipped}{' '} - skipped - - > - )} - - · - - {memberTotal} Total - -
-- You are looking at {member.name}'s progress.{' '} - - . -
-- -
-- - {progressPercentage}% Done - - - - {memberDone} of {memberTotal} done - -
-- - {progressPercentage}% Done - - - - {memberDone} completed - - · - - {memberLearning} in - progress - - - {memberSkipped > 0 && ( - <> - · - - {memberSkipped}{' '} - skipped - - > - )} - - · - - {memberTotal} Total - -
-+ You are looking at {member.name}'s progress.{' '} + + . +
++ +
++ + {progressPercentage}% Done + + + + {memberDone} of {memberTotal} done + +
++ + {progressPercentage}% Done + + + + {memberDone} completed + + · + + {memberLearning} in progress + + + {memberSkipped > 0 && ( + <> + · + + {memberSkipped} skipped + + > + )} + + · + + {memberTotal} Total + +
+- You can close this popup and start tracking your progress. -
-- - {progressPercentage}% Done - - - - {userDone} of {userProgressTotal} done - -
-- - {progressPercentage}% Done - - - - {userDone} completed - - · - - {userLearning} in progress - - - {userSkipped > 0 && ( - <> - · - - {userSkipped} skipped - - > - )} - - · - - {userProgressTotal} Total - -
-- You can close this popup and start tracking your progress. -
-- - {progressPercentage}% Done - - - - {userDone} of {userProgressTotal} done - -
-- - {progressPercentage}% Done - - - - {userDone} completed - - · - - {userLearning} in progress - - - {userSkipped > 0 && ( - <> - · - - {userSkipped} skipped - - > - )} - - · - - {userProgressTotal} Total - -
-+ You can close this popup and start tracking your progress. +
++ + {progressPercentage}% Done + + + + {userDone} of {userProgressTotal} done + +
++ + {progressPercentage}% Done + + + + {userDone} completed + + · + + {userLearning} in progress + + + {userSkipped > 0 && ( + <> + · + + {userSkipped} skipped + + > + )} + + · + + {userProgressTotal} Total + +
+