mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: prep builder
This commit is contained in:
1 parent
8373fb1b7a
commit
8c14c3d093
20 files changed
+45
-422
No files matched your search
@@ -39,7 +39,7 @@ export function Checks({ localeData }: LocaleAcceptorProps) {
|
||||
* Wargaming: 14 (refresh: 7)
|
||||
*/
|
||||
function Content() {
|
||||
const localeData = useLocale();
|
||||
const { locale } = useLocale();
|
||||
const logins = App.use((state) => state.logins);
|
||||
const mutateApp = App.useMutation();
|
||||
const appStore = App.useStore();
|
||||
@@ -128,17 +128,11 @@ function Content() {
|
||||
<Text>
|
||||
This website utilizes cookies to perform analytics and personalize
|
||||
your experience. You can learn more through{' '}
|
||||
<LinkI18n
|
||||
localeData={localeData}
|
||||
href="/docs/legal/privacy-policy"
|
||||
>
|
||||
<LinkI18n locale={locale} href="/docs/legal/privacy-policy">
|
||||
our privacy policy
|
||||
</LinkI18n>
|
||||
. By using BlitzKit, you also agree to our{' '}
|
||||
<LinkI18n
|
||||
localeData={localeData}
|
||||
href="/docs/legal/terms-of-service"
|
||||
>
|
||||
<LinkI18n locale={locale} href="/docs/legal/terms-of-service">
|
||||
terms of service
|
||||
</LinkI18n>
|
||||
.
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
---
|
||||
import { assertSecret, fetchGameDefinitions } from '@blitzkit/core';
|
||||
import { Box, Code, Flex, Heading, Link, Text } from '@radix-ui/themes';
|
||||
import packageJson from '../../../../package.json';
|
||||
import { getStrings } from '../core/i18n/getStrings';
|
||||
@@ -10,8 +9,6 @@ interface Props {
|
||||
locale: string;
|
||||
}
|
||||
|
||||
const gameDefinitions = await fetchGameDefinitions();
|
||||
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH);
|
||||
const { locale } = Astro.props;
|
||||
const localeData = { locale };
|
||||
const strings = await getStrings(locale);
|
||||
@@ -83,7 +80,7 @@ const strings = await getStrings(locale);
|
||||
sm: 'start',
|
||||
}}
|
||||
>
|
||||
<LinkI18n {localeData} href="/docs/about/credits" color="gray">
|
||||
<LinkI18n {locale} href="/docs/about/credits" color="gray">
|
||||
{strings.website.footer.about.credits}
|
||||
</LinkI18n>
|
||||
<Link
|
||||
@@ -100,7 +97,7 @@ const strings = await getStrings(locale);
|
||||
>
|
||||
{strings.website.footer.about.github}
|
||||
</Link>
|
||||
<LinkI18n {localeData} href="/docs/patches" color="gray">
|
||||
<LinkI18n {locale} href="/docs/patches" color="gray">
|
||||
{strings.website.footer.about.patches}
|
||||
</LinkI18n>
|
||||
</Flex>
|
||||
@@ -120,14 +117,10 @@ const strings = await getStrings(locale);
|
||||
>
|
||||
<Heading size="3">{strings.website.footer.legal.title}</Heading>
|
||||
<Flex direction="column">
|
||||
<LinkI18n {localeData} href="/docs/legal/privacy-policy" color="gray">
|
||||
<LinkI18n {locale} href="/docs/legal/privacy-policy" color="gray">
|
||||
{strings.website.footer.legal.privacy}
|
||||
</LinkI18n>
|
||||
<LinkI18n
|
||||
{localeData}
|
||||
href="/docs/legal/terms-of-service"
|
||||
color="gray"
|
||||
>
|
||||
<LinkI18n {locale} href="/docs/legal/terms-of-service" color="gray">
|
||||
{strings.website.footer.legal.terms}
|
||||
</LinkI18n>
|
||||
</Flex>
|
||||
@@ -138,30 +131,12 @@ const strings = await getStrings(locale);
|
||||
<Flex gap="5" display={{ initial: 'flex', sm: 'none' }}>
|
||||
<Flex direction="column" justify="between" align="end">
|
||||
<Text size="2" color="gray">BlitzKit</Text>
|
||||
{
|
||||
PUBLIC_ASSET_BRANCH !== 'preview' && (
|
||||
<Text size="2" color="gray">
|
||||
WoTB
|
||||
</Text>
|
||||
)
|
||||
}
|
||||
<Text size="2" color="gray">CDN</Text>
|
||||
</Flex>
|
||||
|
||||
<Flex direction="column" justify="between" align="start">
|
||||
<Code size="2" color="gray">
|
||||
{packageJson.version}
|
||||
</Code>
|
||||
{
|
||||
PUBLIC_ASSET_BRANCH !== 'preview' && (
|
||||
<Code size="2" color="gray">
|
||||
{gameDefinitions.version}
|
||||
</Code>
|
||||
)
|
||||
}
|
||||
<Code size="2" color="gray">
|
||||
{PUBLIC_ASSET_BRANCH}
|
||||
</Code>
|
||||
</Flex>
|
||||
</Flex>
|
||||
|
||||
@@ -170,23 +145,5 @@ const strings = await getStrings(locale);
|
||||
<Code size="2" color="gray">
|
||||
{packageJson.version}
|
||||
</Code>
|
||||
|
||||
{
|
||||
PUBLIC_ASSET_BRANCH !== 'preview' && (
|
||||
<>
|
||||
<Text size="2" color="gray">
|
||||
WoTB
|
||||
</Text>
|
||||
<Code size="2" color="gray">
|
||||
{gameDefinitions.version}
|
||||
</Code>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
<Text size="2" color="gray">CDN</Text>
|
||||
<Code size="2" color="gray">
|
||||
{PUBLIC_ASSET_BRANCH}
|
||||
</Code>
|
||||
</Flex>
|
||||
</Flex>
|
||||
@@ -1,14 +1,12 @@
|
||||
import locales from '@blitzkit/i18n/locales.json' with { type: 'json' };
|
||||
import { Link, type LinkProps } from '@radix-ui/themes';
|
||||
import type { LocaleAcceptorProps } from '../hooks/useLocale';
|
||||
|
||||
export function LinkI18n({
|
||||
localeData,
|
||||
locale,
|
||||
href,
|
||||
...props
|
||||
}: LinkProps & LocaleAcceptorProps) {
|
||||
const prefix =
|
||||
localeData.locale === locales.default ? '' : `/${localeData.locale}`;
|
||||
}: LinkProps & { locale: string }) {
|
||||
const prefix = locale === locales.default ? '' : `/${locale}`;
|
||||
|
||||
return (
|
||||
<Link href={href?.startsWith('/') ? `${prefix}${href}` : href} {...props} />
|
||||
|
||||
@@ -18,7 +18,6 @@ export interface Props {
|
||||
}
|
||||
|
||||
const { integrated, locale } = Astro.props;
|
||||
const localeData = { locale };
|
||||
const toolsFiltered = tools.filter((tool) => tool.enabled);
|
||||
const branchName = resolveBranchName();
|
||||
const isBranchNamed = branchName !== undefined;
|
||||
@@ -107,7 +106,7 @@ const strings = await getStrings(locale);
|
||||
<Flex gap="4" direction="column" maxWidth="80rem" width="100%">
|
||||
<Flex align="center">
|
||||
<LinkI18n
|
||||
{localeData}
|
||||
{locale}
|
||||
color="gray"
|
||||
highContrast
|
||||
href="/"
|
||||
@@ -146,7 +145,7 @@ const strings = await getStrings(locale);
|
||||
|
||||
return (
|
||||
<LinkI18n
|
||||
{localeData}
|
||||
{locale}
|
||||
weight={selected ? 'medium' : 'regular'}
|
||||
color="gray"
|
||||
highContrast={selected}
|
||||
@@ -175,7 +174,7 @@ const strings = await getStrings(locale);
|
||||
</Link>
|
||||
|
||||
<LinkI18n
|
||||
{localeData}
|
||||
{locale}
|
||||
style={{ display: 'flex', alignContent: 'center' }}
|
||||
color="gray"
|
||||
href="/settings"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
---
|
||||
import { assertSecret } from '@blitzkit/core';
|
||||
import { CaretRightIcon } from '@radix-ui/react-icons';
|
||||
import { Box, Button, Code, Flex, Heading, Text } from '@radix-ui/themes';
|
||||
import { Box, Button, Flex, Heading, Text } from '@radix-ui/themes';
|
||||
import type { Tool } from '../constants/tools';
|
||||
import { getStrings } from '../core/i18n/getStrings';
|
||||
import { LinkI18n } from './LinkI18n';
|
||||
@@ -102,16 +101,7 @@ const toolStrings =
|
||||
size={{ initial: '3', sm: tool.significant ? '4' : '3' }}
|
||||
color="gray"
|
||||
>
|
||||
{
|
||||
disabled ? (
|
||||
<>
|
||||
Unavailable on{' '}
|
||||
<Code>{assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH)}</Code>
|
||||
</>
|
||||
) : (
|
||||
toolStrings.description
|
||||
)
|
||||
}
|
||||
{toolStrings.description}
|
||||
</Text>
|
||||
</Flex>
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { assertSecret } from 'packages/core/src';
|
||||
import { prerelease } from 'semver';
|
||||
import packageJSON from '../../../../../package.json';
|
||||
|
||||
export function resolveBranchName() {
|
||||
if (assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH) === 'main') {
|
||||
return undefined;
|
||||
}
|
||||
const components = prerelease(packageJSON.version);
|
||||
|
||||
return import.meta.env.PUBLIC_ASSET_BRANCH;
|
||||
if (components === null) return undefined;
|
||||
|
||||
return components[0];
|
||||
}
|
||||
@@ -7,7 +7,6 @@ import { PageWrapper } from '../components/PageWrapper';
|
||||
import BaseLayout from '../layouts/BaseLayout.astro';
|
||||
|
||||
const locale = locales.default;
|
||||
const localeData = { locale };
|
||||
---
|
||||
|
||||
<BaseLayout {locale}>
|
||||
@@ -16,7 +15,7 @@ const localeData = { locale };
|
||||
<Text color="gray">Where would you like to go?</Text>
|
||||
|
||||
<Flex mt="4" gap="2">
|
||||
<LinkI18n {localeData} href="/">
|
||||
<LinkI18n {locale} href="/">
|
||||
<Button>
|
||||
<HomeIcon /> Home
|
||||
</Button>
|
||||
|
||||
@@ -31,7 +31,7 @@ export function Page({ localeData }: LocaleAcceptorProps) {
|
||||
}
|
||||
|
||||
function Content() {
|
||||
const { gameStrings, strings } = useLocale();
|
||||
const { gameStrings } = useLocale();
|
||||
const groups = useMemo(() => {
|
||||
const avatars = allAvatars
|
||||
.map((id) => {
|
||||
|
||||
Reference in new issue
Block a user