File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import { useRouter } from "next/router";
22
33import useSWR from "swr" ;
44
5+ // hook
6+ import useEstimateOption from "hooks/use-estimate-option" ;
57// services
68import issuesService from "services/issues.service" ;
79// icons
@@ -77,6 +79,18 @@ const LabelPill = ({ labelId }: { labelId: string }) => {
7779 />
7880 ) ;
7981} ;
82+ const EstimatePoint = ( { point } : { point : string } ) => {
83+ const { estimateValue, isEstimateActive } = useEstimateOption ( Number ( point ) ) ;
84+ const currentPoint = Number ( point ) + 1 ;
85+
86+ return (
87+ < span className = "font-medium text-custom-text-100" >
88+ { isEstimateActive
89+ ? estimateValue
90+ : `${ currentPoint } ${ currentPoint > 1 ? "points" : "point" } ` }
91+ </ span >
92+ ) ;
93+ } ;
8094
8195const activityDetails : {
8296 [ key : string ] : {
@@ -324,8 +338,7 @@ const activityDetails: {
324338 else
325339 return (
326340 < >
327- set the estimate point to{ " " }
328- < span className = "font-medium text-custom-text-100" > { activity . new_value } </ span >
341+ set the estimate point to < EstimatePoint point = { activity . new_value } />
329342 { showIssue && (
330343 < >
331344 { " " }
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ const useEstimateOption = (estimateKey?: number | null) => {
3232 ) ;
3333
3434 const estimateValue : any =
35- ( estimateKey && estimateDetails ?. points ?. find ( ( e ) => e . key === estimateKey ) ?. value ) ?? "None" ;
35+ estimateKey || estimateKey === 0
36+ ? estimateDetails ?. points ?. find ( ( e ) => e . key === estimateKey ) ?. value
37+ : "None" ;
3638
3739 return {
3840 isEstimateActive : projectDetails ?. estimate ? true : false ,
You can’t perform that action at this time.
0 commit comments