mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
infrastructure for inline vfs and clients
This commit is contained in:
1 parent
d81d885767
commit
39745dd475
19 files changed
+133
-64
No files matched your search
@@ -1,7 +1,8 @@
|
||||
---
|
||||
import { assertSecret, fetchGameDefinitions } from "@blitzkit/core";
|
||||
import { assertSecret } from "@blitzkit/core";
|
||||
import { Box, Code, Flex, Heading, Link, Text } from "@radix-ui/themes";
|
||||
import packageJson from "../../../../package.json";
|
||||
import { api } from "../core/blitzkit/api";
|
||||
import { getStrings } from "../core/i18n/getStrings";
|
||||
import { LinkI18n } from "./LinkI18n";
|
||||
import { LocaleSwitcherThemeWrapper } from "./LocaleSwitcher";
|
||||
@@ -10,7 +11,7 @@ export interface Props {
|
||||
locale: string;
|
||||
}
|
||||
|
||||
const gameDefinitions = await fetchGameDefinitions();
|
||||
const gameDefinitions = await api.game();
|
||||
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_BRANCH);
|
||||
const { locale } = Astro.props;
|
||||
const strings = getStrings(locale);
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import {
|
||||
ClientBlitzKitAPI,
|
||||
ServerBlitzKitAPI,
|
||||
type BlitzKitAPI,
|
||||
} from "@blitzkit/core";
|
||||
|
||||
let _api: BlitzKitAPI;
|
||||
|
||||
if (import.meta.env.SSR) {
|
||||
_api = new ServerBlitzKitAPI();
|
||||
} else {
|
||||
_api = new ClientBlitzKitAPI();
|
||||
}
|
||||
|
||||
export const api = _api;
|
||||
Reference in new issue
Block a user