refactor(predict): migrate Icon imports to design-system-react-native#27464
refactor(predict): migrate Icon imports to design-system-react-native#27464Kureev wants to merge 1 commit intoMetaMask:mainfrom
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
app/components/UI/Predict/components/PredictMarketOutcome/PredictMarketOutcome.tsx
Show resolved
Hide resolved
| const orderResult = await controllerPlaceOrder(orderParams); | ||
|
|
||
| // Clear any previous error state | ||
| setError(undefined); |
There was a problem hiding this comment.
setError cleared after order instead of before
Medium Severity
setError(undefined) was moved from before the controllerPlaceOrder call to after it succeeds. Previously, error state was cleared at the start of each order attempt, so the UI would not display a stale error during loading. Now, if a previous order failed and the user retries, the old error message remains visible throughout the loading state until the new order succeeds.
| label: strings('predict.deposit.try_again'), | ||
| onPress: () => deposit(params), | ||
| }, | ||
| }); |
There was a problem hiding this comment.
Duplicated toast config replaces shared helper function
Low Severity
The createDepositErrorToast helper was removed and its logic was inlined identically in two places within the same deposit callback — once in the .catch() handler and once in the outer catch block. These two 19-line toast configuration objects are exact duplicates, increasing maintenance burden and risk of divergence during future edits.
Additional Locations (1)
…ign-system-react-native Migrate all Predict feature files from deprecated local Icon component (component-library/components/Icons/Icon) to @metamask/design-system-react-native. Changes: - Import path swap to @metamask/design-system-react-native - Default import converted to named import - Icon symbols merged into existing DSRN imports - Alias resolution: ReactNativeDsIconColor/IconSize → canonical IconColor/IconSize - IconColor remapping: Default→IconDefault, Alternative→IconAlternative, Muted→IconMuted, Success→SuccessDefault
86c2f6f to
f2fcb7b
Compare


Summary
Iconcomponent (component-library/components/Icons/Icon) to@metamask/design-system-react-nativeIconColoraliases:Default→IconDefault,Alternative→IconAlternative,Muted→IconMuted,Success→SuccessDefaultReactNativeDsIconColor/ReactNativeDsIconSizealiases to canonicalIconColor/IconSizeTest plan
Automated
yarn lint:tsc— 0 new type errorsyarn jeston changed test files — all passManual — Icon visual verification
Verify icons render correctly (correct glyph, size, color) in these screens:
Note
Low Risk
Primarily a UI refactor that swaps icon components and updates icon color constants; risk is limited to potential visual regressions (wrong glyph/size/color) in Predict screens and toast/confirmation UI.
Overview
Migrates the Predict feature’s icon usage from the deprecated local
component-libraryIconto@metamask/design-system-react-nativeacross multiple components, hooks, and a confirmation info view.Updates icon color constant mappings (e.g.,
Default→IconDefault,Alternative→IconAlternative,Muted→IconMuted,Success→SuccessDefault) and simplifies toast spinner props to use canonicalIconColor/IconSize. AdjustsPredictMarketDetailstests to mock the design-systemIconwhile preserving existingtestIDassertions.Written by Cursor Bugbot for commit f2fcb7b. This will update automatically on new commits. Configure here.