mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +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: {
|
i18n: {
|
||||||
defaultLocale: 'en',
|
defaultLocale: 'en',
|
||||||
locales: SUPPORTED_LOCALES,
|
locales: SUPPORTED_LOCALES,
|
||||||
|
routing: {
|
||||||
|
prefixDefaultLocale: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
devToolbar: { enabled: false },
|
devToolbar: { enabled: false },
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Switch } from '@radix-ui/themes';
|
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';
|
import { EmbedState } from '../../stores/embedState';
|
||||||
|
|
||||||
export function Boolean({ configKey }: EmbedPreviewControllerProps) {
|
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 { EmbedState } from '../../stores/embedState';
|
||||||
import { ColorControllerRaw } from './ColorControllerRaw';
|
import { ColorControllerRaw } from './ColorControllerRaw';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Select } from '@radix-ui/themes';
|
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 { EmbedState } from '../../stores/embedState';
|
||||||
import type {
|
import type {
|
||||||
EmbedConfigItemType,
|
EmbedConfigItemType,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Slider } from '@radix-ui/themes';
|
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';
|
import { EmbedState, type RadixRadius } from '../../stores/embedState';
|
||||||
|
|
||||||
export function Radius({ configKey }: EmbedPreviewControllerProps) {
|
export function Radius({ configKey }: EmbedPreviewControllerProps) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { FontBoldIcon, FontSizeIcon } from '@radix-ui/react-icons';
|
import { FontBoldIcon, FontSizeIcon } from '@radix-ui/react-icons';
|
||||||
import { Flex, Slider, Text } from '@radix-ui/themes';
|
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 { EmbedState, type RadixSizeWithout0 } from '../../stores/embedState';
|
||||||
import {
|
import {
|
||||||
radixTextWeights,
|
radixTextWeights,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Slider } from '@radix-ui/themes';
|
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';
|
import { EmbedState, type RadixSize } from '../../stores/embedState';
|
||||||
|
|
||||||
export function Size({ configKey }: EmbedPreviewControllerProps) {
|
export function Size({ configKey }: EmbedPreviewControllerProps) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Slider } from '@radix-ui/themes';
|
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';
|
import { EmbedState, type RadixSizeWithout0 } from '../../stores/embedState';
|
||||||
|
|
||||||
export function SizeWithout0({ configKey }: EmbedPreviewControllerProps) {
|
export function SizeWithout0({ configKey }: EmbedPreviewControllerProps) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Slider as RadixSlider } from '@radix-ui/themes';
|
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 { EmbedState, type RadixSize } from '../../stores/embedState';
|
||||||
import type {
|
import type {
|
||||||
EmbedConfigItemType,
|
EmbedConfigItemType,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { TextField } from '@radix-ui/themes';
|
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';
|
import { EmbedState } from '../../stores/embedState';
|
||||||
|
|
||||||
export function TextController({ configKey }: EmbedPreviewControllerProps) {
|
export function TextController({ configKey }: EmbedPreviewControllerProps) {
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { App } from '../../../stores/app';
|
import { App } from '../../../../stores/app';
|
||||||
|
|
||||||
export const AUTH_PROVIDERS = ['wargaming'] as const;
|
export const AUTH_PROVIDERS = ['wargaming'] as const;
|
||||||
|
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
import { Flex, Heading, Text } from '@radix-ui/themes';
|
import { Flex, Heading, Text } from '@radix-ui/themes';
|
||||||
import type { GetStaticPaths } from 'astro';
|
import type { GetStaticPaths } from 'astro';
|
||||||
import { PageWrapper } from '../../../components/PageWrapper';
|
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||||
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
||||||
import { AUTH_PROVIDERS, AUTH_PROVIDER_NAMES, Authorize } from './_index';
|
import { AUTH_PROVIDERS, AUTH_PROVIDER_NAMES, Authorize } from './_index';
|
||||||
|
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
import { Markdown } from '../../../../components/Markdown';
|
import { Markdown } from '../../../../../components/Markdown';
|
||||||
import { PageWrapper } from '../../../../components/PageWrapper';
|
import { PageWrapper } from '../../../../../components/PageWrapper';
|
||||||
|
|
||||||
interface PageProps {
|
interface PageProps {
|
||||||
content: string;
|
content: string;
|
||||||
File renamed without changes.
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
import { MagicWandIcon, StarFilledIcon } from '@radix-ui/react-icons';
|
import { MagicWandIcon, StarFilledIcon } from '@radix-ui/react-icons';
|
||||||
import { Flex, Heading, Link } from '@radix-ui/themes';
|
import { Flex, Heading, Link } from '@radix-ui/themes';
|
||||||
import { compareVersions } from 'compare-versions';
|
import { compareVersions } from 'compare-versions';
|
||||||
import { PageWrapper } from '../../../components/PageWrapper';
|
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||||
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
||||||
|
|
||||||
// this can't be used in template literal :(
|
// 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 { Box, Flex, Heading } from '@radix-ui/themes';
|
||||||
import { AesonPlug } from '../components/AesonPlug';
|
import type { GetStaticPaths } from 'astro';
|
||||||
import HomeHero from '../components/HomeHero.astro';
|
import { AesonPlug } from '../../components/AesonPlug';
|
||||||
import { HomePageHotTanks } from '../components/HomePageHotTanks';
|
import HomeHero from '../../components/HomeHero.astro';
|
||||||
import { Plugs } from '../components/Plugs.tsx';
|
import { HomePageHotTanks } from '../../components/HomePageHotTanks';
|
||||||
import ToolCard from '../components/ToolCard.astro';
|
import { Plugs } from '../../components/Plugs';
|
||||||
|
import ToolCard from '../../components/ToolCard.astro';
|
||||||
import {
|
import {
|
||||||
compareTool,
|
compareTool,
|
||||||
discordTool,
|
discordTool,
|
||||||
@@ -16,10 +17,17 @@ import {
|
|||||||
sessionTool,
|
sessionTool,
|
||||||
tankopediaTool,
|
tankopediaTool,
|
||||||
tierListTool,
|
tierListTool,
|
||||||
} from '../constants/tools';
|
} from '../../constants/tools';
|
||||||
import BaseLayout from '../layouts/BaseLayout.astro';
|
import BaseLayout from '../../layouts/BaseLayout.astro';
|
||||||
|
|
||||||
const branch = assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH);
|
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>
|
<BaseLayout>
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
import { Flex, Heading, Switch, Text } from '@radix-ui/themes';
|
import { Flex, Heading, Switch, Text } from '@radix-ui/themes';
|
||||||
import { PageWrapper } from '../../components/PageWrapper';
|
import { PageWrapper } from '../../../components/PageWrapper';
|
||||||
import { App } from '../../stores/app';
|
import { App } from '../../../stores/app';
|
||||||
|
|
||||||
export function Page() {
|
export function Page() {
|
||||||
return (
|
return (
|
||||||
File renamed without changes.
+5
-5
@@ -1,9 +1,9 @@
|
|||||||
import { Flex } from '@radix-ui/themes';
|
import { Flex } from '@radix-ui/themes';
|
||||||
import { ChartsControl } from '../../../components/Charts/ChartsControl';
|
import { ChartsControl } from '../../../../components/Charts/ChartsControl';
|
||||||
import { PlayersInPeriod } from '../../../components/Charts/PlayersInPeriod';
|
import { PlayersInPeriod } from '../../../../components/Charts/PlayersInPeriod';
|
||||||
import { PageWrapper } from '../../../components/PageWrapper';
|
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||||
import { FilterControl } from '../../../components/TankSearch/components/FilterControl';
|
import { FilterControl } from '../../../../components/TankSearch/components/FilterControl';
|
||||||
import { Charts } from '../../../stores/charts';
|
import { Charts } from '../../../../stores/charts';
|
||||||
|
|
||||||
export function Page() {
|
export function Page() {
|
||||||
return (
|
return (
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
import { chartsTool } from '../../../constants/tools';
|
import { chartsTool } from '../../../../constants/tools';
|
||||||
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
||||||
import { Page } from './_index';
|
import { Page } from './_index';
|
||||||
---
|
---
|
||||||
+15
-15
@@ -2,21 +2,21 @@ import { createDefaultSkills } from '@blitzkit/core';
|
|||||||
import { PlusIcon } from '@radix-ui/react-icons';
|
import { PlusIcon } from '@radix-ui/react-icons';
|
||||||
import { Flex, Heading, Text } from '@radix-ui/themes';
|
import { Flex, Heading, Text } from '@radix-ui/themes';
|
||||||
import { useEffect, useMemo, useState } from 'react';
|
import { useEffect, useMemo, useState } from 'react';
|
||||||
import { CompareTable } from '../../../components/Compare/CompareTable';
|
import { CompareTable } from '../../../../components/Compare/CompareTable';
|
||||||
import { Controls } from '../../../components/Compare/Controls';
|
import { Controls } from '../../../../components/Compare/Controls';
|
||||||
import { DamageWarning } from '../../../components/DamageWarning';
|
import { DamageWarning } from '../../../../components/DamageWarning';
|
||||||
import { PageWrapper } from '../../../components/PageWrapper';
|
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||||
import { awaitableEquipmentDefinitions } from '../../../core/awaitables/equipmentDefinitions';
|
import { awaitableEquipmentDefinitions } from '../../../../core/awaitables/equipmentDefinitions';
|
||||||
import { awaitableModelDefinitions } from '../../../core/awaitables/modelDefinitions';
|
import { awaitableModelDefinitions } from '../../../../core/awaitables/modelDefinitions';
|
||||||
import { awaitableProvisionDefinitions } from '../../../core/awaitables/provisionDefinitions';
|
import { awaitableProvisionDefinitions } from '../../../../core/awaitables/provisionDefinitions';
|
||||||
import { awaitableSkillDefinitions } from '../../../core/awaitables/skillDefinitions';
|
import { awaitableSkillDefinitions } from '../../../../core/awaitables/skillDefinitions';
|
||||||
import { awaitableTankDefinitions } from '../../../core/awaitables/tankDefinitions';
|
import { awaitableTankDefinitions } from '../../../../core/awaitables/tankDefinitions';
|
||||||
import { tankCharacteristics } from '../../../core/blitzkit/tankCharacteristics';
|
import { tankCharacteristics } from '../../../../core/blitzkit/tankCharacteristics';
|
||||||
import { tankToCompareMember } from '../../../core/blitzkit/tankToCompareMember';
|
import { tankToCompareMember } from '../../../../core/blitzkit/tankToCompareMember';
|
||||||
import { App } from '../../../stores/app';
|
import { App } from '../../../../stores/app';
|
||||||
import { CompareEphemeral } from '../../../stores/compareEphemeral';
|
import { CompareEphemeral } from '../../../../stores/compareEphemeral';
|
||||||
import { ComparePersistent } from '../../../stores/comparePersistent';
|
import { ComparePersistent } from '../../../../stores/comparePersistent';
|
||||||
import { TankopediaPersistent } from '../../../stores/tankopediaPersistent';
|
import { TankopediaPersistent } from '../../../../stores/tankopediaPersistent';
|
||||||
|
|
||||||
const [
|
const [
|
||||||
modelDefinitions,
|
modelDefinitions,
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
|
import { compareTool } from '../../../../constants/tools';
|
||||||
import ToolOpenGraph from '../../../components/ToolOpenGraph.astro';
|
import ToolOpenGraph from '../../../components/ToolOpenGraph.astro';
|
||||||
import { compareTool } from '../../../constants/tools';
|
|
||||||
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
||||||
import { Page } from './_index';
|
import { Page } from './_index';
|
||||||
---
|
---
|
||||||
+19
-19
@@ -10,28 +10,28 @@ import {
|
|||||||
import { Box, Button, Flex, Heading, ScrollArea, Text } from '@radix-ui/themes';
|
import { Box, Button, Flex, Heading, ScrollArea, Text } from '@radix-ui/themes';
|
||||||
import { capitalize, startCase } from 'lodash-es';
|
import { capitalize, startCase } from 'lodash-es';
|
||||||
import { useEffect, useRef, useState, type ReactNode } from 'react';
|
import { useEffect, useRef, useState, type ReactNode } from 'react';
|
||||||
import { CopyButton } from '../../../../components/CopyButton';
|
import { CopyButton } from '../../../../../components/CopyButton';
|
||||||
import { Boolean } from '../../../../components/Embeds/Boolean';
|
import { Boolean } from '../../../../../components/Embeds/Boolean';
|
||||||
import { Color } from '../../../../components/Embeds/Color';
|
import { Color } from '../../../../../components/Embeds/Color';
|
||||||
import { Enum } from '../../../../components/Embeds/Enum';
|
import { Enum } from '../../../../../components/Embeds/Enum';
|
||||||
import { GenerateURL } from '../../../../components/Embeds/GenerateURL';
|
import { GenerateURL } from '../../../../../components/Embeds/GenerateURL';
|
||||||
import { Import } from '../../../../components/Embeds/Import';
|
import { Import } from '../../../../../components/Embeds/Import';
|
||||||
import { PreviewWrapper } from '../../../../components/Embeds/PreviewWrapper';
|
import { PreviewWrapper } from '../../../../../components/Embeds/PreviewWrapper';
|
||||||
import { Radius } from '../../../../components/Embeds/Radius';
|
import { Radius } from '../../../../../components/Embeds/Radius';
|
||||||
import { RichText } from '../../../../components/Embeds/RichText';
|
import { RichText } from '../../../../../components/Embeds/RichText';
|
||||||
import { Size } from '../../../../components/Embeds/Size';
|
import { Size } from '../../../../../components/Embeds/Size';
|
||||||
import { SizeWithout0 } from '../../../../components/Embeds/SizeWithout0';
|
import { SizeWithout0 } from '../../../../../components/Embeds/SizeWithout0';
|
||||||
import { Slider } from '../../../../components/Embeds/Slider';
|
import { Slider } from '../../../../../components/Embeds/Slider';
|
||||||
import { TextController } from '../../../../components/Embeds/TextController';
|
import { TextController } from '../../../../../components/Embeds/TextController';
|
||||||
import { PageWrapper } from '../../../../components/PageWrapper';
|
import { PageWrapper } from '../../../../../components/PageWrapper';
|
||||||
import {
|
import {
|
||||||
embedConfigurations,
|
embedConfigurations,
|
||||||
extractEmbedConfigDefaults,
|
extractEmbedConfigDefaults,
|
||||||
} from '../../../../constants/embeds';
|
} from '../../../../../constants/embeds';
|
||||||
import { NAVBAR_HEIGHT } from '../../../../constants/navbar';
|
import { NAVBAR_HEIGHT } from '../../../../../constants/navbar';
|
||||||
import { App } from '../../../../stores/app';
|
import { App } from '../../../../../stores/app';
|
||||||
import { EmbedState, type EmbedConfig } from '../../../../stores/embedState';
|
import { EmbedState, type EmbedConfig } from '../../../../../stores/embedState';
|
||||||
import { EmbedItemType } from '../../../../stores/embedState/constants';
|
import { EmbedItemType } from '../../../../../stores/embedState/constants';
|
||||||
|
|
||||||
export interface EmbedPreviewControllerProps {
|
export interface EmbedPreviewControllerProps {
|
||||||
configKey: string;
|
configKey: string;
|
||||||
+4
-4
@@ -1,18 +1,18 @@
|
|||||||
import { Box } from '@radix-ui/themes';
|
import { Box } from '@radix-ui/themes';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { parse } from 'urlon';
|
import { parse } from 'urlon';
|
||||||
import { BlitzKitTheme } from '../../../../../components/BlitzKitTheme';
|
import { BlitzKitTheme } from '../../../../../../components/BlitzKitTheme';
|
||||||
import {
|
import {
|
||||||
embedConfigurations,
|
embedConfigurations,
|
||||||
embedRenderers,
|
embedRenderers,
|
||||||
extractEmbedConfigDefaults,
|
extractEmbedConfigDefaults,
|
||||||
} from '../../../../../constants/embeds';
|
} from '../../../../../../constants/embeds';
|
||||||
import {
|
import {
|
||||||
EmbedState,
|
EmbedState,
|
||||||
type EmbedConfig,
|
type EmbedConfig,
|
||||||
type ExtractEmbedConfigTypes,
|
type ExtractEmbedConfigTypes,
|
||||||
} from '../../../../../stores/embedState';
|
} from '../../../../../../stores/embedState';
|
||||||
import { useEmbedStateCurry } from '../../../../../stores/embedState/utilities';
|
import { useEmbedStateCurry } from '../../../../../../stores/embedState/utilities';
|
||||||
|
|
||||||
interface PageProps {
|
interface PageProps {
|
||||||
embed: keyof typeof embedConfigurations;
|
embed: keyof typeof embedConfigurations;
|
||||||
File renamed without changes.
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
import type { GetStaticPaths } from 'astro';
|
import type { GetStaticPaths } from 'astro';
|
||||||
import { capitalize } from 'lodash-es';
|
import { capitalize } from 'lodash-es';
|
||||||
import { embedConfigurations } from '../../../../constants/embeds';
|
import { embedConfigurations } from '../../../../../constants/embeds';
|
||||||
import BaseLayout from '../../../../layouts/BaseLayout.astro';
|
import BaseLayout from '../../../../layouts/BaseLayout.astro';
|
||||||
import { Page } from './_index';
|
import { Page } from './_index';
|
||||||
|
|
||||||
+6
-6
@@ -1,15 +1,15 @@
|
|||||||
import { imgur, ImgurSize } from '@blitzkit/core';
|
import { imgur, ImgurSize } from '@blitzkit/core';
|
||||||
import { Box, Flex, Link, Text } from '@radix-ui/themes';
|
import { Box, Flex, Link, Text } from '@radix-ui/themes';
|
||||||
import { capitalize } from 'lodash-es';
|
import { capitalize } from 'lodash-es';
|
||||||
import { PreviewWrapper } from '../../../components/Embeds/PreviewWrapper';
|
import { PreviewWrapper } from '../../../../components/Embeds/PreviewWrapper';
|
||||||
import { PageWrapper } from '../../../components/PageWrapper';
|
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||||
import {
|
import {
|
||||||
embedConfigurations,
|
embedConfigurations,
|
||||||
extractEmbedConfigDefaults,
|
extractEmbedConfigDefaults,
|
||||||
} from '../../../constants/embeds';
|
} from '../../../../constants/embeds';
|
||||||
import { Var } from '../../../core/radix/var';
|
import { Var } from '../../../../core/radix/var';
|
||||||
import { App } from '../../../stores/app';
|
import { App } from '../../../../stores/app';
|
||||||
import { EmbedState } from '../../../stores/embedState';
|
import { EmbedState } from '../../../../stores/embedState';
|
||||||
|
|
||||||
export function Page() {
|
export function Page() {
|
||||||
return (
|
return (
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
import { embedTool } from '../../../constants/tools';
|
import { embedTool } from '../../../../constants/tools';
|
||||||
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
||||||
import { Page } from './_index';
|
import { Page } from './_index';
|
||||||
---
|
---
|
||||||
+4
-4
@@ -1,9 +1,9 @@
|
|||||||
import { CalendarIcon } from '@radix-ui/react-icons';
|
import { CalendarIcon } from '@radix-ui/react-icons';
|
||||||
import { Callout, Flex } from '@radix-ui/themes';
|
import { Callout, Flex } from '@radix-ui/themes';
|
||||||
import { GalleryList, type Avatar } from '../../../components/Gallery/List';
|
import { GalleryList, type Avatar } from '../../../../components/Gallery/List';
|
||||||
import { GallerySearch } from '../../../components/Gallery/Search';
|
import { GallerySearch } from '../../../../components/Gallery/Search';
|
||||||
import { PageWrapper } from '../../../components/PageWrapper';
|
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||||
import { GalleryEphemeral } from '../../../stores/galleryEphemeral';
|
import { GalleryEphemeral } from '../../../../stores/galleryEphemeral';
|
||||||
|
|
||||||
interface PageProps {
|
interface PageProps {
|
||||||
avatars: Avatar[];
|
avatars: Avatar[];
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
import type { Avatar } from '../../../components/Gallery/List';
|
import type { Avatar } from '../../../../components/Gallery/List';
|
||||||
import { galleryTool } from '../../../constants/tools';
|
import { galleryTool } from '../../../../constants/tools';
|
||||||
import { fetchGlossary } from '../../../core/blitz/fetchGlossary';
|
import { fetchGlossary } from '../../../../core/blitz/fetchGlossary';
|
||||||
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
||||||
import { Page } from './_index';
|
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 ToolOpenGraph from '../../../components/ToolOpenGraph.astro';
|
||||||
import { performanceTool } from '../../../constants/tools';
|
|
||||||
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
||||||
import { Page } from './_index';
|
import { Page } from './_index';
|
||||||
---
|
---
|
||||||
+7
-7
@@ -33,13 +33,13 @@ import {
|
|||||||
} from '@radix-ui/themes';
|
} from '@radix-ui/themes';
|
||||||
import { debounce } from 'lodash-es';
|
import { debounce } from 'lodash-es';
|
||||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||||
import { PageWrapper } from '../../../components/PageWrapper';
|
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||||
import { StickyRowHeaderCell } from '../../../components/StickyRowHeaderCell';
|
import { StickyRowHeaderCell } from '../../../../components/StickyRowHeaderCell';
|
||||||
import { StickyTableRoot } from '../../../components/StickyTableRoot';
|
import { StickyTableRoot } from '../../../../components/StickyTableRoot';
|
||||||
import { TankRowHeaderCell } from '../../../components/TankRowHeaderCell';
|
import { TankRowHeaderCell } from '../../../../components/TankRowHeaderCell';
|
||||||
import { awaitableAverageDefinitions } from '../../../core/awaitables/averageDefinitions';
|
import { awaitableAverageDefinitions } from '../../../../core/awaitables/averageDefinitions';
|
||||||
import { awaitableTankDefinitions } from '../../../core/awaitables/tankDefinitions';
|
import { awaitableTankDefinitions } from '../../../../core/awaitables/tankDefinitions';
|
||||||
import { Session, type SessionTracking } from '../../../stores/session';
|
import { Session, type SessionTracking } from '../../../../stores/session';
|
||||||
|
|
||||||
const [tankDefinitions, averageDefinitions] = await Promise.all([
|
const [tankDefinitions, averageDefinitions] = await Promise.all([
|
||||||
awaitableTankDefinitions,
|
awaitableTankDefinitions,
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
import { sessionTool } from '../../../constants/tools';
|
import { sessionTool } from '../../../../constants/tools';
|
||||||
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
||||||
import { Page } from './_index';
|
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';
|
} from '@blitzkit/core';
|
||||||
import strings from '@blitzkit/core/lang/en-US.json';
|
import strings from '@blitzkit/core/lang/en-US.json';
|
||||||
import type { GetStaticPaths } from 'astro';
|
import type { GetStaticPaths } from 'astro';
|
||||||
import { tankCharacteristics } from '../../../../core/blitzkit/tankCharacteristics';
|
import { tankCharacteristics } from '../../../../../core/blitzkit/tankCharacteristics';
|
||||||
import BaseLayout from '../../../../layouts/BaseLayout.astro';
|
import BaseLayout from '../../../../layouts/BaseLayout.astro';
|
||||||
import { genericDefaultEquipmentMatrix } from '../../../../stores/duel/constants';
|
import { genericDefaultEquipmentMatrix } from '../../../../../stores/duel/constants';
|
||||||
import { Page } from './_index';
|
import { Page } from './_index';
|
||||||
|
|
||||||
export const getStaticPaths = (async () => {
|
export const getStaticPaths = (async () => {
|
||||||
+4
-4
@@ -1,7 +1,7 @@
|
|||||||
import { PageWrapper } from '../../../components/PageWrapper';
|
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||||
import { TankSearch } from '../../../components/TankSearch';
|
import { TankSearch } from '../../../../components/TankSearch';
|
||||||
import { App } from '../../../stores/app';
|
import { App } from '../../../../stores/app';
|
||||||
import { TankopediaPersistent } from '../../../stores/tankopediaPersistent';
|
import { TankopediaPersistent } from '../../../../stores/tankopediaPersistent';
|
||||||
|
|
||||||
export function Page() {
|
export function Page() {
|
||||||
return (
|
return (
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
import { tankopediaTool } from '../../../constants/tools';
|
import { tankopediaTool } from '../../../../constants/tools';
|
||||||
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
||||||
import { Page } from './_index';
|
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 ToolLayout from '../../../layouts/ToolLayout.astro';
|
||||||
import { Page } from './_index';
|
import { Page } from './_index';
|
||||||
---
|
---
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
import { assertSecret } from '@blitzkit/core';
|
import { assertSecret } from '@blitzkit/core';
|
||||||
import type { GetStaticPaths } from 'astro';
|
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';
|
import { Page } from './_index';
|
||||||
|
|
||||||
export const getStaticPaths = (async () => {
|
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