refactor(amount): extract shared radio selector for preference modals - #894
Open
raul-oliveira wants to merge 1 commit into
Open
Conversation
Hoist the duplicated radio-selector and save-button markup shared by the
Amount Format and Address Mode modals into presentational components
(Radio/{RadioButton,RadioOption,RadioGroup} and PreferenceSaveButton) plus
shared SCSS blocks (.radio-group, .radio-option, .radio-button,
.preference-save-btn), mirroring wallet-mobile#893.
Both modals become thin: they own state and behaviour, the shared
components own presentation. Amount Format renders pixel-identically;
Address Mode adopts the unified styling with no behaviour change -- the
hasTxOutsideFirstAddress guard, single-address disabling, the warning
banner and wallet-reload-on-save are all preserved.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
5 tasks
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.
Acceptance Criteria
Radio/{RadioButton,RadioOption,RadioGroup},PreferenceSaveButton) and shared SCSS, mirroring wallet-mobile#893Third of 6 PRs. Stacked on #893 — base branch is
raul-oliveira/feat/amount-format-sweep, notmaster. Review #893 first.What changed
src/components/Radio/plusPreferenceSaveButton; aRadio/index.jsbarrel exposes the group.src/index.module.scss: the radio/option/save-button rules duplicated across.amount-formatand.address-modeare hoisted into shared.radio-group/.radio-option/.radio-button/.preference-save-btnblocks, and the superseded per-modal selectors removed..address-mode-alertand the Amount-Format-specific preview blocks are kept.Address Mode restyle: its radio circle (24→26px) and save button (185→226px) now match the shared Amount Format sizing — an intended visual unification. Behaviour is untouched: the
hasTxOutsideFirstAddressguard, single-address disabling, the warning banner (Learn moreviahelpers.openExternalURL) and wallet-reload-on-save all preserved. As a side benefit each option's<label>is now wired to its<input>(htmlFor/id), which the old Address Mode markup lacked.Out of scope (follow-up): both modals still call
$('#id').modal('show')directly instead ofGlobalModal'smanageDomLifecycle, so Escape or an outside click can discard a selection. Pre-existing, affects both, left for a separate issue to keep this a pure refactor.Testing
Suite unchanged from #893: the same 7 pre-existing suites fail on the Jest/axios ESM issue (see #892),
33 passed. No new strings (existing ones only relocated), somake update_potis a no-op.Manual QA needed
Security Checklist