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.
- Lift the ENS check + proceed handler up into
EnsNameChecker (so both input + status can use it).
- Add an optional
onEnter?: () => void prop to EnsInput.
- In
EnsInput, handle onKeyDown and when e.key === 'Enter', call onEnter?.().
- Wire:
onEnter={() => isAvailable ? handleProceed() : undefined} (or equivalent guard).
Done when
Goal
On the landing page ENS input, pressing Enter should behave like clicking Proceed to setup only when the name is available.
Requirements
isAvailable === true(and not loading/authenticating).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 inEnsInput, so the input can’t know when it’s allowed to proceed.EnsNameChecker(so both input + status can use it).onEnter?: () => voidprop toEnsInput.EnsInput, handleonKeyDownand whene.key === 'Enter', callonEnter?.().onEnter={() => isAvailable ? handleProceed() : undefined}(or equivalent guard).Done when
/dashboard/setup?ensName=...