1+ import Link from "next/link" ;
12import { observer } from "mobx-react" ;
23import { useRouter } from "next/router" ;
34// hooks
@@ -33,12 +34,12 @@ export const CycleGanttBlock: React.FC<Props> = observer((props) => {
3334 cycleStatus === "current"
3435 ? "#09a953"
3536 : cycleStatus === "upcoming"
36- ? "#f7ae59"
37- : cycleStatus === "completed"
38- ? "#3f76ff"
39- : cycleStatus === "draft"
40- ? "rgb(var(--color-text-200))"
41- : "" ,
37+ ? "#f7ae59"
38+ : cycleStatus === "completed"
39+ ? "#3f76ff"
40+ : cycleStatus === "draft"
41+ ? "rgb(var(--color-text-200))"
42+ : "" ,
4243 } }
4344 onClick = { ( ) => router . push ( `/${ workspaceSlug } /projects/${ cycleDetails ?. project_id } /cycles/${ cycleDetails ?. id } ` ) }
4445 >
@@ -63,8 +64,6 @@ export const CycleGanttBlock: React.FC<Props> = observer((props) => {
6364
6465export const CycleGanttSidebarBlock : React . FC < Props > = observer ( ( props ) => {
6566 const { cycleId } = props ;
66- // router
67- const router = useRouter ( ) ;
6867 // store hooks
6968 const {
7069 router : { workspaceSlug } ,
@@ -76,25 +75,25 @@ export const CycleGanttSidebarBlock: React.FC<Props> = observer((props) => {
7675 const cycleStatus = cycleDetails ?. status . toLocaleLowerCase ( ) ;
7776
7877 return (
79- < div
78+ < Link
8079 className = "relative flex h-full w-full items-center gap-2"
81- onClick = { ( ) => router . push ( `/${ workspaceSlug } /projects/${ cycleDetails ?. project_id } /cycles/${ cycleDetails ?. id } ` ) }
80+ href = { `/${ workspaceSlug } /projects/${ cycleDetails ?. project_id } /cycles/${ cycleDetails ?. id } ` }
8281 >
8382 < ContrastIcon
8483 className = "h-5 w-5 flex-shrink-0"
8584 color = { `${
8685 cycleStatus === "current"
8786 ? "#09a953"
8887 : cycleStatus === "upcoming"
89- ? "#f7ae59"
90- : cycleStatus === "completed"
91- ? "#3f76ff"
92- : cycleStatus === "draft"
93- ? "rgb(var(--color-text-200))"
94- : ""
88+ ? "#f7ae59"
89+ : cycleStatus === "completed"
90+ ? "#3f76ff"
91+ : cycleStatus === "draft"
92+ ? "rgb(var(--color-text-200))"
93+ : ""
9594 } `}
9695 />
9796 < h6 className = "flex-grow truncate text-sm font-medium" > { cycleDetails ?. name } </ h6 >
98- </ div >
97+ </ Link >
9998 ) ;
10099} ) ;
0 commit comments