From 43b94f3b4eff2e20c980f2743b0f9d05a4c59c5c Mon Sep 17 00:00:00 2001 From: Innocent-akim Date: Sun, 8 Dec 2024 18:14:36 +0200 Subject: [PATCH 1/2] fix: Kanban | Cards are broken when toogle FullWidth Mode --- apps/web/app/[locale]/kanban/page.tsx | 18 +++-- .../lib/features/team-members-kanban-view.tsx | 73 +++++++++---------- 2 files changed, 46 insertions(+), 45 deletions(-) diff --git a/apps/web/app/[locale]/kanban/page.tsx b/apps/web/app/[locale]/kanban/page.tsx index 018561643..f4cf38ee6 100644 --- a/apps/web/app/[locale]/kanban/page.tsx +++ b/apps/web/app/[locale]/kanban/page.tsx @@ -31,6 +31,7 @@ import { useAtomValue } from 'jotai'; import { fullWidthState } from '@app/stores/fullWidth'; import { CircleIcon } from 'lucide-react'; import { XMarkIcon } from '@heroicons/react/20/solid'; +import { cn } from '@/lib/utils'; const Kanban = () => { const { @@ -161,11 +162,10 @@ const Kanban = () => {
setActiveTab(tab.value)} - className={`cursor-pointer pt-2.5 px-5 pb-[30px] text-base font-semibold ${ - activeTab === tab.value - ? 'border-b-[#3826A6] text-[#3826A6] dark:text-white dark:border-b-white' - : 'border-b-white dark:border-b-[#191A20] dark:text-white text-[#282048]' - }`} + className={`cursor-pointer pt-2.5 px-5 pb-[30px] text-base font-semibold ${activeTab === tab.value + ? 'border-b-[#3826A6] text-[#3826A6] dark:text-white dark:border-b-white' + : 'border-b-white dark:border-b-[#191A20] dark:text-white text-[#282048]' + }`} style={{ borderBottomWidth: '3px', borderBottomStyle: 'solid' @@ -259,10 +259,14 @@ const Kanban = () => { } > {/** TODO:fetch teamtask based on days */} + +
{activeTab && (Object.keys(data).length > 0 ? ( - + + + ) : ( // add filter for today, yesterday and tomorrow
@@ -270,7 +274,7 @@ const Kanban = () => {
))}
- + ); diff --git a/apps/web/lib/features/team-members-kanban-view.tsx b/apps/web/lib/features/team-members-kanban-view.tsx index b260e0b76..995bedf01 100644 --- a/apps/web/lib/features/team-members-kanban-view.tsx +++ b/apps/web/lib/features/team-members-kanban-view.tsx @@ -2,7 +2,6 @@ import { useTaskStatus } from '@app/hooks'; import { useKanban } from '@app/hooks/features/useKanban'; import { ITaskStatusItemList, ITeamTask } from '@app/interfaces'; import { IKanban } from '@app/interfaces/IKanban'; -import { fullWidthState } from '@app/stores/fullWidth'; import KanbanDraggable, { EmptyKanbanDroppable } from 'lib/components/Kanban'; import { Fragment, useEffect, useRef, useState } from 'react'; import { @@ -13,7 +12,6 @@ import { DroppableProvided, DroppableStateSnapshot } from 'react-beautiful-dnd'; -import { useAtomValue } from 'jotai'; import { ScrollArea, ScrollBar } from '@components/ui/scroll-area'; import { cn } from '../utils'; @@ -38,7 +36,6 @@ export const KanbanView = ({ kanbanBoardTasks, isLoading }: { kanbanBoardTasks: }; }) ); - const fullWidth = useAtomValue(fullWidthState); const containerRef = useRef(null); const { taskStatus: ts } = useTaskStatus(); const reorderTask = (list: ITeamTask[], startIndex: number, endIndex: number) => { @@ -201,7 +198,7 @@ export const KanbanView = ({ kanbanBoardTasks, isLoading }: { kanbanBoardTasks: return (
@@ -213,46 +210,46 @@ export const KanbanView = ({ kanbanBoardTasks, isLoading }: { kanbanBoardTasks: className={cn( 'flex flex-1 flex-row gap-2 min-h-fit px-8 lg:px-0 w-full h-full', snapshot.isDraggingOver ? 'bg-slate-200 dark:bg-slate-800' : '', - !fullWidth && 'x-container pl-0' + // !fullWidth && 'x-contane pl-0' )} ref={provided.innerRef} {...provided.droppableProps} > {columns.length > 0 ? columns.map((column: any, index: number) => ( - - {isColumnCollapse(column.name) ? ( - - ) : ( - - )} - - )) + + {isColumnCollapse(column.name) ? ( + + ) : ( + + )} + + )) : null} {provided.placeholder as React.ReactElement}
From ac2b6b93f97c1c840a4cd3b19cddc1e801c07db0 Mon Sep 17 00:00:00 2001 From: Innocent-akim Date: Sun, 8 Dec 2024 19:01:54 +0200 Subject: [PATCH 2/2] fix: cspell --- apps/web/lib/features/team-members-kanban-view.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/web/lib/features/team-members-kanban-view.tsx b/apps/web/lib/features/team-members-kanban-view.tsx index 995bedf01..3ab46d943 100644 --- a/apps/web/lib/features/team-members-kanban-view.tsx +++ b/apps/web/lib/features/team-members-kanban-view.tsx @@ -210,7 +210,6 @@ export const KanbanView = ({ kanbanBoardTasks, isLoading }: { kanbanBoardTasks: className={cn( 'flex flex-1 flex-row gap-2 min-h-fit px-8 lg:px-0 w-full h-full', snapshot.isDraggingOver ? 'bg-slate-200 dark:bg-slate-800' : '', - // !fullWidth && 'x-contane pl-0' )} ref={provided.innerRef} {...provided.droppableProps}