From 7d46c04364af1b9e9ca25b646460cea5bd82c9f3 Mon Sep 17 00:00:00 2001 From: Koustav Das <78158736+Koustavd18@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:25:13 +0530 Subject: [PATCH] fix: table background (#392) This PR fixes the issue with the ability of highlight the selected cell without changing the behaviour of the rest of the table --- .../Stream/Views/Explore/StaticLogTable.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/pages/Stream/Views/Explore/StaticLogTable.tsx b/src/pages/Stream/Views/Explore/StaticLogTable.tsx index 15236d27..6ffec611 100644 --- a/src/pages/Stream/Views/Explore/StaticLogTable.tsx +++ b/src/pages/Stream/Views/Explore/StaticLogTable.tsx @@ -264,15 +264,18 @@ const Table = (props: { primaryHeaderHeight: number }) => { }, style: { border: 'none', - background: row.index % 2 === 0 ? '#f8f9fa' : 'white', backgroundColor: - rowNumber && - (() => { - const [start, end] = rowNumber.split(':').map(Number); - return row.index >= start && row.index <= end; - })() + row.index % 2 === 0 + ? rowNumber && + row.index >= _.toNumber(rowNumber.split(':')[0]) && + row.index <= _.toNumber(rowNumber.split(':')[1]) + ? '#E8EDFE' + : '#f8f9fa' + : rowNumber && + row.index >= _.toNumber(rowNumber.split(':')[0]) && + row.index <= _.toNumber(rowNumber.split(':')[1]) ? '#E8EDFE' - : '', + : 'white', }, }; }}