From 368149a3581e9387e690aa6f45ec6f9aa41b4dd3 Mon Sep 17 00:00:00 2001 From: m5r Date: Wed, 12 Aug 2026 22:27:00 +0200 Subject: [PATCH] milestone 23 s3: convert features/blocklists/BlocklistForm.tsx to stylex --- web/src/features/blocklists/BlocklistForm.tsx | 66 +++++++++++++++---- 1 file changed, 54 insertions(+), 12 deletions(-) diff --git a/web/src/features/blocklists/BlocklistForm.tsx b/web/src/features/blocklists/BlocklistForm.tsx index 1fb9849..ecc587d 100644 --- a/web/src/features/blocklists/BlocklistForm.tsx +++ b/web/src/features/blocklists/BlocklistForm.tsx @@ -1,10 +1,48 @@ import { useState, type FormEvent } from "react"; +import * as stylex from "@stylexjs/stylex"; import { ApiError } from "@/lib/api"; import InlineError from "@/lib/InlineError"; import type { Blocklist, BlocklistInput } from "@/lib/types"; -import { buttonClass, focusRing, inputClass, primaryButtonClass } from "@/ui/classes"; +import { styles as shared } from "@/ui/styles"; import { READ_ONLY_HINT } from "@/features/settings/authority"; +const styles = stylex.create({ + form: { + display: "flex", + flexDirection: "column", + gap: "0.75rem", + marginTop: "1rem", + maxWidth: "36rem", + }, + heading: { + fontSize: "1.125rem", + lineHeight: "1.75rem", + fontWeight: 500, + }, + fieldLabel: { + display: "block", + fontSize: "0.875rem", + lineHeight: "1.25rem", + fontWeight: 500, + }, + checkboxLabel: { + display: "flex", + alignItems: "center", + gap: "0.5rem", + fontSize: "0.875rem", + lineHeight: "1.25rem", + fontWeight: 500, + }, + buttonRow: { + display: "flex", + alignItems: "center", + gap: "0.5rem", + }, + cancel: { + fontWeight: 500, + }, +}); + /** * Drops the rejection the page already renders inline below the form. Anything * else is a bug in this component and must reach the console instead of dying @@ -46,10 +84,10 @@ export default function BlocklistForm({ initial, busy, readOnly, error, onSubmit } return ( -
-

{initial === undefined ? "Add source" : `Edit ${initial.name}`}

+ +

{initial === undefined ? "Add source" : `Edit ${initial.name}`}

-
-
-