User story / Problem statement
Currently components/CreateGrant/index.tsx is 535 lines with eleven useState calls. It mixes four jobs: the schedule model and its demo presets, field validation, a balance fetch, and three steps of markup. It is the hardest file to read in an app whose purpose is being read.
Expected outcome
The schedule maths is a pure module with tests. Each wizard step is its own file. The entry composes them and holds little else. The form behaves exactly as it does today.
Acceptance criteria
Technical notes
Follow the layout rules in dapp/frontend/CLAUDE.md. The folder already holds fields.ts, DateField.tsx and LiveScheduleCurve.tsx, so step files are PascalCase beside the entry and shared helpers are camelCase leaf modules. Name each step for what it shows, never Step1. Issue #138 replaces the step counter with Ark Steps and touches the same file, so land this one first.
User story / Problem statement
Currently
components/CreateGrant/index.tsxis 535 lines with elevenuseStatecalls. It mixes four jobs: the schedule model and its demo presets, field validation, a balance fetch, and three steps of markup. It is the hardest file to read in an app whose purpose is being read.Expected outcome
The schedule maths is a pure module with tests. Each wizard step is its own file. The entry composes them and holds little else. The form behaves exactly as it does today.
Acceptance criteria
CreateGrant/schedule.tsholdsaddMonths,defaultSchedule,buildDemoScheduleand the preset transform as pure functionsbalanceandbalanceStatebecome one value, so a fetch error cannot sit beside a loaded balance<form>and Enter submits from the last stepCreateGrant/index.tsxis under 200 linesTechnical notes
Follow the layout rules in
dapp/frontend/CLAUDE.md. The folder already holdsfields.ts,DateField.tsxandLiveScheduleCurve.tsx, so step files are PascalCase beside the entry and shared helpers are camelCase leaf modules. Name each step for what it shows, neverStep1. Issue #138 replaces the step counter with ArkStepsand touches the same file, so land this one first.