From 0a056d69ffffe5484f7d972dac886320d526446a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julia=20R=C3=B6=C3=9Fchen?= Date: Fri, 23 Feb 2024 17:21:59 +0100 Subject: [PATCH] fixed the hover behavior, so "rows per page" button behaves the same way as other buttons in the peers overview --- src/components/table/DataTableRowsPerPage.tsx | 23 ++++++++++--------- src/modules/peers/PeerOSCell.tsx | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/components/table/DataTableRowsPerPage.tsx b/src/components/table/DataTableRowsPerPage.tsx index cfb5157..c2e0f73 100644 --- a/src/components/table/DataTableRowsPerPage.tsx +++ b/src/components/table/DataTableRowsPerPage.tsx @@ -18,6 +18,8 @@ export function DataTableRowsPerPage({ disabled, }: DataTablePaginationProps) { const [open, setOpen] = React.useState(false); + const [isHovered, setIsHovered] = React.useState(false); + const textColorClass = isHovered ? "text-white" : "text-nb-gray-300"; return ( <> @@ -28,16 +30,18 @@ export function DataTableRowsPerPage({ role="combobox" aria-expanded={open} disabled={disabled} + onMouseEnter={() => setIsHovered(true)} + onMouseLeave={() => setIsHovered(false)} className="w-[200px] justify-between" > - +
- + {table.getState().pagination.pageSize} - rows per page + rows per page
- + @@ -56,18 +60,15 @@ export function DataTableRowsPerPage({ className={cn( "cursor-pointer", "flex gap-2 px-2 py-1.5 my-1 mx-1 rounded-md items-center hover:dark:bg-nb-gray-800 text-nb-gray-400 hover:text-white", - table.getState().pagination.pageSize === val - ? "text-white" - : "", + table.getState().pagination.pageSize === val ? "text-white" : "", )} > {val} diff --git a/src/modules/peers/PeerOSCell.tsx b/src/modules/peers/PeerOSCell.tsx index a823bed..ad0bd73 100644 --- a/src/modules/peers/PeerOSCell.tsx +++ b/src/modules/peers/PeerOSCell.tsx @@ -50,7 +50,7 @@ export function OSLogo({ os }: { os: string }) { if (icon === OperatingSystem.APPLE) return {""}; if (icon === OperatingSystem.IOS) - return ; + return {""}; if (icon === OperatingSystem.ANDROID) return ;