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

Update/add kanbancard issue type #1997

Merged
merged 10 commits into from
Dec 13, 2023
33 changes: 26 additions & 7 deletions apps/web/lib/components/kanban-card.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import BugIcon from "@components/ui/svgs/bug";
import Image from 'next/image';
import VerticalThreeDot from "@components/ui/svgs/vertical-three-dot";
import { DraggableProvided } from "react-beautiful-dnd";
import CircularProgress from "@components/ui/svgs/circular-progress";
import PriorityIcon from "@components/ui/svgs/priority-icon";
import { Tag } from "@app/interfaces";
import { useTimer } from "@app/hooks";
import { useTimerView } from "@app/hooks";
import { pad } from "@app/helpers";
import { TaskStatus } from "@app/constants";
import { useEffect } from "react";
import { TaskIssueStatus } from "lib/features";

function getStyle(provided: DraggableProvided, style: any) {
if (!style) {
Expand Down Expand Up @@ -139,8 +140,26 @@ export default function Item(props: any) {
} = props;

const {
fomatedTimeCounter: { hours, minutes, seconds }
} = useTimer();
hours,
minutes,
seconds,
startTimer,
stopTimer,
timerStatus
} = useTimerView();

const handleTime = ()=>{
if(item.status === TaskStatus.INPROGRESS){
startTimer()
} else {
stopTimer()
}

}

useEffect(()=>{
handleTime()
},[timerStatus?.running])

return (
<section
Expand All @@ -165,9 +184,9 @@ export default function Item(props: any) {
)}

<div className="flex flex-row flex-wrap items-center text-sm not-italic font-semibold">
<span className="bg-indianRed rounded p-1 mr-1">
<BugIcon/>
</span>
<TaskIssueStatus showIssueLabels={false} task={item} className={`${
item.issueType === 'Bug' ? '!px-[0.3312rem] py-[0.2875rem]' : '!px-[0.375rem] py-[0.375rem]'
} rounded-sm mr-1`}/>
<span className="text-grey text-normal mr-1">#{item.number}</span>
<span className="text-black dark:text-white text-normal capitalize mr-2">{item.title}</span>
<Priority level={1}/>
Expand Down
Loading