mirror of
https://github.com/Corfirean/coa-server-manager.git
synced 2026-11-20 03:25:56 +00:00
v0.1.1: language picker on welcome screen, friendly errors for unpublished package / unreachable server, backlog notes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
68050882b8
commit
f620f87432
15 files changed
+102
-22
No files matched your search
@@ -8,14 +8,15 @@ import { Card } from "@/components/ui/card";
|
||||
import { ClientCard } from "@/screens/ClientCard";
|
||||
import { DiagnosticsCard } from "@/screens/DiagnosticsCard";
|
||||
import { AboutCard } from "@/screens/AboutCard";
|
||||
import { LOCALES, useHuman, useI18n, type Key } from "@/i18n";
|
||||
import { useHuman, useI18n, type Key } from "@/i18n";
|
||||
import { LanguagePicker } from "@/components/LanguagePicker";
|
||||
|
||||
function mb(bytes: number) {
|
||||
return bytes >= 1 << 20 ? `${(bytes / (1 << 20)).toFixed(1)} MB` : `${Math.max(1, Math.round(bytes / 1024))} KB`;
|
||||
}
|
||||
|
||||
export function SettingsHome({ serverId }: { serverId: string }) {
|
||||
const { t, locale, setLocale } = useI18n();
|
||||
const { t } = useI18n();
|
||||
const human = useHuman();
|
||||
const [preview, setPreview] = useState<UpdatePreview | null>(null);
|
||||
const [pending, setPending] = useState<UpdateTxn | null>(null);
|
||||
@@ -111,18 +112,7 @@ export function SettingsHome({ serverId }: { serverId: string }) {
|
||||
<Card className="mt-6 p-6">
|
||||
<h2 className="font-semibold">{t("settings.language")}</h2>
|
||||
<p className="mt-1 text-sm text-muted">{t("settings.languageHint")}</p>
|
||||
<select
|
||||
aria-label={t("settings.language")}
|
||||
value={locale}
|
||||
onChange={(e) => setLocale(e.target.value as typeof locale)}
|
||||
className="mt-3 rounded-md border border-line bg-bg px-3 py-2 text-sm outline-none focus:border-gold"
|
||||
>
|
||||
{LOCALES.map((l) => (
|
||||
<option key={l.id} value={l.id}>
|
||||
{l.name}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<LanguagePicker className="mt-3" />
|
||||
</Card>
|
||||
|
||||
<ClientCard serverId={serverId} />
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import { FolderSearch, Download } from "lucide-react";
|
||||
import { useT } from "@/i18n";
|
||||
import { LanguagePicker } from "@/components/LanguagePicker";
|
||||
|
||||
export function Welcome({ onImport, onInstall, onBack }: { onImport: () => void; onInstall: () => void; onBack?: () => void }) {
|
||||
const t = useT();
|
||||
return (
|
||||
<main className="flex h-full flex-col items-center justify-center px-8">
|
||||
<main className="relative flex h-full flex-col items-center justify-center px-8">
|
||||
<LanguagePicker className="absolute right-6 top-5" />
|
||||
<div className="mb-10 text-center">
|
||||
<div className="mx-auto mb-5 h-12 w-12 rounded-full border-2 border-gold/80 bg-card-2" aria-hidden />
|
||||
<h1 className="text-3xl font-semibold tracking-tight">{t("welcome.title")}</h1>
|
||||
|
||||
Reference in new issue
Block a user