Better submit buttons#97
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the Form.Submit component to display different icons and labels based on submission state (submitting, success, dirty) and updates related stories.
- Add
Saveicon and new props (submittingLabel,successLabel) for dynamic labels - Update
Submitlogic to compute icon and label based onisSubmitting,isDirty, andisSubmitSuccessful - Provide new stories demonstrating the required and optional input forms with the updated submit behavior
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| stories/forms/Submit.stories.tsx | Add stories to showcase Form.Submit states and pass appropriate args |
| components/form.tsx | Update Submit component: import Save, add dynamic icon/label logic, define new props |
Comments suppressed due to low confidence (3)
components/form.tsx:261
- [nitpick] The new props
submittingLabelandsuccessLabelare optional, but the PR description states labels for all states are required. To align the API with the documentation, consider making these props required.
}: SubmitProps) {
components/form.tsx:259
- [nitpick] Using the prop name
isSubmittingfor an override is confusing sinceformState.isSubmittingexists. Renaming the prop to e.g.isLoadingorsubmittingOverridewould improve clarity.
isSubmitting: isSubmittingOverride = false,
components/form.tsx:268
- There are no existing tests covering the new
Submitstates (submitting, success, dirty). Consider adding tests to validate icon and label changes across these states.
const disabled = skipDirtyCheck
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
joaocosta9
approved these changes
Jun 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Targeting this issue from the main repo: ethui/ethui#1229
overall changes: