feat: migrate tier list

This commit is contained in:
tresabhi committed 2025-05-16 18:15:27 -05:00
1 parent 8bdc4d9b1b
commit da506083c9
4 files changed
+51 -44

No files matched your search

@@ -0,0 +1,36 @@
import { PageWrapper } from '../../../components/PageWrapper';
import { FilterControl } from '../../../components/TankSearch/components/FilterControl';
import { TierListControls } from '../../../components/TierList/Controls';
import { TierListTable } from '../../../components/TierList/Table';
import { TierListTiles } from '../../../components/TierList/Tiles';
import { URLManager } from '../../../components/TierList/URLManager';
import {
LocaleProvider,
type LocaleAcceptorProps,
} from '../../../hooks/useLocale';
import { TankopediaPersistent } from '../../../stores/tankopediaPersistent';
import { TierList } from '../../../stores/tierList';
export function Page({ locale }: LocaleAcceptorProps) {
return (
<LocaleProvider locale={locale}>
<TierList.Provider>
<TankopediaPersistent.Provider>
<Content />
</TankopediaPersistent.Provider>
</TierList.Provider>
</LocaleProvider>
);
}
function Content() {
return (
<PageWrapper color="orange" maxWidth="100rem">
<URLManager />
<TierListControls />
<TierListTable />
<FilterControl />
<TierListTiles />
</PageWrapper>
);
}
@@ -0,0 +1,13 @@
---
import { tierListTool } from '../../../constants/tools';
import ToolLayout from '../../../layouts/ToolLayout.astro';
import { Page } from './_index';
export { getStaticPaths } from '../index.astro';
const { locale } = Astro.params;
---
<ToolLayout tool={tierListTool}>
<Page {locale} client:load />
</ToolLayout>
@@ -1,36 +0,0 @@
import { PageWrapper } from '../../../../components/PageWrapper';
import { FilterControl } from '../../../../components/TankSearch/components/FilterControl';
import { TierListControls } from '../../../../components/TierList/Controls';
import { TierListTable } from '../../../../components/TierList/Table';
import { TierListTiles } from '../../../../components/TierList/Tiles';
import { URLManager } from '../../../../components/TierList/URLManager';
import {
LocaleProvider,
type LocaleAcceptorProps,
} from '../../../../hooks/useLocale';
import { TankopediaPersistent } from '../../../../stores/tankopediaPersistent';
import { TierList } from '../../../../stores/tierList';
export function Page({ locale }: LocaleAcceptorProps) {
return (
<LocaleProvider locale={locale}>
<TierList.Provider>
<TankopediaPersistent.Provider>
<Content />
</TankopediaPersistent.Provider>
</TierList.Provider>
</LocaleProvider>
);
}
function Content() {
return (
<PageWrapper color="orange" maxWidth="100rem">
<URLManager />
<TierListControls />
<TierListTable />
<FilterControl />
<TierListTiles />
</PageWrapper>
);
}
@@ -1,13 +1,7 @@
---
import { tierListTool } from '../../../../constants/tools';
import ToolLayout from '../../../../layouts/ToolLayout.astro';
import { Page } from './_index';
import LegacyRedirect from '../../../../components/LegacyRedirect.astro';
export { getStaticPaths } from '../../index.astro';
const { locale } = Astro.params;
---
<ToolLayout tool={tierListTool}>
<Page {locale} client:load />
</ToolLayout>
<LegacyRedirect path="tier-list" />