feat: sticky headers

This commit is contained in:
TrèsAbhi committed 2024-07-12 13:01:10 -05:00
1 parent 3244a0fd8a
commit 7eb13c199b
10 files changed
+48 -46

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import { Table } from '@radix-ui/themes';
import { ColumnHeaderCellProps } from '@radix-ui/themes/dist/cjs/components/table';
export function StickyColumnHeaderCell({
style,
...props
}: ColumnHeaderCellProps) {
return (
<Table.ColumnHeaderCell
style={{
position: 'sticky',
top: 0,
background: 'var(--gray-3)',
zIndex: 1,
...style,
}}
{...props}
/>
);
}
-1
View File
@@ -8,7 +8,6 @@ export function StickyRowHeaderCell({ style, ...props }: RowHeaderCellProps) {
position: 'sticky',
left: 0,
backgroundColor: 'var(--color-panel)',
boxShadow: 'var(--shadow-6)',
...style,
}}
{...props}
+4 -12
View File
@@ -14,14 +14,8 @@ export function TankRowHeaderCell({ tank }: TankRowHeaderCellProps) {
return (
<StickyRowHeaderCell
maxWidth={{
initial: '180px',
sm: '240px',
}}
style={{
overflow: 'hidden',
display: 'flex',
}}
maxWidth={{ initial: '144px', sm: '240px' }}
style={{ overflow: 'hidden', display: 'flex' }}
>
<Link href={`/tools/tankopedia/${tank.id}`} tabIndex={-1}>
<img
@@ -58,14 +52,12 @@ export function TankRowHeaderCell({ tank }: TankRowHeaderCellProps) {
overflow: 'hidden',
textOverflow: 'ellipsis',
}}
size={{ initial: '1', sm: '2' }}
>
<Icon
width="1em"
height="1em"
style={{
minWidth: '1em',
minHeight: '1em',
}}
style={{ minWidth: '1em', minHeight: '1em' }}
/>
{tank.name}