Revert profile cosmetics and GeoCoin currency
Some checks failed
Deploy MineGeo to Dokploy / deploy (push) Failing after 6m16s

This commit is contained in:
2026-10-15 18:32:18 +05:00
parent c541cc09b4
commit 0e4412c99b
28 changed files with 60 additions and 1026 deletions

View File

@@ -3,7 +3,6 @@ import { useI18n } from "@/components/I18nProvider";
import { useState } from "react";
import { useRouter } from "next/navigation";
import Link from "next/link";
import { UserRound, LockKeyhole, Mail } from "lucide-react";
import { api } from "./StartGame";
import { PasswordForm } from "./PasswordForm";
@@ -20,7 +19,6 @@ export function AccountSettings({
accountId,
email,
displayName,
bio,
avatarPath,
appearance,
passwordUpdated = false,
@@ -28,14 +26,12 @@ export function AccountSettings({
accountId: string;
email: string;
displayName: string;
bio: string;
avatarPath: string | null;
appearance: ProfileAppearance;
passwordUpdated?: boolean;
}) {
const { t } = useI18n();
const [name, setName] = useState(displayName),
[about, setAbout] = useState(bio),
[message, setMessage] = useState(""),
[error, setError] = useState(""),
[busy, setBusy] = useState(false);
@@ -128,16 +124,13 @@ export function AccountSettings({
}
setBusy(true);
try {
const data = await api<{
profile: { display_name: string; bio: string };
}>(
const data = await api<{ profile: { display_name: string } }>(
"profile",
{ displayName: valid.data, bio: about },
{ displayName: valid.data },
"PATCH",
);
setName(data.profile.display_name);
setAbout(data.profile.bio);
setMessage("Public profile saved.");
setMessage("Display name saved.");
router.refresh();
} catch (e) {
setError((e as Error).message);
@@ -168,21 +161,15 @@ export function AccountSettings({
<div>
<h2>{t("Your public profile.")}</h2>
<p className="muted">
{t("A name and description for other explorers to see.")}
{t("A name for the maps and places you share.")}
</p>
</div>
</div>
<p>
<Link className="text-link" href={"/players/" + accountId}>
{t("View public profile")} →
</Link>
</p>
<form onSubmit={save}>
<div className="account-avatar-control">
<PlayerAvatar
id={accountId}
avatarPath={photoPath}
effect={appearance.profile_effect}
className="account-avatar-preview"
/>
<div className="account-avatar-input">
@@ -234,19 +221,6 @@ export function AccountSettings({
{t("2–32 characters. Display names do not have to be unique.")}
</small>
</label>
<label className="field">
{t("About you")}
<textarea
name="bio"
value={about}
onChange={(event) => setAbout(event.target.value)}
maxLength={280}
rows={4}
placeholder={t("Tell other explorers a little about yourself.")}
disabled={busy}
/>
<small>{t("Shown on your public profile · Maximum 280 characters.")}</small>
</label>
<div className="account-email">
<Mail size={17} />
<div>
@@ -268,7 +242,7 @@ export function AccountSettings({
</p>
)}
<button className="button primary" disabled={busy}>
{busy ? t("Saving…") : t("Save public profile")}
{busy ? t("Saving…") : t("Save display name")}
</button>
</form>
</section>