Skip to main content

RegistrationForm

packages/core/components/organisms/RegistrationForm.js · Tier: organism · Module: core · Rendering: Client Component ('use client')

Purpose​

The new-user registration form shown after Auth0 login when no backend profile exists yet (see the registration gate in Auth & roles). Fields: email (read-only, from Auth0), display name (editable), and neighbourhood (select). On submit it calls the registerUser server action and redirects to /{lang}/home on success.

Props​

PropTypeRequiredDefaultDescription
emailstringyes—The Auth0 email (read-only field).
defaultNamestringyes—Pre-filled account name.
dictobjectyes—The registration dictionary (labels, hints, errors).
langstringyes—For the success redirect.

Behaviour​

Client-side validation requires a name and a neighbourhood; the neighbourhood options come from core/lib/config/neighbourhoods (grouped by zone). Submit errors surface an inline error banner; a "back" link logs out.

Composition​

  • Uses: atoms/core/Button, atoms/core/Icon, registerUser (core/lib/actions/registration), the neighbourhoods config, an internal Field sub-component.
  • Used by: the public register route (core/routes-public/register).

Internationalisation​

All copy from the registration dictionary (dict).

Accessibility​

Each field has a <label> and inline error (role-less but icon + text); the select uses a custom chevron with appearance-none.

Styling & tokens​

bg-surface-container-lowest inputs, border-error on invalid, rounded-md, bg-error-container submit-error banner.

atoms/core/FormField, organisms/core/ProfileCard, Auth & roles.