mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-12-05 07:43:49 +01:00
migrate settings
This commit is contained in:
25 files changed
+335
-237
No files matched your search
@@ -1,13 +0,0 @@
|
||||
---
|
||||
import { tools } from "../../../../constants/tools";
|
||||
import BaseLayout from "../../../../layouts/BaseLayout.astro";
|
||||
import { Page } from "./_index";
|
||||
|
||||
export { getStaticPaths } from "../index.astro";
|
||||
|
||||
const { locale } = Astro.props;
|
||||
---
|
||||
|
||||
<BaseLayout tool={tools.settings} {locale}>
|
||||
<Page {locale} client:load />
|
||||
</BaseLayout>
|
||||
@@ -1,63 +0,0 @@
|
||||
import { Flex, Switch, Text } from "@radix-ui/themes";
|
||||
import { LocaleSwitcher } from "../../../../components/LocaleSwitcher";
|
||||
import { PageWrapper } from "../../../../components/PageWrapper";
|
||||
import {
|
||||
LocaleProvider,
|
||||
useLocale,
|
||||
type LocaleAcceptorProps,
|
||||
} from "../../../../hooks/useLocale";
|
||||
import { App } from "../../../../stores/app";
|
||||
|
||||
export function Page({ locale }: LocaleAcceptorProps) {
|
||||
return (
|
||||
<LocaleProvider locale={locale}>
|
||||
<Content locale={locale} />
|
||||
</LocaleProvider>
|
||||
);
|
||||
}
|
||||
|
||||
function Content({ locale }: LocaleAcceptorProps) {
|
||||
const developerMode = App.useDeferred((state) => state.developerMode, false);
|
||||
const autoLoadModels = App.useDeferred(
|
||||
(state) => state.autoLoadModels,
|
||||
true,
|
||||
);
|
||||
const { strings } = useLocale();
|
||||
|
||||
return (
|
||||
<PageWrapper justify="center" align="center">
|
||||
<Flex gap="3" direction="column" width="100%" maxWidth="20rem">
|
||||
<Flex align="center" gap="2" justify="between">
|
||||
<Text>{strings.website.settings.dev_mode}</Text>
|
||||
<Switch
|
||||
variant="classic"
|
||||
checked={developerMode}
|
||||
onCheckedChange={(checked) =>
|
||||
App.mutate((draft) => {
|
||||
draft.developerMode = checked;
|
||||
})
|
||||
}
|
||||
/>
|
||||
</Flex>
|
||||
|
||||
<Flex align="center" gap="2" justify="between">
|
||||
<Text>{strings.website.settings.auto_load_models}</Text>
|
||||
<Switch
|
||||
variant="classic"
|
||||
checked={autoLoadModels}
|
||||
onCheckedChange={(checked) =>
|
||||
App.mutate((draft) => {
|
||||
draft.autoLoadModels = checked;
|
||||
})
|
||||
}
|
||||
/>
|
||||
</Flex>
|
||||
|
||||
<Flex align="center" gap="2" justify="between">
|
||||
<Text>{strings.website.settings.language}</Text>
|
||||
<LocaleSwitcher locale={locale} />
|
||||
</Flex>
|
||||
</Flex>
|
||||
</PageWrapper>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user