Skip to content

Commit

Permalink
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/gentle-houses-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sovryn/ui": patch
---

SOV-3392: update Table Row component styling
8 changes: 3 additions & 5 deletions packages/ui/src/2_molecules/TableBase/TableBase.tsx
Original file line number Diff line number Diff line change
@@ -39,12 +39,10 @@ export const TableBase = <RowType extends RowObject>({
const handleRowClick = useCallback(
(row: RowType) => {
onRowClick?.(row);

console.log('index', rows?.indexOf(row));

setSelectedIndex(rows?.indexOf(row));
const index = rows?.indexOf(row);
setSelectedIndex(index === selectedIndex ? undefined : index);
},
[onRowClick, rows],
[onRowClick, rows, selectedIndex],
);

return (
5 changes: 3 additions & 2 deletions packages/ui/src/2_molecules/TableRow/TableRow.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.row {
@apply cursor-pointer sm:cursor-auto outline outline-1 outline-gray-70 rounded text-xs font-medium;
@apply cursor-pointer sm:cursor-auto outline outline-1 outline-gray-70 rounded text-xs font-medium transition-colors;
transition-property: outline-color;

&.small > td {
@apply py-2.5 px-4;
@@ -29,7 +30,7 @@
}

.active {
@apply outline-gray-50 bg-gray-70;
@apply outline-positive/50;
}

.expanded {
2 changes: 1 addition & 1 deletion packages/ui/src/2_molecules/TableRow/TableRow.tsx
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@ export const TableRow = <RowType extends RowObject>({
<tr
key={index}
className={classNames(styles.row, className, styles[size], {
[styles.clickable]: isClickable,
[styles.clickable]: isClickable || expandedContent,
[styles.active]: isClickable && isSelected,
[styles.expanded]: expandedRow && expandedContent,
})}

0 comments on commit c67169e

Please sign in to comment.