Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

card #1445

Merged
merged 1 commit into from
Dec 12, 2023
Merged

card #1445

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 50 additions & 40 deletions epictrack-web/src/components/myWorkplans/Card/CardBody.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Grid } from "@mui/material";
import { Grid, Stack } from "@mui/material";
import { Palette } from "../../../styles/theme";
import { ETCaption1, ETCaption2, ETHeading4, ETParagraph } from "../../shared";
import Icons from "../../icons";
Expand Down Expand Up @@ -60,55 +60,65 @@ const CardBody = ({ workplan }: CardProps) => {
{workplan.work_type.name}
</ETHeading4>
</Grid>
<Grid item container xs={6}>
<Grid item container xs={6} justifyContent={"flex-end"}>
<ETCaption1 bold>
<WorkState work_state={workplan.work_state} />
</ETCaption1>
</Grid>
</Grid>
<Grid item container direction="row" spacing={1}>
<When condition={"phase_info" in workplan}>
<Grid item container sx={{ marginTop: "2px" }} xs={1}>
<DotIcon fill={phase_color} />
</Grid>
<Grid item container xs={5}>
<ETCaption2
bold
color={phase_color}
sx={{
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
}}
<Grid item xs={6}>
<Stack
direction={"row"}
spacing={1}
alignItems={"center"}
sx={{ overflow: "clip" }}
>
{workplan?.phase_info?.work_phase.name}
</ETCaption2>
<DotIcon fill={phase_color} />
<ETCaption2
bold
color={phase_color}
sx={{
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
}}
>
{workplan?.phase_info?.work_phase.name}
</ETCaption2>
</Stack>
</Grid>
<Grid item container sx={{ marginTop: "4px" }} xs={1}>
<ClockIcon
fill={
workplan?.phase_info?.days_left > 0
? Palette.neutral.main
: Palette.error.main
}
/>
</Grid>
<Grid item container xs={3}>
<ETCaption2
bold
color={
workplan?.phase_info?.days_left > 0
? Palette.neutral.main
: Palette.error.main
}
sx={{
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
}}
<Grid item xs={6}>
<Stack
direction={"row"}
spacing={1}
alignItems={"center"}
sx={{ overflow: "clip" }}
>
{daysLeft()}
</ETCaption2>
<ClockIcon
fill={
workplan?.phase_info?.days_left > 0
? Palette.neutral.main
: Palette.error.main
}
/>
<ETCaption2
bold
color={
workplan?.phase_info?.days_left > 0
? Palette.neutral.main
: Palette.error.main
}
sx={{
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
}}
>
{daysLeft()}
</ETCaption2>
</Stack>
</Grid>
</When>
</Grid>
Expand Down
Loading