From 6963be6e488727c6d1e512a6b9fc8a86ff538140 Mon Sep 17 00:00:00 2001 From: Amitabh Aggarwal Date: Tue, 12 Nov 2024 13:45:32 -0600 Subject: [PATCH] feat: conditionally display stake/earn text based on pooled staking feature flag (#12261) (#12263) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** Updates StakeButton component to show different text based on whether pooled staking is enabled. Shows "earn" when pooled staking is active, and "stake" when using traditional staking. ## **Manual testing steps** 1. Set export MM_POOLED_STAKING_UI_ENABLED=true in your local .js.env file 2. Go to Homepage and you should see 'Earn' CTA 3. Disable the flag in .js.env and then go to homepage , and now you should see 'Stake' CTA ## **Screenshots/Recordings** ### **Before** image ### **After** image ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --- app/components/UI/Stake/components/StakeButton/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/components/UI/Stake/components/StakeButton/index.tsx b/app/components/UI/Stake/components/StakeButton/index.tsx index f31695671bc..d9339057a91 100644 --- a/app/components/UI/Stake/components/StakeButton/index.tsx +++ b/app/components/UI/Stake/components/StakeButton/index.tsx @@ -83,7 +83,9 @@ const StakeButtonContent = ({ asset }: StakeButtonProps) => { {' • '} - {`${strings('stake.earn')} `} + {isPooledStakingFeatureEnabled() + ? `${strings('stake.earn')} ` + : `${strings('stake.stake')} `}