From b7b1d4a236153d65f34d81d35c28e28be6509153 Mon Sep 17 00:00:00 2001 From: Anastasiia Date: Wed, 30 Oct 2024 13:52:17 +0100 Subject: [PATCH] fix: update table to show arrow for sortable columns on hover --- .../partials/FiatTransfersTable/FiatTransfersTable.tsx | 1 - src/components/v5/common/Table/Table.tsx | 10 ++++------ src/components/v5/common/Table/types.ts | 1 - 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/components/frame/v5/pages/UserCryptoToFiatPage/partials/FiatTransfersTable/FiatTransfersTable.tsx b/src/components/frame/v5/pages/UserCryptoToFiatPage/partials/FiatTransfersTable/FiatTransfersTable.tsx index b67b7f1e4e..cb9a0ac179 100644 --- a/src/components/frame/v5/pages/UserCryptoToFiatPage/partials/FiatTransfersTable/FiatTransfersTable.tsx +++ b/src/components/frame/v5/pages/UserCryptoToFiatPage/partials/FiatTransfersTable/FiatTransfersTable.tsx @@ -72,7 +72,6 @@ const FiatTransfersTable = () => { getSortedRowModel={getSortedRowModel()} getPaginationRowModel={getPaginationRowModel()} getRowCanExpand={() => isMobile} - shouldHideSortingArrow={false} renderSubComponent={({ row }) => ( )} diff --git a/src/components/v5/common/Table/Table.tsx b/src/components/v5/common/Table/Table.tsx index 995b630010..e4ff965657 100644 --- a/src/components/v5/common/Table/Table.tsx +++ b/src/components/v5/common/Table/Table.tsx @@ -52,7 +52,6 @@ const Table = ({ showTableBorder = true, alwaysShowPagination = false, footerColSpan, - shouldHideSortingArrow = true, ...rest }: TableProps) => { const helper = useMemo(() => createColumnHelper(), []); @@ -239,7 +238,7 @@ const Table = ({ key={header.id} className={clsx( header.column.columnDef.headCellClassName, - 'border-b border-b-gray-200 bg-gray-50 px-[1.125rem] py-2.5 text-left text-sm font-normal text-gray-600 first:rounded-tl-lg last:rounded-tr-lg empty:p-0', + 'group border-b border-b-gray-200 bg-gray-50 px-[1.125rem] py-2.5 text-left text-sm font-normal text-gray-600 first:rounded-tl-lg last:rounded-tr-lg empty:p-0', { 'cursor-pointer': header.column.getCanSort() && @@ -277,10 +276,9 @@ const Table = ({ 'rotate-0': header.column.getIsSorted() === 'desc' && !shouldShowEmptyContent, - hidden: - shouldHideSortingArrow && - (header.column.getIsSorted() === false || - shouldShowEmptyContent), + 'opacity-0 group-hover:opacity-100': + header.column.getIsSorted() === false || + shouldShowEmptyContent, }, )} /> diff --git a/src/components/v5/common/Table/types.ts b/src/components/v5/common/Table/types.ts index 2a4eca04b6..a02e44a0f2 100644 --- a/src/components/v5/common/Table/types.ts +++ b/src/components/v5/common/Table/types.ts @@ -48,5 +48,4 @@ export interface TableProps showTableHead?: boolean; showTableBorder?: boolean; alwaysShowPagination?: boolean; - shouldHideSortingArrow?: boolean; }