Skip to content

[Frontend] Create-stream amount error message shows only when input is VALID (inverted logic) #551

@ogazboiz

Description

@ogazboiz

Telegram: https://t.me/+DOylgFv1jyJlNzM0

Why this matters

In frontend/src/app/streams/create/page.tsx, the inline amount error renders with:

{formData.amount && !validateAmountInput(formData.amount, TOKEN_DECIMALS) && (
  <p className="text-xs text-red-400">Amount must be greater than 0 with max {TOKEN_DECIMALS} decimals</p>
)}

validateAmountInput returns an error string when invalid and null when valid. So !validateAmountInput(...) is truthy exactly when the amount is valid — the red error appears for good input and disappears for bad input. The condition is inverted.

Acceptance criteria

  • Render the error only when validateAmountInput(...) returns a non-null message, and display that message (instead of a generic hardcoded string)
  • Manually verify: valid amount → no error; empty/zero/too-many-decimals → correct error text

Files to touch

  • frontend/src/app/streams/create/page.tsx

Out of scope

  • The wizard's amount step (separate component).

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingfrontendFrontend related tasksgood first issueGood for newcomers

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions