Skip to content

Commit

Permalink
direct to workplan on view button
Browse files Browse the repository at this point in the history
  • Loading branch information
tom0827 committed Dec 8, 2023
1 parent 6ac1343 commit 01a0d4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions epictrack-web/src/components/myWorkplans/Card/CardBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const CardBody = ({ workplan }: CardProps) => {
<Grid item container sx={{ marginTop: "2px" }} xs={1}>
<DotIcon fill={phase_color} />
</Grid>
<Grid item container xs={6}>
<Grid item container xs={5}>
<ETCaption2
bold
color={phase_color}
Expand All @@ -78,7 +78,7 @@ const CardBody = ({ workplan }: CardProps) => {
<Grid item container sx={{ marginTop: "4px" }} xs={1}>
<ClockIcon />
</Grid>
<Grid item container xs={4}>
<Grid item container xs={3}>
<ETCaption2
bold
color={Palette.neutral.main}
Expand Down
6 changes: 4 additions & 2 deletions epictrack-web/src/components/myWorkplans/Card/CardFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import { ETCaption1, ETCaption2, ETParagraph } from "../../shared";
import Icons from "../../icons";
import { IconProps } from "../../icons/type";
import { CardProps } from "./type";
import { useNavigate } from "react-router-dom";

const EyeIcon: React.FC<IconProps> = Icons["EyeIcon"];

const CardFooter = ({ workplan }: CardProps) => {
const navigate = useNavigate();
const team_lead = workplan.staff_info.find((staff: any) => {
if (staff.role.name === "Team Lead") {
return staff.staff.full_name;
Expand Down Expand Up @@ -98,9 +100,9 @@ const CardFooter = ({ workplan }: CardProps) => {
backgroundColor: "inherit",
borderColor: "transparent",
}}
onClick={() => undefined}
onClick={() => navigate(`/work-plan?work_id=${workplan.id}`)}
>
<ETCaption2 bold>View Only</ETCaption2>
<ETCaption2 bold>View</ETCaption2>
</Button>
</Grid>
</Grid>
Expand Down

0 comments on commit 01a0d4b

Please sign in to comment.