Skip to content

Commit 6ac1343

Browse files
committed
check if workplan has phase
1 parent 01ec0e6 commit 6ac1343

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

epictrack-web/src/components/myWorkplans/Card/CardBody.tsx

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -75,25 +75,24 @@ const CardBody = ({ workplan }: CardProps) => {
7575
{workplan?.phase_info?.work_phase.name}
7676
</ETCaption2>
7777
</Grid>
78+
<Grid item container sx={{ marginTop: "4px" }} xs={1}>
79+
<ClockIcon />
80+
</Grid>
81+
<Grid item container xs={4}>
82+
<ETCaption2
83+
bold
84+
color={Palette.neutral.main}
85+
sx={{
86+
overflow: "hidden",
87+
textOverflow: "ellipsis",
88+
whiteSpace: "nowrap",
89+
}}
90+
>
91+
{workplan?.phase_info?.days_left}/
92+
{workplan?.phase_info?.total_number_of_days} days left
93+
</ETCaption2>
94+
</Grid>
7895
</When>
79-
80-
<Grid item container sx={{ marginTop: "4px" }} xs={1}>
81-
<ClockIcon />
82-
</Grid>
83-
<Grid item container xs={4}>
84-
<ETCaption2
85-
bold
86-
color={Palette.neutral.main}
87-
sx={{
88-
overflow: "hidden",
89-
textOverflow: "ellipsis",
90-
whiteSpace: "nowrap",
91-
}}
92-
>
93-
{workplan.phase_info.days_left}/
94-
{workplan.phase_info.total_number_of_days} days left
95-
</ETCaption2>
96-
</Grid>
9796
</Grid>
9897
<Grid item container direction="row" spacing={1}>
9998
<Grid
@@ -106,7 +105,7 @@ const CardBody = ({ workplan }: CardProps) => {
106105
>
107106
<ETCaption1 color={Palette.neutral.main}>
108107
{`UPCOMING MILESTONE ${dayjs(new Date())
109-
.add(workplan.phase_info.days_left, "days")
108+
.add(workplan?.phase_info?.days_left, "days")
110109
.format(MONTH_DAY_YEAR)
111110
.toUpperCase()}`}
112111
</ETCaption1>

0 commit comments

Comments
 (0)