Skip to content

Commit

Permalink
Merge pull request #3135 from ever-co/2411-bug-kanban--task-worked-ti…
Browse files Browse the repository at this point in the history
…me-issue

fix: show live time for task on which the user is working
  • Loading branch information
evereq authored Oct 8, 2024
2 parents 00db51d + 2ce5a42 commit 7ea626f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions apps/web/lib/components/kanban-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ import {
useAuthenticateUser,
useOrganizationTeams,
useTaskStatistics,
useTeamMemberCard
useTeamMemberCard,
useTeamTasks,
useTimerView
} from '@app/hooks';
import ImageComponent, { ImageOverlapperProps } from './image-overlapper';
import { TaskAllStatusTypes, TaskInput, TaskIssueStatus } from 'lib/features';
import Link from 'next/link';
import CircularProgress from '@components/ui/svgs/circular-progress';
import { HorizontalSeparator } from './separator';
import { secondsToTime } from '@app/helpers';
import { TaskStatus } from '@app/constants';
import MenuKanbanCard from '@components/pages/kanban/menu-kanban-card';
import { activeTeamTaskId } from '@app/stores';
import { useAtom } from 'jotai';
Expand Down Expand Up @@ -158,6 +159,8 @@ export default function Item(props: ItemProps) {
const { user } = useAuthenticateUser();
const { getEstimation } = useTaskStatistics(0);
const [activeTask, setActiveTask] = useAtom(activeTeamTaskId);
const {activeTeamTask} = useTeamTasks()
const {timerStatus} = useTimerView()

const members = activeTeam?.members || [];
const currentUser = members.find((m) => m.employee.userId === user?.id);
Expand Down Expand Up @@ -285,7 +288,7 @@ export default function Item(props: ItemProps) {
</div>
<div className="w-full h-10 flex items-center justify-between">
<div>
{item.status === TaskStatus.INPROGRESS ? (
{item.id === activeTeamTask?.id && timerStatus?.running ? (
<div className="flex items-center gap-2">
<small className="text-grey text-xs text-normal">Live:</small>
<p className="text-[#219653] font-medium text-sm">
Expand All @@ -295,8 +298,8 @@ export default function Item(props: ItemProps) {
) : (
<div className="flex items-center gap-2">
<small className="text-grey text-xs text-normal">Worked:</small>
<p className="text-black dark:text-white font-medium w-20 text-sm">
{h}h : {m}m : {s}s
<p className="text-black dark:text-white font-medium text-sm">
{h}h : {m}m
</p>
</div>
)}
Expand Down

0 comments on commit 7ea626f

Please sign in to comment.