fix: disable highlighting on non-expandable rows (#592)

This commit is contained in:
Linkie Link 2023-10-27 18:15:54 +02:00 committed by GitHub
parent 1d8bab3206
commit 4a0072df40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,6 +16,8 @@ function getBorderColor(row: AccountBalanceRow) {
}
export default function Row<T>(props: Props<T>) {
const canExpand = !!props.renderExpanded
return (
<>
<tr
@ -23,7 +25,7 @@ export default function Row<T>(props: Props<T>) {
className={classNames(
'group/row transition-bg',
props.renderExpanded && 'hover:cursor-pointer',
props.row.getIsExpanded() ? 'is-expanded bg-black/20' : 'hover:bg-white/5',
canExpand && props.row.getIsExpanded() ? 'is-expanded bg-black/20' : 'hover:bg-white/5',
)}
onClick={(e) => {
e.preventDefault()