Refactor auth pages and extract reusable UI components#202
Merged
Conversation
Add reusable building blocks and refactor existing pages/components to consume them, cutting net ~370 lines of duplicated JSX/validation: - Spinner / FullScreenSpinner / CenteredSpinner replace ad-hoc loading markup across Login, Register, AcceptInvitation, VerifyEmail, Pagination and UsersAdmin. - ConfirmModal consolidates the delete/cancel/leave/remove confirmation dialogs in DeleteAccount, UsersAdmin (delete user), BillingTabContent (cancel subscription) and WorkspaceSettingsModal (leave workspace, remove member). - MarketingAuthLayout + AuthFormField + auth-icons (EnvelopeIcon, LockIcon, UserIcon, ShieldIcon, ArrowRightIcon, AppLogo) replace the ~80-line shell and 7 near-identical icon/input wrappers shared by Login.tsx and Register.tsx. - WorkspaceAvatar replaces four open-coded coloured-initial avatars in WorkspaceSwitcher and WorkspaceSettingsModal. - passwordRules(t) helper in validators.ts replaces the 5-rule password validation duplicated across Register, ResetPassword, ChangePassword, RegisterModal and the create-user form.
Follow-up to the UI DRY pass: pull the repeated billing/checkout UI primitives into shared components. - StatusBanner replaces the 7 hand-rolled tinted feedback pills in BillingTabContent and BillingCheckoutPage (success / cancelled / method_updated / pending / checkout error). - PlanBadge replaces the 3 open-coded "Pro" pills in BillingTabContent and WorkspaceSettingsModal (supports success/primary colour and a small size variant). - BillingStatCard replaces the 9 copies of the stat cell used inside the billing plan cards.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR refactors the authentication pages (Login and Register) to use a shared layout component and extracts common UI patterns into reusable components. The changes improve code maintainability, reduce duplication, and establish a consistent design system for auth-related UI.
Key Changes
New Reusable Components
MarketingAuthLayout: Two-column layout component used by Login and Register pages, handling topbar, logo, headline, subtitle, and form panel sectionsAuthFormField: Standardized input field component with icon, label, and inline error displayConfirmModal: Generic confirmation modal for destructive actions (delete account, leave workspace, etc.)Spinner&FullScreenSpinner: Extracted spinner components with configurable size, variant, and colorStatusBanner: Compact status pill for billing/checkout feedback messagesPlanBadge: Small "Pro" badge shown next to paid workspacesBillingStatCard: Card component for billing stats gridWorkspaceAvatar: Colored square avatar showing workspace initialauth-icons.tsx: Centralized icon components (EnvelopeIcon, LockIcon, UserIcon, ShieldIcon, ArrowRightIcon, AppLogo)Refactored Pages
MarketingAuthLayoutandAuthFormFieldcomponents, reducing boilerplate by ~150 lines per pageStatusBannercomponentPlanBadgecomponentConfirmModalcomponentValidator Updates
passwordRulesfunction invalidators.tsminLengthandpatternfrom auth pages (now centralized in validators)UI Improvements
Implementation Details
https://claude.ai/code/session_01WfzRS6PXwxNbyEZS3A1PF9