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>) { export default function Row<T>(props: Props<T>) {
const canExpand = !!props.renderExpanded
return ( return (
<> <>
<tr <tr
@ -23,7 +25,7 @@ export default function Row<T>(props: Props<T>) {
className={classNames( className={classNames(
'group/row transition-bg', 'group/row transition-bg',
props.renderExpanded && 'hover:cursor-pointer', 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) => { onClick={(e) => {
e.preventDefault() e.preventDefault()