From 1de608f9bcb972679a2919e0c5c7b0af1205e4b1 Mon Sep 17 00:00:00 2001 From: m5r Date: Wed, 12 Aug 2026 22:28:56 +0200 Subject: [PATCH] milestone 23 s3: convert auth/LoginPage.tsx to stylex --- web/src/auth/LoginPage.tsx | 69 ++++++++++++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 10 deletions(-) diff --git a/web/src/auth/LoginPage.tsx b/web/src/auth/LoginPage.tsx index f2475ee..57aa0b2 100644 --- a/web/src/auth/LoginPage.tsx +++ b/web/src/auth/LoginPage.tsx @@ -1,8 +1,57 @@ import { useEffect, useState, type FormEvent } from "react"; import { useRouter, useSearch } from "@tanstack/react-router"; +import * as stylex from "@stylexjs/stylex"; import { ApiError } from "@/lib/api"; import { useAuth } from "@/auth/store"; -import { inputClass, largePrimaryButtonClass } from "@/ui/classes"; +import { styles as shared } from "@/ui/styles"; +import { colors } from "@/ui/tokens.stylex"; + +const styles = stylex.create({ + /** Login renders outside AppShell, so it paints the page ground itself. */ + page: { + display: "flex", + minHeight: "100dvh", + alignItems: "center", + justifyContent: "center", + backgroundColor: colors.surface, + color: colors.text, + padding: "1rem", + }, + card: { + width: "100%", + maxWidth: "24rem", + }, + heading: { + fontSize: "1.5rem", + lineHeight: "2rem", + fontWeight: 600, + }, + probing: { + marginTop: "1rem", + color: colors.textMuted, + }, + form: { + display: "flex", + flexDirection: "column", + gap: "1rem", + marginTop: "1.5rem", + }, + fieldLabel: { + display: "block", + fontSize: "0.875rem", + lineHeight: "1.25rem", + fontWeight: 500, + }, + submit: { + width: "100%", + }, + error: { + marginTop: "1rem", + fontSize: "0.875rem", + lineHeight: "1.25rem", + color: colors.danger, + }, +}); export function safeRedirect(raw: string | undefined): string { if (raw === undefined) return "/"; @@ -76,15 +125,15 @@ export default function LoginPage() { } return ( -
-
-

nxdns

+
+
+

nxdns

{authRequired !== true ? ( -

Checking whether a password is required…

+

Checking whether a password is required…

) : ( -
+
-
)} {error !== null && ( -

+

{errorMessage(error, remaining)}

)}