performance table rewrite and shared sort direction

This commit is contained in:
tresabhi committed 2026-11-17 22:01:46 -06:00
1 parent 966651284d
commit 0578f47914
38 files changed
+965 -874

No files matched your search

@@ -1,10 +1,10 @@
import type { APIContext, GetStaticPathsItem } from "astro";
import sharp from "sharp";
import { mixStaticPaths } from "../../../../astro/mixStaticPaths";
import {
docImageId,
externalDocImages,
} from "../../../../core/blitzkit/docImages";
import { mixStaticPaths } from "../../../../core/blitzkit/mixStaticPaths";
import { getStaticPaths as _getStaticPaths } from "../../_index";
export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
@@ -20,7 +20,7 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
({
params: { id: docImageId(url) },
props: { url },
}) satisfies GetStaticPathsItem,
} satisfies GetStaticPathsItem),
);
});
@@ -1,19 +0,0 @@
---
import ToolOpenGraph from "../../../../components/ToolOpenGraph.astro";
import { tools } from "../../../../constants/tools";
import BaseLayout from "../../../../layouts/BaseLayout.astro";
import type { getStaticPaths } from "../index.astro";
import { Page } from "./_index";
export { getStaticPaths } from "../index.astro";
const { locale } = Astro.props;
---
<ToolOpenGraph {locale} tool={tools.performance} />
<BaseLayout {locale} noFooter>
<Page client:only="react" {locale}>
<Page skeleton slot="fallback" {locale} />
</Page>
</BaseLayout>
@@ -0,0 +1,28 @@
.page {
/* Fixed to the viewport so the table scrolls, not the page */
height: 100dvh;
display: flex;
flex-direction: column;
align-items: center;
box-sizing: border-box;
.top {
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-4);
padding: var(--space-4);
}
.table {
flex: 1;
min-height: 0;
align-self: stretch;
overflow: hidden;
display: flex;
justify-content: center;
}
}
@@ -1,30 +1,19 @@
import { PageWrapper } from "../../../../components/PageWrapper";
import { PlayerCountControl } from "../../../../components/Performance/PlayerCountControl";
import { TankTable } from "../../../../components/Performance/Table";
import { TankSearchFilters } from "../../../../components/TankSearchFilters";
import {
LocaleProvider,
type LocaleAcceptorProps,
} from "../../../../hooks/useLocale";
import type { MaybeSkeletonComponentProps } from "../../../../types/maybeSkeletonComponentProps";
import { PerformanceControls } from "../../../../components/PerformanceControls";
import { PerformanceTable } from "../../../../components/PerformanceTable";
import { withErrorWrapper } from "../../../../hocs/withErrorWrapper";
import { withLocale } from "../../../../hocs/withLocale";
import styles from "./_index.module.css";
type PageProps = MaybeSkeletonComponentProps & LocaleAcceptorProps;
export const Page = withLocale(
withErrorWrapper(() => (
<div className={styles.page}>
<div className={styles.top}>
<PerformanceControls />
</div>
export function Page({ skeleton, locale }: PageProps) {
return (
<LocaleProvider locale={locale}>
<Content skeleton={skeleton} />
</LocaleProvider>
);
}
function Content({ skeleton }: MaybeSkeletonComponentProps) {
return (
<PageWrapper pb="0" px="0" color="jade" maxWidth="100%">
<TankSearchFilters />
<PlayerCountControl />
<TankTable skeleton={skeleton} />
</PageWrapper>
);
}
<div className={styles.table}>
<PerformanceTable />
</div>
</div>
)),
);
@@ -0,0 +1,18 @@
---
import ColorScale from "../../../../components/ColorScale.astro";
import BaseLayout from "../../../../layouts/BaseLayout.astro";
import { Page } from "./_index";
export { getStaticPaths } from "../index.astro";
const { locale } = Astro.props;
---
<BaseLayout accent="jade" {locale}>
<ColorScale color="red" />
<ColorScale color="jade" />
<ColorScale color="amber" />
<ColorScale color="blue" />
<Page {locale} client:load />
</BaseLayout>