-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore: extract MusdTag component logic from RewardsTag logic #23731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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. |
...components/Views/confirmations/components/info/musd-conversion-info/musd-conversion-info.tsx
Outdated
Show resolved
Hide resolved
...nents/Views/confirmations/components/info/musd-conversion-info/musd-conversion-info.test.tsx
Outdated
Show resolved
Hide resolved
app/components/UI/Earn/components/OutputAmountTag/OutputAmountTag.test.tsx
Show resolved
Hide resolved
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsThe changes introduce new UI components and hooks related to the mUSD conversion flow within the Earn/Staking feature. Here's the breakdown:
The changes primarily affect:
While Selected tags:
|
|



Description
This PR extracts the
OutputAmountTagcomponent for mUSD conversion flows, separating it from rewards-related functionality that has a blocker.Changes included:
OutputAmountTag component - A standalone generic tag component that displays output amounts with symbols in conversion flows (e.g., "100.57 mUSD")
useCustomAmount hook - Simplified hook that only handles output amount logic for mUSD conversions:
shouldShowOutputAmountTag- Whether to display the tagoutputAmount- Formatted amount with 2 decimal placesoutputSymbol- Token symbol (mUSD)Removed rewards-related code that had a blocker:
RewardsTagcomponent (empty directory cleaned up)RewardsTooltipBottomSheetcomponent (empty directory cleaned up)useRewardsAccountOptedInhookuseCustomAmountRewardshookshouldShowRewardsTag,estimatedPoints,onRewardsTagPress,renderRewardsTooltip)Test cleanup - Updated test files to remove references to non-existent rewards functionality:
useCustomAmount.test.ts- Removed rewards opt-in tests, points calculation tests, and tooltip testsmusd-conversion-info.test.tsx- Fixed import names and mock valuesChangelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MUSD-101
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Introduces OutputAmountTag and useCustomAmount, and integrates them into mUSD conversion via a new overrideContent in CustomAmountInfo with accompanying tests.
app/components/UI/Earn/components/OutputAmountTag): New pill tag to display formattedamountwith optionalsymboland background.overrideContent(amountHuman)prop to replace default content (hidesPayTokenAmount,PayWithRow, andchildren).MusdOverrideContentusinguseCustomAmountto showOutputAmountTag(mUSD) and conditionallyPayWithRow; ensures mUSD token is added peroutputChainId.hooks/earn): Determines when to show output tag formusdConversion, formats amount to 2 decimals, and setsmUSDsymbol based on feature flag and transaction type.OutputAmountTaganduseCustomAmount.custom-amount-infoandmusd-conversion-infotests to validateoverrideContent, labels, and token availability behavior.Written by Cursor Bugbot for commit e9b4de8. This will update automatically on new commits. Configure here.