From f3988ea98bef52df1f5091dc2fcdb192dfabb4fd Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Thu, 12 Sep 2024 22:48:25 +0200 Subject: [PATCH] fix overlap on team member card| table view --- apps/web/components/ui/data-table.tsx | 63 ++++++++++--------- apps/web/components/ui/table.tsx | 6 +- apps/web/lib/features/team-member-cell.tsx | 16 ++--- .../team/user-team-card/task-estimate.tsx | 2 +- .../team/user-team-card/task-info.tsx | 5 +- .../team/user-team-card/user-info.tsx | 2 +- 6 files changed, 45 insertions(+), 49 deletions(-) diff --git a/apps/web/components/ui/data-table.tsx b/apps/web/components/ui/data-table.tsx index 2baa8f34c..8a9ceaf8e 100644 --- a/apps/web/components/ui/data-table.tsx +++ b/apps/web/components/ui/data-table.tsx @@ -78,7 +78,7 @@ function DataTable({ columns, data, footerRows, isHeader }: DataT style={{ textAlign: index === 0 ? 'left' : 'center' }} - className="!w-40 text-base" + className="!w-40 text-base" key={header.id} > @@ -86,9 +86,9 @@ function DataTable({ columns, data, footerRows, isHeader }: DataT {header.isPlaceholder ? null : flexRender( - header.column.columnDef.header, - header.getContext() - )} + header.column.columnDef.header, + header.getContext() + )} @@ -98,32 +98,39 @@ function DataTable({ columns, data, footerRows, isHeader }: DataT ))} )} -
+
{table.getRowModel().rows?.length ? ( - table.getRowModel().rows.map((row, i) => ( - - {row.getVisibleCells().map((cell, index) => ( - - {flexRender(cell.column.columnDef.cell, cell.getContext())} - - ))} - - )) + table.getRowModel().rows.map((row, i) => { + return ( + + {row.getVisibleCells().map((cell, index) => { + return ( + + {flexRender(cell.column.columnDef.cell, cell.getContext())} + + ); + })} + + ); + }) ) : ( diff --git a/apps/web/components/ui/table.tsx b/apps/web/components/ui/table.tsx index 9f104cba0..fbf5986c2 100644 --- a/apps/web/components/ui/table.tsx +++ b/apps/web/components/ui/table.tsx @@ -57,11 +57,7 @@ TableHead.displayName = 'TableHead'; const TableCell = React.forwardRef>( ({ className, ...props }, ref) => ( - + ) ); TableCell.displayName = 'TableCell'; diff --git a/apps/web/lib/features/team-member-cell.tsx b/apps/web/lib/features/team-member-cell.tsx index 1476c38ec..5a6620985 100644 --- a/apps/web/lib/features/team-member-cell.tsx +++ b/apps/web/lib/features/team-member-cell.tsx @@ -24,8 +24,8 @@ export function TaskCell({ row }: { row: any }) { edition={taskEdition} memberInfo={memberInfo} className={clsxm( - 'flex-1 flex justify-center items-center w-full px-2', - fullWidth ? 'max-w-[40vw]' : 'max-w-[30vw]' + 'flex-1 flex justify-center items-center px-2', + fullWidth ? 'max-w-[40rem]' : 'max-w-[30rem]' )} publicTeam={publicTeam} /> @@ -38,13 +38,12 @@ export function UserInfoCell({ cell }: { cell: any }) { const publicTeam = get(cell, 'column.columnDef.meta.publicTeam', false); const memberInfo = useTeamMemberCard(member); - return ; + return ; } export function WorkedOnTaskCell({ row }: { row: any }) { const member = row.original as OT_Member; const memberInfo = useTeamMemberCard(member); - const fullWidth = useRecoilValue(fullWidthState); return ( ); } @@ -70,9 +66,7 @@ export function TaskEstimateInfoCell({ row }: { row: any }) { memberInfo={memberInfo} edition={taskEdition} activeAuthTask={true} - className={clsxm( - 'flex flex-col justify-center items-center 2xl:w-[7rem] 3xl:w-[10rem]' - )} + className={clsxm('flex flex-col justify-center items-center')} /> ); } diff --git a/apps/web/lib/features/team/user-team-card/task-estimate.tsx b/apps/web/lib/features/team/user-team-card/task-estimate.tsx index 511bdf2c2..5dbc9b695 100644 --- a/apps/web/lib/features/team/user-team-card/task-estimate.tsx +++ b/apps/web/lib/features/team/user-team-card/task-estimate.tsx @@ -34,7 +34,7 @@ export function TaskEstimateInfo({ className, activeAuthTask, showTime = true, r return (
-
+
{showTime && (
diff --git a/apps/web/lib/features/team/user-team-card/task-info.tsx b/apps/web/lib/features/team/user-team-card/task-info.tsx index 36b291c9d..f2cb9187b 100644 --- a/apps/web/lib/features/team/user-team-card/task-info.tsx +++ b/apps/web/lib/features/team/user-team-card/task-info.tsx @@ -19,9 +19,8 @@ export function TaskInfo({ className, memberInfo, edition, publicTeam, tab, dayP
{/* task */} diff --git a/apps/web/lib/features/team/user-team-card/user-info.tsx b/apps/web/lib/features/team/user-team-card/user-info.tsx index 3860a3e4b..09bb4fb92 100644 --- a/apps/web/lib/features/team/user-team-card/user-info.tsx +++ b/apps/web/lib/features/team/user-team-card/user-info.tsx @@ -33,7 +33,7 @@ export function UserInfo({ className, memberInfo, publicTeam = false }: Props) { return (