feat : sidebar progress improvement (#272)
* feat: progress chart render validation * fix: sidebar stats tab * feat: sidebar active tab context
This commit is contained in:
parent
ebf294af55
commit
8fb34fe1e3
4 changed files with 85 additions and 16 deletions
|
|
@ -101,6 +101,8 @@ const CycleDetailSidebar: React.FC<Props> = ({ issues, cycle, isOpen, cycleIssue
|
|||
});
|
||||
}, [cycle, reset]);
|
||||
|
||||
const isStartValid = new Date(`${cycle?.start_date}`) <= new Date();
|
||||
const isEndValid = new Date(`${cycle?.end_date}`) >= new Date(`${cycle?.start_date}`);
|
||||
return (
|
||||
<div
|
||||
className={`fixed top-0 ${
|
||||
|
|
@ -275,14 +277,22 @@ const CycleDetailSidebar: React.FC<Props> = ({ issues, cycle, isOpen, cycleIssue
|
|||
<div className="py-1" />
|
||||
</div>
|
||||
<div className="flex flex-col items-center justify-center w-full gap-2 ">
|
||||
<div className="relative h-[200px] w-full ">
|
||||
<ProgressChart
|
||||
issues={issues}
|
||||
start={cycle?.start_date ?? ""}
|
||||
end={cycle?.end_date ?? ""}
|
||||
/>
|
||||
</div>
|
||||
<SidebarProgressStats issues={issues} groupedIssues={groupedIssues} />
|
||||
{isStartValid && isEndValid ? (
|
||||
<div className="relative h-[200px] w-full ">
|
||||
<ProgressChart
|
||||
issues={issues}
|
||||
start={cycle?.start_date ?? ""}
|
||||
end={cycle?.end_date ?? ""}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
{issues.length > 0 ? (
|
||||
<SidebarProgressStats issues={issues} groupedIssues={groupedIssues} />
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue