Skip to content

Commit 9af1dad

Browse files
committed
feat: Arrows on sortable headers
https://harperdb.atlassian.net/browse/STUDIO-379
1 parent 258a682 commit 9af1dad

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/ui/table.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ export function TableHeadSortable<TData extends RowData>({ header, onColumnClick
6666
}, [header, onColumnClick]);
6767
if (header.column.columnDef.enableSorting) {
6868
return <TableHead {...props} className="px-0">
69-
<Button type="button" variant="ghost" className="rounded-none" onClick={onClickSort}>
69+
<Button
70+
type="button"
71+
variant="ghost"
72+
className={cn('rounded-none', !header.column.getIsSorted() || header.column.getIsSorted() === 'asc' ? 'cursor-n-resize' : 'cursor-s-resize')}
73+
onClick={onClickSort}>
7074
{header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext())}
7175
{header.column.getIsSorted() === 'asc'
7276
? <ArrowUp />

0 commit comments

Comments
 (0)