diff --git a/packages/i18n/strings/en.json b/packages/i18n/strings/en.json index 22b4087e0..fb3901668 100644 --- a/packages/i18n/strings/en.json +++ b/packages/i18n/strings/en.json @@ -1445,6 +1445,12 @@ "button": "Get started", "description": "Get started with BlitzKit", "seo_description": "Get started with BlitzKit" + }, + "api": { + "name": "API", + "button": "To the docs", + "description": "BlitzKit hosted API", + "seo_description": "BlitzKit hosted static API for World of Tanks Blitz" } }, diff --git a/packages/website/public/assets/images/tools/api.webp b/packages/website/public/assets/images/tools/api.webp new file mode 100644 index 000000000..ba72cd100 Binary files /dev/null and b/packages/website/public/assets/images/tools/api.webp differ diff --git a/packages/website/src/constants/tools.ts b/packages/website/src/constants/tools.ts index fabf3074a..643e9a5ac 100644 --- a/packages/website/src/constants/tools.ts +++ b/packages/website/src/constants/tools.ts @@ -10,7 +10,7 @@ export interface Tool { href?: string; } -export const tools: Record = { +export const tools = { tanks: { id: "tanks", strings: "tankopedia", @@ -66,9 +66,14 @@ export const tools: Record = { id: "embed", button: "red", }, + api: { + id: "api", + disabled: true, + button: "bronze", + }, more: { id: "more", href: "https://discord.gg/nDt7AjGJQH", button: "plum", }, -}; +} satisfies Record; diff --git a/packages/website/src/pages/api/index.astro b/packages/website/src/pages/api/index.astro new file mode 100644 index 000000000..6f788de59 --- /dev/null +++ b/packages/website/src/pages/api/index.astro @@ -0,0 +1,6 @@ +--- +import { tools } from "../../constants/tools"; +import ToolLayout from "../../layouts/ToolLayout.astro"; +--- + + \ No newline at end of file diff --git a/packages/website/src/pages/api/tankopedia/tank-icon/[id]/_index.tsx b/packages/website/src/pages/api/tankopedia/tank-icon/[id]/_index.tsx deleted file mode 100644 index 598cc77b6..000000000 --- a/packages/website/src/pages/api/tankopedia/tank-icon/[id]/_index.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { TankSandbox } from "../../../../../components/Tankopedia/HeroSection/components/TankSandbox"; -import { awaitableModelDefinitions } from "../../../../../core/awaitables/modelDefinitions"; -import { awaitableTankDefinitions } from "../../../../../core/awaitables/tankDefinitions"; -import { LocaleProvider } from "../../../../../hooks/useLocale"; -import { Duel } from "../../../../../stores/duel"; -import { Tankopedia } from "../../../../../stores/tankopedia"; - -const [tankDefinitions, modelDefinitions] = await Promise.all([ - awaitableTankDefinitions, - awaitableModelDefinitions, -]); - -interface PageProps { - id: number; -} - -export function Page({ id }: PageProps) { - const tank = tankDefinitions.tanks[id]; - const model = modelDefinitions.models[id]; - - Tankopedia.useInitialization(model); - Duel.useInitialization({ tank, model }); - - return ( - - - - ); -} - -function Content() { - return ; -} diff --git a/packages/website/src/pages/api/tankopedia/tank-icon/[id]/index.astro b/packages/website/src/pages/api/tankopedia/tank-icon/[id]/index.astro deleted file mode 100644 index e8e8d414a..000000000 --- a/packages/website/src/pages/api/tankopedia/tank-icon/[id]/index.astro +++ /dev/null @@ -1,30 +0,0 @@ ---- -import { assertSecret } from '@blitzkit/core'; -import type { GetStaticPaths } from 'astro'; -import { getStaticPaths as tankopediaGetStaticPaths } from '../../../../[...locale]/tools/tankopedia/[id]/index.astro'; -import { Page } from './_index'; - -export const getStaticPaths = (async () => { - if (assertSecret(import.meta.env.MODE) === 'development') { - return await tankopediaGetStaticPaths(); - } else { - return []; - } -}) satisfies GetStaticPaths; - -const { id } = Astro.params; ---- - - - - - - - - - -