feat: smaller tank card

This commit is contained in:
TrèsAbhi committed 2024-07-02 20:12:15 -05:00
1 parent 127ffc787e
commit 595941ab9c
2 files changed
+20 -6

No files matched your search

@@ -10,7 +10,11 @@ import { Tanks } from './Tanks';
export function TankTable() { export function TankTable() {
return ( return (
<Flex justify="center"> <Flex justify="center">
<StickyTableRoot variant="surface" style={{ maxWidth: '100%' }}> <StickyTableRoot
size={{ initial: '1', sm: '2' }}
variant="surface"
style={{ maxWidth: '100%' }}
>
<Header /> <Header />
<Suspense fallback={<BodyLoader />}> <Suspense fallback={<BodyLoader />}>
<Tanks /> <Tanks />
+15 -5
View File
@@ -1,4 +1,4 @@
import { IconButton, Table } from '@radix-ui/themes'; import { Table } from '@radix-ui/themes';
import { TankDefinition } from '../core/blitzkit/tankDefinitions'; import { TankDefinition } from '../core/blitzkit/tankDefinitions';
import { tankIcon } from '../core/blitzkit/tankIcon'; import { tankIcon } from '../core/blitzkit/tankIcon';
import { classIcons } from './ClassIcon'; import { classIcons } from './ClassIcon';
@@ -19,6 +19,8 @@ export function TankRowHeaderCell({ tank }: TankRowHeaderCellProps) {
position: 'sticky', position: 'sticky',
left: 0, left: 0,
backgroundColor: 'var(--color-background)', backgroundColor: 'var(--color-background)',
maxWidth: 240,
overflow: 'hidden',
}} }}
> >
<Link href={`/tools/tankopedia/${tank.id}`} tabIndex={-1}> <Link href={`/tools/tankopedia/${tank.id}`} tabIndex={-1}>
@@ -52,16 +54,24 @@ export function TankRowHeaderCell({ tank }: TankRowHeaderCellProps) {
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'center',
gap: 'var(--space-1)', gap: 'var(--space-1)',
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
}} }}
> >
<Icon width="1em" height="1em" /> <Icon
width="1em"
height="1em"
style={{
minWidth: '1em',
minHeight: '1em',
}}
/>
{tank.name} {tank.name}
{tank.testing && ( {tank.testing && (
<IconButton size="1" ml="1"> <ScienceIcon style={{ width: '1em', height: '1em' }} />
<ScienceIcon style={{ width: '1em', height: '1em' }} />
</IconButton>
)} )}
</Link> </Link>
</Table.RowHeaderCell> </Table.RowHeaderCell>