mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
feat: game strings context
This commit is contained in:
1 parent
9bf1554c30
commit
1eca71d28c
21 files changed
+208
-137
No files matched your search
@@ -7,6 +7,7 @@ import { PageWrapper } from '../components/PageWrapper';
|
||||
import BaseLayout from '../layouts/BaseLayout.astro';
|
||||
|
||||
const locale = locales.default;
|
||||
const localeData = { locale };
|
||||
---
|
||||
|
||||
<BaseLayout {locale}>
|
||||
@@ -15,7 +16,7 @@ const locale = locales.default;
|
||||
<Text color="gray">Where would you like to go?</Text>
|
||||
|
||||
<Flex mt="4" gap="2">
|
||||
<LinkI18n {locale} href="/">
|
||||
<LinkI18n {localeData} href="/">
|
||||
<Button>
|
||||
<HomeIcon /> Home
|
||||
</Button>
|
||||
|
||||
@@ -5,6 +5,7 @@ import { Flex, Text } from '@radix-ui/themes';
|
||||
import { CatalogItemAccessor } from 'packages/core/src/blitz/catalogItemAccessor';
|
||||
import { metadata } from 'packages/website-ue/src/core/blitz/metadata';
|
||||
import { Var } from 'packages/website-ue/src/core/radix/var';
|
||||
import type { LocaleAcceptorProps } from 'packages/website-ue/src/hooks/useLocale';
|
||||
|
||||
const allAvatars = await metadata
|
||||
.get('BlitzkitAllAvatarsEntity.blitzkit_all_avatars')
|
||||
@@ -14,7 +15,7 @@ const allAvatars = await metadata
|
||||
.avatars,
|
||||
);
|
||||
|
||||
export function Page() {
|
||||
export function Page({ localeData }: LocaleAcceptorProps) {
|
||||
return (
|
||||
<Flex wrap="wrap" gapX="4" gapY="6" justify="center" p="9">
|
||||
{allAvatars.map((avatar) => {
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
---
|
||||
import { metadata } from 'packages/website-ue/src/core/blitz/metadata';
|
||||
import BaseLayout from 'packages/website-ue/src/layouts/BaseLayout.astro';
|
||||
import { Page } from './_index';
|
||||
|
||||
export { getStaticPaths } from '../index.astro';
|
||||
|
||||
const { locale } = Astro.props;
|
||||
|
||||
const gameStrings = await metadata.stringsPartial(locale, [
|
||||
'ProfileAvatarEntity__*',
|
||||
]);
|
||||
---
|
||||
|
||||
<BaseLayout {locale}>
|
||||
<Page client:load />
|
||||
<Page localeData={{ locale, gameStrings }} client:load />
|
||||
</BaseLayout>
|
||||
@@ -1,20 +0,0 @@
|
||||
import { TankCatalogComponent } from '@protos/blitz_static_tank_component';
|
||||
import { BlitzkitAllTanksComponent } from '@protos/blitzkit_static_all_tanks_component';
|
||||
import { SocketCatalogAccessor } from 'packages/core/src';
|
||||
import { remoteCatalog } from 'packages/website-ue/src/core/blitz/remoteCatalog';
|
||||
|
||||
const data = await remoteCatalog
|
||||
.get('BlitzKitAllTanksEntity.blitzkit_all_tanks')
|
||||
.then((components) =>
|
||||
components.get(BlitzkitAllTanksComponent, 'blitzkitAllTanksComponent'),
|
||||
);
|
||||
|
||||
export function Page() {
|
||||
const tankCatalog = new SocketCatalogAccessor(data.tanks);
|
||||
|
||||
const content = tankCatalog
|
||||
.get('TankEntity.A92_M60')
|
||||
.get(TankCatalogComponent, 'tankCatalogComponent');
|
||||
|
||||
return <pre children={JSON.stringify(content, null, 2)} />;
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
import { Page } from './_index';
|
||||
|
||||
export { getStaticPaths } from '../index.astro';
|
||||
|
||||
const { locale } = Astro.props;
|
||||
---
|
||||
|
||||
<Page client:load />
|
||||
Reference in new issue
Block a user