Skip to content

Commit

Permalink
Update/add kanbancard issue type (#1997)
Browse files Browse the repository at this point in the history
* update:add kanban to issuesview

* feat:add kanban icon

* update:add tooltip to view icons

* update:add timer to inprogress

* chore:remove unused values

* update:fix issues with scroll

* update:add issuetype to kanban card

* fix:remove null checker
  • Loading branch information
maceteligolden authored Dec 13, 2023
1 parent 6e89bf9 commit 0e191a1
Showing 1 changed file with 26 additions and 7 deletions.
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

0 comments on commit 0e191a1

Please sign in to comment.