Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions frontend/src/app/streams/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ export default function CreateStreamPage() {
}
};

// Inline validation feedback for the amount field. validateAmountInput
// returns an error message when invalid and null when valid. Only show it
// once the user has typed something β€” the empty case is handled on submit.
const amountError = formData.amount
? validateAmountInput(formData.amount, TOKEN_DECIMALS)
: null;

return (
<div className="container mx-auto max-w-2xl px-4 py-12">
<Link
Expand Down Expand Up @@ -152,10 +159,8 @@ export default function CreateStreamPage() {
}}
required
/>
{formData.amount && !validateAmountInput(formData.amount, TOKEN_DECIMALS) && (
<p className="text-xs text-red-400 mt-1">
Amount must be greater than 0 with max {TOKEN_DECIMALS} decimals
</p>
{amountError && (
<p className="text-xs text-red-400 mt-1">{amountError}</p>
)}
</div>
</div>
Expand Down
Loading