mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: remote and socket metadata and gallery
This commit is contained in:
1 parent
5e9aa99755
commit
f48c5d246d
18 files changed
+213
-23
No files matched your search
@@ -0,0 +1,55 @@
|
||||
import { ProfileAvatarComponent } from '@protos/blitz_static_profile_avatar_component';
|
||||
import { StuffUIComponent } from '@protos/blitz_static_stuff_ui_component';
|
||||
import { BlitzkitAllAvatarsComponent } from '@protos/blitzkit_static_all_avatars_component';
|
||||
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';
|
||||
|
||||
const allAvatars = await metadata
|
||||
.get('BlitzkitAllAvatarsEntity.blitzkit_all_avatars')
|
||||
.then(
|
||||
(entity) =>
|
||||
entity.get(BlitzkitAllAvatarsComponent, 'blitzkitAllAvatarsComponent')
|
||||
.avatars,
|
||||
);
|
||||
|
||||
export function Page() {
|
||||
return (
|
||||
<Flex wrap="wrap" gapX="4" gapY="6" justify="center" p="9">
|
||||
{allAvatars.map((avatar) => {
|
||||
const item = new CatalogItemAccessor(avatar);
|
||||
|
||||
const stuffComponent = item.get(StuffUIComponent, 'UIComponent');
|
||||
const avatarComponent = item.get(
|
||||
ProfileAvatarComponent,
|
||||
'profileAvatarComponent',
|
||||
);
|
||||
|
||||
return (
|
||||
<Flex
|
||||
direction="column"
|
||||
gap="2"
|
||||
key={avatar.catalog_id}
|
||||
style={{
|
||||
width: '8rem',
|
||||
}}
|
||||
>
|
||||
<img
|
||||
alt="apple sauce"
|
||||
src={avatarComponent.avatar}
|
||||
style={{
|
||||
width: '100%',
|
||||
aspectRatio: '1 / 1',
|
||||
objectFit: 'fill',
|
||||
borderRadius: Var('radius-1'),
|
||||
boxShadow: Var('shadow-2'),
|
||||
}}
|
||||
/>
|
||||
<Text align="center">{stuffComponent.display_name}</Text>
|
||||
</Flex>
|
||||
);
|
||||
})}
|
||||
</Flex>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
import BaseLayout from 'packages/website-ue/src/layouts/BaseLayout.astro';
|
||||
import { Page } from './_index';
|
||||
|
||||
export { getStaticPaths } from '../index.astro';
|
||||
|
||||
const { locale } = Astro.props;
|
||||
---
|
||||
|
||||
<BaseLayout {locale}>
|
||||
<Page client:load />
|
||||
</BaseLayout>
|
||||
@@ -1,6 +1,6 @@
|
||||
import { TankCatalogComponent } from '@protos/blitz_static_tank_component';
|
||||
import { BlitzkitAllTanksComponent } from '@protos/blitzkit_static_all_tanks_component';
|
||||
import { CatalogAccessor } from 'packages/core/src';
|
||||
import { SocketCatalogAccessor } from 'packages/core/src';
|
||||
import { remoteCatalog } from 'packages/website-ue/src/core/blitz/remoteCatalog';
|
||||
|
||||
const data = await remoteCatalog
|
||||
@@ -10,7 +10,7 @@ const data = await remoteCatalog
|
||||
);
|
||||
|
||||
export function Page() {
|
||||
const tankCatalog = new CatalogAccessor(data.tanks);
|
||||
const tankCatalog = new SocketCatalogAccessor(data.tanks);
|
||||
|
||||
const content = tankCatalog
|
||||
.get('TankEntity.A92_M60')
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import type { APIRoute, GetStaticPaths, GetStaticPathsItem } from 'astro';
|
||||
import { catalog } from 'packages/website-ue/src/core/blitz/catalog';
|
||||
import { catalog } from 'packages/website-ue/src/core/blitz/metadata';
|
||||
|
||||
export const getStaticPaths: GetStaticPaths = () => {
|
||||
const paths: GetStaticPathsItem[] = [];
|
||||
Reference in new issue
Block a user