mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: move to locale
This commit is contained in:
1 parent
60ab845326
commit
1843eb3bcf
44 files changed
+234
-223
No files matched your search
@@ -9,6 +9,9 @@ export default defineConfig({
|
||||
i18n: {
|
||||
defaultLocale: 'en',
|
||||
locales: SUPPORTED_LOCALES,
|
||||
routing: {
|
||||
prefixDefaultLocale: false,
|
||||
},
|
||||
},
|
||||
|
||||
devToolbar: { enabled: false },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Switch } from '@radix-ui/themes';
|
||||
import type { EmbedPreviewControllerProps } from '../../pages/tools/embed/[embed]/_index';
|
||||
import type { EmbedPreviewControllerProps } from '../../pages/[...locale]/tools/embed/[embed]/_index';
|
||||
import { EmbedState } from '../../stores/embedState';
|
||||
|
||||
export function Boolean({ configKey }: EmbedPreviewControllerProps) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { EmbedPreviewControllerProps } from '../../pages/tools/embed/[embed]/_index';
|
||||
import type { EmbedPreviewControllerProps } from '../../pages/[...locale]/tools/embed/[embed]/_index';
|
||||
import { EmbedState } from '../../stores/embedState';
|
||||
import { ColorControllerRaw } from './ColorControllerRaw';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Select } from '@radix-ui/themes';
|
||||
import type { EmbedPreviewControllerProps } from '../../pages/tools/embed/[embed]/_index';
|
||||
import type { EmbedPreviewControllerProps } from '../../pages/[...locale]/tools/embed/[embed]/_index';
|
||||
import { EmbedState } from '../../stores/embedState';
|
||||
import type {
|
||||
EmbedConfigItemType,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Slider } from '@radix-ui/themes';
|
||||
import type { EmbedPreviewControllerProps } from '../../pages/tools/embed/[embed]/_index';
|
||||
import type { EmbedPreviewControllerProps } from '../../pages/[...locale]/tools/embed/[embed]/_index';
|
||||
import { EmbedState, type RadixRadius } from '../../stores/embedState';
|
||||
|
||||
export function Radius({ configKey }: EmbedPreviewControllerProps) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { FontBoldIcon, FontSizeIcon } from '@radix-ui/react-icons';
|
||||
import { Flex, Slider, Text } from '@radix-ui/themes';
|
||||
import type { EmbedPreviewControllerProps } from '../../pages/tools/embed/[embed]/_index';
|
||||
import type { EmbedPreviewControllerProps } from '../../pages/[...locale]/tools/embed/[embed]/_index';
|
||||
import { EmbedState, type RadixSizeWithout0 } from '../../stores/embedState';
|
||||
import {
|
||||
radixTextWeights,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Slider } from '@radix-ui/themes';
|
||||
import type { EmbedPreviewControllerProps } from '../../pages/tools/embed/[embed]/_index';
|
||||
import type { EmbedPreviewControllerProps } from '../../pages/[...locale]/tools/embed/[embed]/_index';
|
||||
import { EmbedState, type RadixSize } from '../../stores/embedState';
|
||||
|
||||
export function Size({ configKey }: EmbedPreviewControllerProps) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Slider } from '@radix-ui/themes';
|
||||
import type { EmbedPreviewControllerProps } from '../../pages/tools/embed/[embed]/_index';
|
||||
import type { EmbedPreviewControllerProps } from '../../pages/[...locale]/tools/embed/[embed]/_index';
|
||||
import { EmbedState, type RadixSizeWithout0 } from '../../stores/embedState';
|
||||
|
||||
export function SizeWithout0({ configKey }: EmbedPreviewControllerProps) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Slider as RadixSlider } from '@radix-ui/themes';
|
||||
import type { EmbedPreviewControllerProps } from '../../pages/tools/embed/[embed]/_index';
|
||||
import type { EmbedPreviewControllerProps } from '../../pages/[...locale]/tools/embed/[embed]/_index';
|
||||
import { EmbedState, type RadixSize } from '../../stores/embedState';
|
||||
import type {
|
||||
EmbedConfigItemType,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { TextField } from '@radix-ui/themes';
|
||||
import type { EmbedPreviewControllerProps } from '../../pages/tools/embed/[embed]/_index';
|
||||
import type { EmbedPreviewControllerProps } from '../../pages/[...locale]/tools/embed/[embed]/_index';
|
||||
import { EmbedState } from '../../stores/embedState';
|
||||
|
||||
export function TextController({ configKey }: EmbedPreviewControllerProps) {
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { useEffect } from 'react';
|
||||
import { App } from '../../../stores/app';
|
||||
import { App } from '../../../../stores/app';
|
||||
|
||||
export const AUTH_PROVIDERS = ['wargaming'] as const;
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
---
|
||||
import { Flex, Heading, Text } from '@radix-ui/themes';
|
||||
import type { GetStaticPaths } from 'astro';
|
||||
import { PageWrapper } from '../../../components/PageWrapper';
|
||||
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
||||
import { AUTH_PROVIDERS, AUTH_PROVIDER_NAMES, Authorize } from './_index';
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { Markdown } from '../../../../components/Markdown';
|
||||
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||
import { Markdown } from '../../../../../components/Markdown';
|
||||
import { PageWrapper } from '../../../../../components/PageWrapper';
|
||||
|
||||
interface PageProps {
|
||||
content: string;
|
||||
File renamed without changes.
+1
-1
@@ -2,7 +2,7 @@
|
||||
import { MagicWandIcon, StarFilledIcon } from '@radix-ui/react-icons';
|
||||
import { Flex, Heading, Link } from '@radix-ui/themes';
|
||||
import { compareVersions } from 'compare-versions';
|
||||
import { PageWrapper } from '../../../components/PageWrapper';
|
||||
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
||||
|
||||
// this can't be used in template literal :(
|
||||
+16
-8
@@ -1,11 +1,12 @@
|
||||
---
|
||||
import { assertSecret } from '@blitzkit/core';
|
||||
import { assertSecret, SUPPORTED_LOCALES } from '@blitzkit/core';
|
||||
import { Box, Flex, Heading } from '@radix-ui/themes';
|
||||
import { AesonPlug } from '../components/AesonPlug';
|
||||
import HomeHero from '../components/HomeHero.astro';
|
||||
import { HomePageHotTanks } from '../components/HomePageHotTanks';
|
||||
import { Plugs } from '../components/Plugs.tsx';
|
||||
import ToolCard from '../components/ToolCard.astro';
|
||||
import type { GetStaticPaths } from 'astro';
|
||||
import { AesonPlug } from '../../components/AesonPlug';
|
||||
import HomeHero from '../../components/HomeHero.astro';
|
||||
import { HomePageHotTanks } from '../../components/HomePageHotTanks';
|
||||
import { Plugs } from '../../components/Plugs';
|
||||
import ToolCard from '../../components/ToolCard.astro';
|
||||
import {
|
||||
compareTool,
|
||||
discordTool,
|
||||
@@ -16,10 +17,17 @@ import {
|
||||
sessionTool,
|
||||
tankopediaTool,
|
||||
tierListTool,
|
||||
} from '../constants/tools';
|
||||
import BaseLayout from '../layouts/BaseLayout.astro';
|
||||
} from '../../constants/tools';
|
||||
import BaseLayout from '../../layouts/BaseLayout.astro';
|
||||
|
||||
const branch = assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH);
|
||||
|
||||
export const getStaticPaths = (() => {
|
||||
return [
|
||||
...SUPPORTED_LOCALES.map((locale) => ({ params: { locale } })),
|
||||
{ params: { locale: undefined } },
|
||||
];
|
||||
}) satisfies GetStaticPaths;
|
||||
---
|
||||
|
||||
<BaseLayout>
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { Flex, Heading, Switch, Text } from '@radix-ui/themes';
|
||||
import { PageWrapper } from '../../components/PageWrapper';
|
||||
import { App } from '../../stores/app';
|
||||
import { PageWrapper } from '../../../components/PageWrapper';
|
||||
import { App } from '../../../stores/app';
|
||||
|
||||
export function Page() {
|
||||
return (
|
||||
File renamed without changes.
+5
-5
@@ -1,9 +1,9 @@
|
||||
import { Flex } from '@radix-ui/themes';
|
||||
import { ChartsControl } from '../../../components/Charts/ChartsControl';
|
||||
import { PlayersInPeriod } from '../../../components/Charts/PlayersInPeriod';
|
||||
import { PageWrapper } from '../../../components/PageWrapper';
|
||||
import { FilterControl } from '../../../components/TankSearch/components/FilterControl';
|
||||
import { Charts } from '../../../stores/charts';
|
||||
import { ChartsControl } from '../../../../components/Charts/ChartsControl';
|
||||
import { PlayersInPeriod } from '../../../../components/Charts/PlayersInPeriod';
|
||||
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||
import { FilterControl } from '../../../../components/TankSearch/components/FilterControl';
|
||||
import { Charts } from '../../../../stores/charts';
|
||||
|
||||
export function Page() {
|
||||
return (
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
---
|
||||
import { chartsTool } from '../../../constants/tools';
|
||||
import { chartsTool } from '../../../../constants/tools';
|
||||
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
||||
import { Page } from './_index';
|
||||
---
|
||||
+15
-15
@@ -2,21 +2,21 @@ import { createDefaultSkills } from '@blitzkit/core';
|
||||
import { PlusIcon } from '@radix-ui/react-icons';
|
||||
import { Flex, Heading, Text } from '@radix-ui/themes';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { CompareTable } from '../../../components/Compare/CompareTable';
|
||||
import { Controls } from '../../../components/Compare/Controls';
|
||||
import { DamageWarning } from '../../../components/DamageWarning';
|
||||
import { PageWrapper } from '../../../components/PageWrapper';
|
||||
import { awaitableEquipmentDefinitions } from '../../../core/awaitables/equipmentDefinitions';
|
||||
import { awaitableModelDefinitions } from '../../../core/awaitables/modelDefinitions';
|
||||
import { awaitableProvisionDefinitions } from '../../../core/awaitables/provisionDefinitions';
|
||||
import { awaitableSkillDefinitions } from '../../../core/awaitables/skillDefinitions';
|
||||
import { awaitableTankDefinitions } from '../../../core/awaitables/tankDefinitions';
|
||||
import { tankCharacteristics } from '../../../core/blitzkit/tankCharacteristics';
|
||||
import { tankToCompareMember } from '../../../core/blitzkit/tankToCompareMember';
|
||||
import { App } from '../../../stores/app';
|
||||
import { CompareEphemeral } from '../../../stores/compareEphemeral';
|
||||
import { ComparePersistent } from '../../../stores/comparePersistent';
|
||||
import { TankopediaPersistent } from '../../../stores/tankopediaPersistent';
|
||||
import { CompareTable } from '../../../../components/Compare/CompareTable';
|
||||
import { Controls } from '../../../../components/Compare/Controls';
|
||||
import { DamageWarning } from '../../../../components/DamageWarning';
|
||||
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||
import { awaitableEquipmentDefinitions } from '../../../../core/awaitables/equipmentDefinitions';
|
||||
import { awaitableModelDefinitions } from '../../../../core/awaitables/modelDefinitions';
|
||||
import { awaitableProvisionDefinitions } from '../../../../core/awaitables/provisionDefinitions';
|
||||
import { awaitableSkillDefinitions } from '../../../../core/awaitables/skillDefinitions';
|
||||
import { awaitableTankDefinitions } from '../../../../core/awaitables/tankDefinitions';
|
||||
import { tankCharacteristics } from '../../../../core/blitzkit/tankCharacteristics';
|
||||
import { tankToCompareMember } from '../../../../core/blitzkit/tankToCompareMember';
|
||||
import { App } from '../../../../stores/app';
|
||||
import { CompareEphemeral } from '../../../../stores/compareEphemeral';
|
||||
import { ComparePersistent } from '../../../../stores/comparePersistent';
|
||||
import { TankopediaPersistent } from '../../../../stores/tankopediaPersistent';
|
||||
|
||||
const [
|
||||
modelDefinitions,
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
---
|
||||
import { compareTool } from '../../../../constants/tools';
|
||||
import ToolOpenGraph from '../../../components/ToolOpenGraph.astro';
|
||||
import { compareTool } from '../../../constants/tools';
|
||||
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
||||
import { Page } from './_index';
|
||||
---
|
||||
+19
-19
@@ -10,28 +10,28 @@ import {
|
||||
import { Box, Button, Flex, Heading, ScrollArea, Text } from '@radix-ui/themes';
|
||||
import { capitalize, startCase } from 'lodash-es';
|
||||
import { useEffect, useRef, useState, type ReactNode } from 'react';
|
||||
import { CopyButton } from '../../../../components/CopyButton';
|
||||
import { Boolean } from '../../../../components/Embeds/Boolean';
|
||||
import { Color } from '../../../../components/Embeds/Color';
|
||||
import { Enum } from '../../../../components/Embeds/Enum';
|
||||
import { GenerateURL } from '../../../../components/Embeds/GenerateURL';
|
||||
import { Import } from '../../../../components/Embeds/Import';
|
||||
import { PreviewWrapper } from '../../../../components/Embeds/PreviewWrapper';
|
||||
import { Radius } from '../../../../components/Embeds/Radius';
|
||||
import { RichText } from '../../../../components/Embeds/RichText';
|
||||
import { Size } from '../../../../components/Embeds/Size';
|
||||
import { SizeWithout0 } from '../../../../components/Embeds/SizeWithout0';
|
||||
import { Slider } from '../../../../components/Embeds/Slider';
|
||||
import { TextController } from '../../../../components/Embeds/TextController';
|
||||
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||
import { CopyButton } from '../../../../../components/CopyButton';
|
||||
import { Boolean } from '../../../../../components/Embeds/Boolean';
|
||||
import { Color } from '../../../../../components/Embeds/Color';
|
||||
import { Enum } from '../../../../../components/Embeds/Enum';
|
||||
import { GenerateURL } from '../../../../../components/Embeds/GenerateURL';
|
||||
import { Import } from '../../../../../components/Embeds/Import';
|
||||
import { PreviewWrapper } from '../../../../../components/Embeds/PreviewWrapper';
|
||||
import { Radius } from '../../../../../components/Embeds/Radius';
|
||||
import { RichText } from '../../../../../components/Embeds/RichText';
|
||||
import { Size } from '../../../../../components/Embeds/Size';
|
||||
import { SizeWithout0 } from '../../../../../components/Embeds/SizeWithout0';
|
||||
import { Slider } from '../../../../../components/Embeds/Slider';
|
||||
import { TextController } from '../../../../../components/Embeds/TextController';
|
||||
import { PageWrapper } from '../../../../../components/PageWrapper';
|
||||
import {
|
||||
embedConfigurations,
|
||||
extractEmbedConfigDefaults,
|
||||
} from '../../../../constants/embeds';
|
||||
import { NAVBAR_HEIGHT } from '../../../../constants/navbar';
|
||||
import { App } from '../../../../stores/app';
|
||||
import { EmbedState, type EmbedConfig } from '../../../../stores/embedState';
|
||||
import { EmbedItemType } from '../../../../stores/embedState/constants';
|
||||
} from '../../../../../constants/embeds';
|
||||
import { NAVBAR_HEIGHT } from '../../../../../constants/navbar';
|
||||
import { App } from '../../../../../stores/app';
|
||||
import { EmbedState, type EmbedConfig } from '../../../../../stores/embedState';
|
||||
import { EmbedItemType } from '../../../../../stores/embedState/constants';
|
||||
|
||||
export interface EmbedPreviewControllerProps {
|
||||
configKey: string;
|
||||
+4
-4
@@ -1,18 +1,18 @@
|
||||
import { Box } from '@radix-ui/themes';
|
||||
import { useMemo } from 'react';
|
||||
import { parse } from 'urlon';
|
||||
import { BlitzKitTheme } from '../../../../../components/BlitzKitTheme';
|
||||
import { BlitzKitTheme } from '../../../../../../components/BlitzKitTheme';
|
||||
import {
|
||||
embedConfigurations,
|
||||
embedRenderers,
|
||||
extractEmbedConfigDefaults,
|
||||
} from '../../../../../constants/embeds';
|
||||
} from '../../../../../../constants/embeds';
|
||||
import {
|
||||
EmbedState,
|
||||
type EmbedConfig,
|
||||
type ExtractEmbedConfigTypes,
|
||||
} from '../../../../../stores/embedState';
|
||||
import { useEmbedStateCurry } from '../../../../../stores/embedState/utilities';
|
||||
} from '../../../../../../stores/embedState';
|
||||
import { useEmbedStateCurry } from '../../../../../../stores/embedState/utilities';
|
||||
|
||||
interface PageProps {
|
||||
embed: keyof typeof embedConfigurations;
|
||||
File renamed without changes.
+1
-1
@@ -1,7 +1,7 @@
|
||||
---
|
||||
import type { GetStaticPaths } from 'astro';
|
||||
import { capitalize } from 'lodash-es';
|
||||
import { embedConfigurations } from '../../../../constants/embeds';
|
||||
import { embedConfigurations } from '../../../../../constants/embeds';
|
||||
import BaseLayout from '../../../../layouts/BaseLayout.astro';
|
||||
import { Page } from './_index';
|
||||
|
||||
+6
-6
@@ -1,15 +1,15 @@
|
||||
import { imgur, ImgurSize } from '@blitzkit/core';
|
||||
import { Box, Flex, Link, Text } from '@radix-ui/themes';
|
||||
import { capitalize } from 'lodash-es';
|
||||
import { PreviewWrapper } from '../../../components/Embeds/PreviewWrapper';
|
||||
import { PageWrapper } from '../../../components/PageWrapper';
|
||||
import { PreviewWrapper } from '../../../../components/Embeds/PreviewWrapper';
|
||||
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||
import {
|
||||
embedConfigurations,
|
||||
extractEmbedConfigDefaults,
|
||||
} from '../../../constants/embeds';
|
||||
import { Var } from '../../../core/radix/var';
|
||||
import { App } from '../../../stores/app';
|
||||
import { EmbedState } from '../../../stores/embedState';
|
||||
} from '../../../../constants/embeds';
|
||||
import { Var } from '../../../../core/radix/var';
|
||||
import { App } from '../../../../stores/app';
|
||||
import { EmbedState } from '../../../../stores/embedState';
|
||||
|
||||
export function Page() {
|
||||
return (
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
---
|
||||
import { embedTool } from '../../../constants/tools';
|
||||
import { embedTool } from '../../../../constants/tools';
|
||||
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
||||
import { Page } from './_index';
|
||||
---
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
import { CalendarIcon } from '@radix-ui/react-icons';
|
||||
import { Callout, Flex } from '@radix-ui/themes';
|
||||
import { GalleryList, type Avatar } from '../../../components/Gallery/List';
|
||||
import { GallerySearch } from '../../../components/Gallery/Search';
|
||||
import { PageWrapper } from '../../../components/PageWrapper';
|
||||
import { GalleryEphemeral } from '../../../stores/galleryEphemeral';
|
||||
import { GalleryList, type Avatar } from '../../../../components/Gallery/List';
|
||||
import { GallerySearch } from '../../../../components/Gallery/Search';
|
||||
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||
import { GalleryEphemeral } from '../../../../stores/galleryEphemeral';
|
||||
|
||||
interface PageProps {
|
||||
avatars: Avatar[];
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
---
|
||||
import type { Avatar } from '../../../components/Gallery/List';
|
||||
import { galleryTool } from '../../../constants/tools';
|
||||
import { fetchGlossary } from '../../../core/blitz/fetchGlossary';
|
||||
import type { Avatar } from '../../../../components/Gallery/List';
|
||||
import { galleryTool } from '../../../../constants/tools';
|
||||
import { fetchGlossary } from '../../../../core/blitz/fetchGlossary';
|
||||
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
||||
import { Page } from './_index';
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||
import { PerformanceInfo } from '../../../../components/Performance/PerformanceInfo';
|
||||
import { PlayerCountControl } from '../../../../components/Performance/PlayerCountControl';
|
||||
import { TankTable } from '../../../../components/Performance/Table';
|
||||
import { FilterControl } from '../../../../components/TankSearch/components/FilterControl';
|
||||
import { TankPerformanceEphemeral } from '../../../../stores/tankPerformanceEphemeral';
|
||||
import { TankPerformanceSort } from '../../../../stores/tankPerformanceSort';
|
||||
import type { MaybeSkeletonComponentProps } from '../../../../types/maybeSkeletonComponentProps';
|
||||
|
||||
export function Page({ skeleton }: MaybeSkeletonComponentProps) {
|
||||
return (
|
||||
<TankPerformanceSort.Provider>
|
||||
<TankPerformanceEphemeral.Provider>
|
||||
<Content skeleton={skeleton} />
|
||||
</TankPerformanceEphemeral.Provider>
|
||||
</TankPerformanceSort.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
function Content({ skeleton }: MaybeSkeletonComponentProps) {
|
||||
return (
|
||||
<PageWrapper color="jade" maxWidth="100%">
|
||||
<PerformanceInfo skeleton={skeleton} />
|
||||
<FilterControl />
|
||||
<PlayerCountControl />
|
||||
|
||||
<TankTable skeleton={skeleton} />
|
||||
</PageWrapper>
|
||||
);
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
---
|
||||
import { performanceTool } from '../../../../constants/tools';
|
||||
import ToolOpenGraph from '../../../components/ToolOpenGraph.astro';
|
||||
import { performanceTool } from '../../../constants/tools';
|
||||
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
||||
import { Page } from './_index';
|
||||
---
|
||||
+7
-7
@@ -33,13 +33,13 @@ import {
|
||||
} from '@radix-ui/themes';
|
||||
import { debounce } from 'lodash-es';
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { PageWrapper } from '../../../components/PageWrapper';
|
||||
import { StickyRowHeaderCell } from '../../../components/StickyRowHeaderCell';
|
||||
import { StickyTableRoot } from '../../../components/StickyTableRoot';
|
||||
import { TankRowHeaderCell } from '../../../components/TankRowHeaderCell';
|
||||
import { awaitableAverageDefinitions } from '../../../core/awaitables/averageDefinitions';
|
||||
import { awaitableTankDefinitions } from '../../../core/awaitables/tankDefinitions';
|
||||
import { Session, type SessionTracking } from '../../../stores/session';
|
||||
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||
import { StickyRowHeaderCell } from '../../../../components/StickyRowHeaderCell';
|
||||
import { StickyTableRoot } from '../../../../components/StickyTableRoot';
|
||||
import { TankRowHeaderCell } from '../../../../components/TankRowHeaderCell';
|
||||
import { awaitableAverageDefinitions } from '../../../../core/awaitables/averageDefinitions';
|
||||
import { awaitableTankDefinitions } from '../../../../core/awaitables/tankDefinitions';
|
||||
import { Session, type SessionTracking } from '../../../../stores/session';
|
||||
|
||||
const [tankDefinitions, averageDefinitions] = await Promise.all([
|
||||
awaitableTankDefinitions,
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
---
|
||||
import { sessionTool } from '../../../constants/tools';
|
||||
import { sessionTool } from '../../../../constants/tools';
|
||||
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
||||
import { Page } from './_index';
|
||||
---
|
||||
@@ -0,0 +1,61 @@
|
||||
import { TankType } from '@blitzkit/core';
|
||||
import { PageWrapper } from '../../../../../components/PageWrapper';
|
||||
import { CalloutsSection } from '../../../../../components/Tankopedia/CalloutsSection';
|
||||
import { CharacteristicsSection } from '../../../../../components/Tankopedia/CharacteristicsSection';
|
||||
import { GameModeSection } from '../../../../../components/Tankopedia/GameModeSection';
|
||||
import { HeroSection } from '../../../../../components/Tankopedia/HeroSection';
|
||||
import { HistorySection } from '../../../../../components/Tankopedia/HistorySection';
|
||||
import { MetaSection } from '../../../../../components/Tankopedia/MetaSection';
|
||||
import { TankopediaCharts } from '../../../../../components/Tankopedia/TankopediaCharts';
|
||||
import { TechTreeSection } from '../../../../../components/Tankopedia/TechTreeSection';
|
||||
import { VideoSection } from '../../../../../components/Tankopedia/VideoSection';
|
||||
import { awaitableModelDefinitions } from '../../../../../core/awaitables/modelDefinitions';
|
||||
import { awaitableProvisionDefinitions } from '../../../../../core/awaitables/provisionDefinitions';
|
||||
import { awaitableTankDefinitions } from '../../../../../core/awaitables/tankDefinitions';
|
||||
import { App } from '../../../../../stores/app';
|
||||
import { Duel } from '../../../../../stores/duel';
|
||||
import { TankopediaEphemeral } from '../../../../../stores/tankopediaEphemeral';
|
||||
import { TankopediaPersistent } from '../../../../../stores/tankopediaPersistent';
|
||||
import type { MaybeSkeletonComponentProps } from '../../../../../types/maybeSkeletonComponentProps';
|
||||
|
||||
type PageProps = MaybeSkeletonComponentProps & {
|
||||
id: number;
|
||||
};
|
||||
|
||||
const [tankDefinitions, provisionDefinitions, modelDefinitions] =
|
||||
await Promise.all([
|
||||
awaitableTankDefinitions,
|
||||
awaitableProvisionDefinitions,
|
||||
awaitableModelDefinitions,
|
||||
]);
|
||||
|
||||
export function Page({ id, skeleton }: PageProps) {
|
||||
const tank = tankDefinitions.tanks[id];
|
||||
const model = modelDefinitions.models[id];
|
||||
|
||||
return (
|
||||
<TankopediaEphemeral.Provider data={model}>
|
||||
<App.Provider>
|
||||
<TankopediaPersistent.Provider>
|
||||
<Duel.Provider
|
||||
data={{ tank, provisionDefinitions: provisionDefinitions }}
|
||||
>
|
||||
<PageWrapper p="0" maxWidth="unset" color="purple" gap="9" pb="9">
|
||||
<HeroSection skeleton={skeleton} />
|
||||
<CalloutsSection />
|
||||
<MetaSection />
|
||||
{tank.type === TankType.RESEARCHABLE && !tank.deprecated && (
|
||||
<TechTreeSection skeleton={skeleton} />
|
||||
)}
|
||||
<CharacteristicsSection />
|
||||
<GameModeSection />
|
||||
<TankopediaCharts />
|
||||
<VideoSection skeleton={skeleton} />
|
||||
<HistorySection />
|
||||
</PageWrapper>
|
||||
</Duel.Provider>
|
||||
</TankopediaPersistent.Provider>
|
||||
</App.Provider>
|
||||
</TankopediaEphemeral.Provider>
|
||||
);
|
||||
}
|
||||
+2
-2
@@ -12,9 +12,9 @@ import {
|
||||
} from '@blitzkit/core';
|
||||
import strings from '@blitzkit/core/lang/en-US.json';
|
||||
import type { GetStaticPaths } from 'astro';
|
||||
import { tankCharacteristics } from '../../../../core/blitzkit/tankCharacteristics';
|
||||
import { tankCharacteristics } from '../../../../../core/blitzkit/tankCharacteristics';
|
||||
import BaseLayout from '../../../../layouts/BaseLayout.astro';
|
||||
import { genericDefaultEquipmentMatrix } from '../../../../stores/duel/constants';
|
||||
import { genericDefaultEquipmentMatrix } from '../../../../../stores/duel/constants';
|
||||
import { Page } from './_index';
|
||||
|
||||
export const getStaticPaths = (async () => {
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
import { PageWrapper } from '../../../components/PageWrapper';
|
||||
import { TankSearch } from '../../../components/TankSearch';
|
||||
import { App } from '../../../stores/app';
|
||||
import { TankopediaPersistent } from '../../../stores/tankopediaPersistent';
|
||||
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||
import { TankSearch } from '../../../../components/TankSearch';
|
||||
import { App } from '../../../../stores/app';
|
||||
import { TankopediaPersistent } from '../../../../stores/tankopediaPersistent';
|
||||
|
||||
export function Page() {
|
||||
return (
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
---
|
||||
import { tankopediaTool } from '../../../constants/tools';
|
||||
import { tankopediaTool } from '../../../../constants/tools';
|
||||
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
||||
import { Page } from './_index';
|
||||
---
|
||||
@@ -0,0 +1,30 @@
|
||||
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 { TankopediaPersistent } from '../../../../stores/tankopediaPersistent';
|
||||
import { TierList } from '../../../../stores/tierList';
|
||||
|
||||
export function Page() {
|
||||
return (
|
||||
<TierList.Provider>
|
||||
<TankopediaPersistent.Provider>
|
||||
<Content />
|
||||
</TankopediaPersistent.Provider>
|
||||
</TierList.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
function Content() {
|
||||
return (
|
||||
<PageWrapper color="orange" maxWidth="100rem">
|
||||
<URLManager />
|
||||
<TierListControls />
|
||||
<TierListTable />
|
||||
<FilterControl />
|
||||
<TierListTiles />
|
||||
</PageWrapper>
|
||||
);
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
---
|
||||
import { tierListTool } from '../../../constants/tools';
|
||||
import { tierListTool } from '../../../../constants/tools';
|
||||
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
||||
import { Page } from './_index';
|
||||
---
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
import { assertSecret } from '@blitzkit/core';
|
||||
import type { GetStaticPaths } from 'astro';
|
||||
import { getStaticPaths as tankopediaGetStaticPaths } from '../../../../tools/tankopedia/[id]/index.astro';
|
||||
import { getStaticPaths as tankopediaGetStaticPaths } from '../../../../[...locale]/tools/tankopedia/[id]/index.astro';
|
||||
import { Page } from './_index';
|
||||
|
||||
export const getStaticPaths = (async () => {
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
import { PageWrapper } from '../../../components/PageWrapper';
|
||||
import { PerformanceInfo } from '../../../components/Performance/PerformanceInfo';
|
||||
import { PlayerCountControl } from '../../../components/Performance/PlayerCountControl';
|
||||
import { TankTable } from '../../../components/Performance/Table';
|
||||
import { FilterControl } from '../../../components/TankSearch/components/FilterControl';
|
||||
import { TankPerformanceEphemeral } from '../../../stores/tankPerformanceEphemeral';
|
||||
import { TankPerformanceSort } from '../../../stores/tankPerformanceSort';
|
||||
import type { MaybeSkeletonComponentProps } from '../../../types/maybeSkeletonComponentProps';
|
||||
|
||||
export function Page({ skeleton }: MaybeSkeletonComponentProps) {
|
||||
return (
|
||||
<TankPerformanceSort.Provider>
|
||||
<TankPerformanceEphemeral.Provider>
|
||||
<Content skeleton={skeleton} />
|
||||
</TankPerformanceEphemeral.Provider>
|
||||
</TankPerformanceSort.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
function Content({ skeleton }: MaybeSkeletonComponentProps) {
|
||||
return (
|
||||
<PageWrapper color="jade" maxWidth="100%">
|
||||
<PerformanceInfo skeleton={skeleton} />
|
||||
<FilterControl />
|
||||
<PlayerCountControl />
|
||||
|
||||
<TankTable skeleton={skeleton} />
|
||||
</PageWrapper>
|
||||
);
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
import { TankType } from '@blitzkit/core';
|
||||
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||
import { CalloutsSection } from '../../../../components/Tankopedia/CalloutsSection';
|
||||
import { CharacteristicsSection } from '../../../../components/Tankopedia/CharacteristicsSection';
|
||||
import { GameModeSection } from '../../../../components/Tankopedia/GameModeSection';
|
||||
import { HeroSection } from '../../../../components/Tankopedia/HeroSection';
|
||||
import { HistorySection } from '../../../../components/Tankopedia/HistorySection';
|
||||
import { MetaSection } from '../../../../components/Tankopedia/MetaSection';
|
||||
import { TankopediaCharts } from '../../../../components/Tankopedia/TankopediaCharts';
|
||||
import { TechTreeSection } from '../../../../components/Tankopedia/TechTreeSection';
|
||||
import { VideoSection } from '../../../../components/Tankopedia/VideoSection';
|
||||
import { awaitableModelDefinitions } from '../../../../core/awaitables/modelDefinitions';
|
||||
import { awaitableProvisionDefinitions } from '../../../../core/awaitables/provisionDefinitions';
|
||||
import { awaitableTankDefinitions } from '../../../../core/awaitables/tankDefinitions';
|
||||
import { App } from '../../../../stores/app';
|
||||
import { Duel } from '../../../../stores/duel';
|
||||
import { TankopediaEphemeral } from '../../../../stores/tankopediaEphemeral';
|
||||
import { TankopediaPersistent } from '../../../../stores/tankopediaPersistent';
|
||||
import type { MaybeSkeletonComponentProps } from '../../../../types/maybeSkeletonComponentProps';
|
||||
|
||||
type PageProps = MaybeSkeletonComponentProps & {
|
||||
id: number;
|
||||
};
|
||||
|
||||
const [tankDefinitions, provisionDefinitions, modelDefinitions] =
|
||||
await Promise.all([
|
||||
awaitableTankDefinitions,
|
||||
awaitableProvisionDefinitions,
|
||||
awaitableModelDefinitions,
|
||||
]);
|
||||
|
||||
export function Page({ id, skeleton }: PageProps) {
|
||||
const tank = tankDefinitions.tanks[id];
|
||||
const model = modelDefinitions.models[id];
|
||||
|
||||
return (
|
||||
<TankopediaEphemeral.Provider data={model}>
|
||||
<App.Provider>
|
||||
<TankopediaPersistent.Provider>
|
||||
<Duel.Provider
|
||||
data={{ tank, provisionDefinitions: provisionDefinitions }}
|
||||
>
|
||||
<PageWrapper p="0" maxWidth="unset" color="purple" gap="9" pb="9">
|
||||
<HeroSection skeleton={skeleton} />
|
||||
<CalloutsSection />
|
||||
<MetaSection />
|
||||
{tank.type === TankType.RESEARCHABLE && !tank.deprecated && (
|
||||
<TechTreeSection skeleton={skeleton} />
|
||||
)}
|
||||
<CharacteristicsSection />
|
||||
<GameModeSection />
|
||||
<TankopediaCharts />
|
||||
<VideoSection skeleton={skeleton} />
|
||||
<HistorySection />
|
||||
</PageWrapper>
|
||||
</Duel.Provider>
|
||||
</TankopediaPersistent.Provider>
|
||||
</App.Provider>
|
||||
</TankopediaEphemeral.Provider>
|
||||
);
|
||||
}
|
||||
@@ -1,30 +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 { TankopediaPersistent } from '../../../stores/tankopediaPersistent';
|
||||
import { TierList } from '../../../stores/tierList';
|
||||
|
||||
export function Page() {
|
||||
return (
|
||||
<TierList.Provider>
|
||||
<TankopediaPersistent.Provider>
|
||||
<Content />
|
||||
</TankopediaPersistent.Provider>
|
||||
</TierList.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
function Content() {
|
||||
return (
|
||||
<PageWrapper color="orange" maxWidth="100rem">
|
||||
<URLManager />
|
||||
<TierListControls />
|
||||
<TierListTable />
|
||||
<FilterControl />
|
||||
<TierListTiles />
|
||||
</PageWrapper>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user