feat: smaller tank icons

This commit is contained in:
TrèsAbhi committed 2024-07-07 18:19:45 -05:00
1 parent 3c9fcfa623
commit cc51f660d4
2 files changed
+10 -9

No files matched your search

+5 -2
View File
@@ -14,12 +14,15 @@ export function TankRowHeaderCell({ tank }: TankRowHeaderCellProps) {
return ( return (
<Table.RowHeaderCell <Table.RowHeaderCell
maxWidth={{
initial: '180px',
sm: '240px',
}}
style={{ style={{
display: 'flex', display: 'flex',
position: 'sticky', position: 'sticky',
left: 0, left: 0,
backgroundColor: 'var(--color-background)', backgroundColor: 'var(--color-background)',
maxWidth: 240,
overflow: 'hidden', overflow: 'hidden',
}} }}
> >
@@ -31,7 +34,7 @@ export function TankRowHeaderCell({ tank }: TankRowHeaderCellProps) {
style={{ style={{
margin: 'calc(-1 * var(--table-cell-padding)) 0', margin: 'calc(-1 * var(--table-cell-padding)) 0',
height: 'calc(100% + 2 * var(--table-cell-padding))', height: 'calc(100% + 2 * var(--table-cell-padding))',
aspectRatio: '16 / 9', aspectRatio: '4 / 3',
objectFit: 'cover', objectFit: 'cover',
}} }}
/> />
+5 -7
View File
@@ -17,14 +17,12 @@ export function useIntersection(
const rect = ref.current.getBoundingClientRect(); const rect = ref.current.getBoundingClientRect();
const visible = !(rect.bottom < 0 || rect.top - window.innerHeight >= 0); const visible = !(rect.bottom < 0 || rect.top - window.innerHeight >= 0);
if (visible) { if (visible) callback();
callback();
} else {
observer.current = new IntersectionObserver(callback, options);
observer.current.observe(ref.current);
return () => observer.current!.disconnect(); observer.current = new IntersectionObserver(callback, options);
} observer.current.observe(ref.current);
return () => observer.current!.disconnect();
}, []); }, []);
return observer; return observer;