refactor(ui): consolidate Send and Sweep precondition alerts - #1402
Open
kishore08-07 wants to merge 1 commit into
Open
refactor(ui): consolidate Send and Sweep precondition alerts#1402kishore08-07 wants to merge 1 commit into
kishore08-07 wants to merge 1 commit into
Conversation
Signed-off-by: kishore08-07 <kishorebsm8@gmail.com>
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
This PR consolidates the previously duplicated “precondition alert banner” UI for Send (coinjoin) and Sweep flows into a single reusable PreconditionAlert component, keeping the existing wrapper components as thin, i18n-prefixed adapters.
Changes:
- Added a shared
PreconditionAlertcomponent that renders all precondition hints based on a passedsummaryandi18nPrefix. - Refactored
SendCoinjoinPreconditionAlertandSweepPreconditionAlertto delegate rendering to the shared component. - Consolidated Storybook coverage into a single
PreconditionAlert.stories.tsxand removed the two redundant stories.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/stories/jam/SweepPreconditionAlert.stories.tsx | Removed duplicate Sweep-only stories in favor of unified stories. |
| src/stories/jam/SendCoinJoinPreconditionAlert.stories.tsx | Removed duplicate Send-only stories in favor of unified stories. |
| src/stories/jam/PreconditionAlert.stories.tsx | Added combined Storybook variants for both Send and Sweep i18n prefixes. |
| src/components/ui/jam/PreconditionAlert.tsx | Introduced the shared alert implementation parameterized by summary + i18nPrefix. |
| src/components/sweep/SweepPreconditionAlert.tsx | Refactored to a thin wrapper around PreconditionAlert with the Sweep namespace. |
| src/components/send/SendCoinjoinPreconditionAlert.tsx | Refactored to a thin wrapper around PreconditionAlert with the Send namespace. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This PR refactors the redundant precondition alert banners for Send and Sweep operations into a single, reusable PreconditionAlert component.
PreconditionAlertinsrc/components/ui/jam/which accepts a summary data object and an i18nPrefix to determine which set of translation keys to load.SendCoinjoinPreconditionAlertandSweepPreconditionAlertto act as wrappers pass their specific localization namespaces (send.coinjoin_precondition and scheduler.precondition) down to the unified component.PreconditionAlert.stories.tsxto handle visual variants for both Send and Sweep in one place.Closes #1396