mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-28 12:23:24 +01:00
Merge branch 'main' into data-driven
This commit is contained in:
3 files changed
+18
-20
No files matched your search
@@ -1,11 +1,15 @@
|
|||||||
import type { BlitzGlossary } from "../types";
|
import { BlitzGlossary } from "../types";
|
||||||
|
|
||||||
export const WOTB_GLOSSARY_DOMAIN = "https://na.wotblitz.com";
|
export const WOTB_GLOSSARY_DOMAIN = "https://na.wotblitz.com";
|
||||||
export const WOTB_GLOSSARY_PATH = "api/glossary/stuff";
|
export const WOTB_GLOSSARY_PATH = "api/glossary/stuff";
|
||||||
|
|
||||||
export async function fetchGlossary(locale: string) {
|
export async function fetchGlossary(locale: string) {
|
||||||
const response = await fetch(
|
// const response = await fetch(
|
||||||
`${WOTB_GLOSSARY_DOMAIN}/${locale}/${WOTB_GLOSSARY_PATH}`,
|
// `${assertSecret(
|
||||||
);
|
// import.meta.env.WOTB_GLOSSARY_DOMAIN,
|
||||||
return (await response.json()) as BlitzGlossary;
|
// )}/${locale}${assertSecret(import.meta.env.WOTB_GLOSSARY_PATH)}`,
|
||||||
|
// );
|
||||||
|
// return (await response.json()) as BlitzGlossary;
|
||||||
|
|
||||||
|
return {} as BlitzGlossary;
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@ import type { MaybeSkeletonComponentProps } from "../types/maybeSkeletonComponen
|
|||||||
import { InlineSkeleton } from "./InlineSkeleton";
|
import { InlineSkeleton } from "./InlineSkeleton";
|
||||||
import { LazyImage } from "./LazyImage";
|
import { LazyImage } from "./LazyImage";
|
||||||
|
|
||||||
const TIME = 1793898000 * 1000;
|
const TIME = 1794675600 * 1000;
|
||||||
const HREF = "https://preview.blitzkit.app/tanks";
|
const HREF = "https://preview.blitzkit.app/tanks";
|
||||||
|
|
||||||
export function Countdown({ skeleton }: MaybeSkeletonComponentProps) {
|
export function Countdown({ skeleton }: MaybeSkeletonComponentProps) {
|
||||||
@@ -77,11 +77,11 @@ export function Countdown({ skeleton }: MaybeSkeletonComponentProps) {
|
|||||||
|
|
||||||
<Flex direction="column">
|
<Flex direction="column">
|
||||||
<Heading size={{ initial: "4", sm: "6" }}>
|
<Heading size={{ initial: "4", sm: "6" }}>
|
||||||
More Tier XIs {!skeleton && string}{" "}
|
All 9 Tier XIs {!skeleton && string}{" "}
|
||||||
{skeleton && <InlineSkeleton width="10rem" />}
|
{skeleton && <InlineSkeleton width="10rem" />}
|
||||||
</Heading>
|
</Heading>
|
||||||
<Text size={{ initial: "2", sm: "3" }}>
|
<Text size={{ initial: "2", sm: "3" }}>
|
||||||
Catch the next 3 tanks on BlitzKit Preview
|
Catch all 9 tanks on BlitzKit Preview
|
||||||
</Text>
|
</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
import {
|
import { fetchGlossary } from "@blitzkit/core";
|
||||||
WOTB_GLOSSARY_DOMAIN,
|
|
||||||
WOTB_GLOSSARY_PATH,
|
|
||||||
type BlitzGlossary,
|
|
||||||
} from "@blitzkit/core";
|
|
||||||
import locales from "@blitzkit/i18n/locales.json";
|
import locales from "@blitzkit/i18n/locales.json";
|
||||||
import type { APIContext, GetStaticPathsItem } from "astro";
|
import type { APIContext, GetStaticPathsItem } from "astro";
|
||||||
import { mixStaticPaths } from "../../../../astro/mixStaticPaths";
|
import { mixStaticPaths } from "../../../../astro/mixStaticPaths";
|
||||||
@@ -34,13 +30,11 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const glossary = await fetch(
|
const glossary = await fetchGlossary(locales.default).then((glossary) =>
|
||||||
`${WOTB_GLOSSARY_DOMAIN}/${locales.default}/${WOTB_GLOSSARY_PATH}`
|
Object.values(glossary)
|
||||||
)
|
.entries()
|
||||||
.then((response) => response.json() as Promise<BlitzGlossary>)
|
.filter(([key]) => /^prx_season_\d+$/.test(`${key}`)),
|
||||||
.then((glossary) =>
|
);
|
||||||
Object.entries(glossary).filter(([key]) => /^prx_season_\d+$/.test(key))
|
|
||||||
);
|
|
||||||
|
|
||||||
for (const [id, item] of glossary) {
|
for (const [id, item] of glossary) {
|
||||||
if (!item.image_url) continue;
|
if (!item.image_url) continue;
|
||||||
|
|||||||
Reference in new issue
Block a user