diff --git a/src/app/(frontend)/account/page.tsx b/src/app/(frontend)/account/page.tsx index ff68df5..064e0db 100644 --- a/src/app/(frontend)/account/page.tsx +++ b/src/app/(frontend)/account/page.tsx @@ -81,23 +81,24 @@ export default async function AccountPage() { - - - Preferences - Control in-app notifications and display options. - - - - - + + + Preferences + Control in-app notifications and display options. + + + + + ); diff --git a/src/components/frontend/account/PreferencesForm.tsx b/src/components/frontend/account/PreferencesForm.tsx index b725171..505512e 100644 --- a/src/components/frontend/account/PreferencesForm.tsx +++ b/src/components/frontend/account/PreferencesForm.tsx @@ -20,6 +20,7 @@ interface PreferencesFormProps { readonly leadOrActual: "lead" | "actual"; readonly discordEnabled: boolean; readonly discordMutedTypes: readonly string[]; + readonly xpDisplayMini: boolean; } export function PreferencesForm({ @@ -30,6 +31,7 @@ export function PreferencesForm({ leadOrActual: initialLeadOrActual, discordEnabled: initialDiscordEnabled, discordMutedTypes: initialDiscordMutedTypes, + xpDisplayMini: initialXPDisplayMini, }: PreferencesFormProps) { const router = useRouter(); const [mutedAll, setMutedAll] = useState(initialMutedAll); @@ -41,6 +43,7 @@ export function PreferencesForm({ const [discordMutedTypes, setDiscordMutedTypes] = useState(() => [ ...initialDiscordMutedTypes, ]); + const [xpDisplayMini, setXPDisplayMini] = useState(initialXPDisplayMini); const [error, setError] = useState(null); const [success, setSuccess] = useState(null); const [loading, setLoading] = useState(false); @@ -72,6 +75,7 @@ export function PreferencesForm({ leadOrActual, discordEnabled, discordMutedTypes, + xpDisplayMini, }); if (!result.success) { @@ -101,24 +105,9 @@ export function PreferencesForm({ - - + +
diff --git a/tests/int/preferences-form.int.spec.ts b/tests/int/preferences-form.int.spec.ts index d95beeb..360a60a 100644 --- a/tests/int/preferences-form.int.spec.ts +++ b/tests/int/preferences-form.int.spec.ts @@ -40,11 +40,12 @@ describe("PreferencesForm", () => { leadOrActual: "lead", discordEnabled: false, discordMutedTypes: [], + xpDisplayMini: false, }), ); - fireEvent.click(screen.getByRole("switch", { name: "Show version overlay" })); fireEvent.click(screen.getByRole("switch", { name: "Show callsign instead of display name" })); + fireEvent.click(screen.getByRole("switch", { name: "Use mini mode for XP display" })); fireEvent.click(screen.getByRole("switch", { name: "Mute all in-app notifications" })); fireEvent.click(screen.getByRole("radio", { name: "Actual" })); fireEvent.click(screen.getByRole("switch", { name: "Enable Discord notifications" })); @@ -60,10 +61,11 @@ describe("PreferencesForm", () => { mutedAll: true, mutedTypes: ["market:offer"], showCallsign: true, - showVersionOverlay: false, + showVersionOverlay: true, leadOrActual: "actual", discordEnabled: true, discordMutedTypes: ["market:offer"], + xpDisplayMini: true, }); }); });