refactor(ui): move hover background styles from tr to td using group utility
This commit is contained in:
@@ -297,12 +297,12 @@ const Table = ({
|
|||||||
return (
|
return (
|
||||||
<tr
|
<tr
|
||||||
key={item.id || index}
|
key={item.id || index}
|
||||||
className={`hover:bg-neutral-50 dark:hover:bg-neutral-950 transition-colors ${onRowClick ? 'cursor-pointer' : ''} ${extraClassName || ''}`}
|
className={`group transition-colors ${onRowClick ? 'cursor-pointer' : ''} ${extraClassName || ''}`}
|
||||||
onClick={onRowClick ? () => onRowClick(item) : undefined}
|
onClick={onRowClick ? () => onRowClick(item) : undefined}
|
||||||
{...rowExtraProps}
|
{...rowExtraProps}
|
||||||
>
|
>
|
||||||
{columns.map((column, colIdx) => (
|
{columns.map((column, colIdx) => (
|
||||||
<td key={column.key} className={`${sizeClasses.cell} ${column.noWrap !== false ? '' : 'whitespace-nowrap'} ${isLast && colIdx === 0 ? 'rounded-bl-xl' : ''} ${isLast && colIdx === columns.length - 1 ? 'rounded-br-xl' : ''}`}>
|
<td key={column.key} className={`${sizeClasses.cell} ${column.noWrap !== false ? '' : 'whitespace-nowrap'} group-hover:bg-neutral-50 dark:group-hover:bg-neutral-950 transition-colors ${isLast && colIdx === 0 ? 'rounded-bl-xl' : ''} ${isLast && colIdx === columns.length - 1 ? 'rounded-br-xl' : ''}`}>
|
||||||
{renderCellContent(item, column)}
|
{renderCellContent(item, column)}
|
||||||
</td>
|
</td>
|
||||||
))}
|
))}
|
||||||
|
|||||||
Reference in New Issue
Block a user