Skip to content

Landing page — press Enter to proceed #36

Description

@gertsio

Goal

On the landing page ENS input, pressing Enter should behave like clicking Proceed to setup only when the name is available.

Requirements

  • Enter triggers navigation only when isAvailable === true (and not loading/authenticating).
  • Enter does nothing when taken/invalid/loading/error.
  • The existing Proceed to setup button still works.
  • Keep the change small; no new dependencies.

Where to work

  • ../../src/components/ens-name-checker/EnsNameChecker.tsx
  • ../../src/components/ens-name-checker/EnsInput.tsx
  • ../../src/components/ens-name-checker/EnsStatus.tsx
  • ../../src/components/ens-name-checker/useEnsCheck.ts (reference)

Suggested approach (recommended)

Right now, availability/proceed logic lives in EnsLogic, while the input lives in EnsInput, so the input can’t know when it’s allowed to proceed.

  1. Lift the ENS check + proceed handler up into EnsNameChecker (so both input + status can use it).
  2. Add an optional onEnter?: () => void prop to EnsInput.
  3. In EnsInput, handle onKeyDown and when e.key === 'Enter', call onEnter?.().
  4. Wire: onEnter={() => isAvailable ? handleProceed() : undefined} (or equivalent guard).

Done when

  • Type an available name → press Enter → navigates to /dashboard/setup?ensName=...
  • Type a taken/invalid name (or while loading) → press Enter → no navigation
  • Clicking Proceed to setup still navigates correctly

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions