From b88c5a7d94ed6139af9ace730a6b9300c576a02b Mon Sep 17 00:00:00 2001 From: GuiBibeau Date: Thu, 6 Jul 2023 10:38:55 -0400 Subject: [PATCH 1/4] feat(MMPD-546): update portfolio icon --- app/components/UI/Tokens/index.tsx | 20 +++++++++----------- app/components/UI/Tokens/styles.ts | 3 ++- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/app/components/UI/Tokens/index.tsx b/app/components/UI/Tokens/index.tsx index dca7bceb61e..a5d4c039657 100644 --- a/app/components/UI/Tokens/index.tsx +++ b/app/components/UI/Tokens/index.tsx @@ -393,7 +393,7 @@ const Tokens: React.FC = ({ tokens }) => { width={ButtonWidthTypes.Full} style={styles.buyButton} onPress={goToBuy} - label={strings('wallet.buy_asset', { asset: mainToken.symbol })} + label={strings('wallet.portfolio_button')} /> ); @@ -459,17 +459,15 @@ const Tokens: React.FC = ({ tokens }) => { > {fiatBalance} - - - + label={'Portfolio'} + endIconName={IconName.Login} + /> ); }; diff --git a/app/components/UI/Tokens/styles.ts b/app/components/UI/Tokens/styles.ts index d349d941850..a67b68273d3 100644 --- a/app/components/UI/Tokens/styles.ts +++ b/app/components/UI/Tokens/styles.ts @@ -89,7 +89,8 @@ const createStyles = (colors: Colors) => networth: { flexDirection: 'row', alignItems: 'center', - marginLeft: 16, + marginHorizontal: 16, + justifyContent: 'space-between', marginVertical: 24, }, fiatBalance: { From 68d0c4a3010500521ee76e61a8775fa9977235de Mon Sep 17 00:00:00 2001 From: GuiBibeau Date: Thu, 6 Jul 2023 11:58:11 -0400 Subject: [PATCH 2/4] feat(MMPD-546): lint, update to use translations, keep test id --- app/components/UI/Tokens/index.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app/components/UI/Tokens/index.tsx b/app/components/UI/Tokens/index.tsx index a5d4c039657..5eb49cddf55 100644 --- a/app/components/UI/Tokens/index.tsx +++ b/app/components/UI/Tokens/index.tsx @@ -72,11 +72,7 @@ import SkeletonText from '../../../components/UI/FiatOnRampAggregator/components import Routes from '../../../constants/navigation/Routes'; import { TOKEN_BALANCE_LOADING, TOKEN_RATE_UNDEFINED } from './constants'; import AppConstants from '../../../core/AppConstants'; -import Icon, { - IconColor, - IconName, - IconSize, -} from '../../../component-library/components/Icons/Icon'; +import { IconName } from '../../../component-library/components/Icons/Icon'; import { PORTFOLIO_BUTTON, @@ -393,7 +389,7 @@ const Tokens: React.FC = ({ tokens }) => { width={ButtonWidthTypes.Full} style={styles.buyButton} onPress={goToBuy} - label={strings('wallet.portfolio_button')} + label={strings('wallet.buy_asset', { asset: mainToken.symbol })} /> ); @@ -465,7 +461,8 @@ const Tokens: React.FC = ({ tokens }) => { width={ButtonWidthTypes.Full} style={styles.buyButton} onPress={onOpenPortfolio} - label={'Portfolio'} + label={strings('asset_overview.portfolio_button')} + {...generateTestId(Platform, PORTFOLIO_BUTTON)} endIconName={IconName.Login} /> From f25b83b9ade3374c493550325a9439a138419d81 Mon Sep 17 00:00:00 2001 From: Guillaume Bibeau-laviolette Date: Thu, 6 Jul 2023 12:57:08 -0400 Subject: [PATCH 3/4] Update index.tsx change icon --- app/components/UI/Tokens/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/UI/Tokens/index.tsx b/app/components/UI/Tokens/index.tsx index 0670d77d15f..f9f6e8bda66 100644 --- a/app/components/UI/Tokens/index.tsx +++ b/app/components/UI/Tokens/index.tsx @@ -461,7 +461,7 @@ const Tokens: React.FC = ({ tokens }) => { onPress={onOpenPortfolio} label={strings('asset_overview.portfolio_button')} {...generateTestId(Platform, PORTFOLIO_BUTTON)} - endIconName={IconName.Login} + endIconName={IconName.Export} /> ); From f4c888b6b99731604b50cfaada9bcd593294430f Mon Sep 17 00:00:00 2001 From: GuiBibeau Date: Fri, 7 Jul 2023 11:49:53 -0400 Subject: [PATCH 4/4] fix snapshots --- .../Tokens/__snapshots__/index.test.tsx.snap | 192 +++++++++++++----- 1 file changed, 141 insertions(+), 51 deletions(-) diff --git a/app/components/UI/Tokens/__snapshots__/index.test.tsx.snap b/app/components/UI/Tokens/__snapshots__/index.test.tsx.snap index 85739b38e4c..057890f6b46 100644 --- a/app/components/UI/Tokens/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/Tokens/__snapshots__/index.test.tsx.snap @@ -321,7 +321,8 @@ exports[`Tokens should hide zero balance tokens when setting is on 1`] = ` Object { "alignItems": "center", "flexDirection": "row", - "marginLeft": 16, + "justifyContent": "space-between", + "marginHorizontal": 16, "marginVertical": 24, } } @@ -339,21 +340,20 @@ exports[`Tokens should hide zero balance tokens when setting is on 1`] = ` > 0 USD - - - + variant="Secondary" + width="full" + /> } data={ @@ -415,7 +415,8 @@ exports[`Tokens should hide zero balance tokens when setting is on 1`] = ` Object { "alignItems": "center", "flexDirection": "row", - "marginLeft": 16, + "justifyContent": "space-between", + "marginHorizontal": 16, "marginVertical": 24, } } @@ -436,25 +437,54 @@ exports[`Tokens should hide zero balance tokens when setting is on 1`] = ` 0 USD + + Portfolio + @@ -1276,7 +1306,8 @@ exports[`Tokens should render correctly 1`] = ` Object { "alignItems": "center", "flexDirection": "row", - "marginLeft": 16, + "justifyContent": "space-between", + "marginHorizontal": 16, "marginVertical": 24, } } @@ -1294,21 +1325,20 @@ exports[`Tokens should render correctly 1`] = ` > 0 USD - - - + variant="Secondary" + width="full" + /> } data={ @@ -1370,7 +1400,8 @@ exports[`Tokens should render correctly 1`] = ` Object { "alignItems": "center", "flexDirection": "row", - "marginLeft": 16, + "justifyContent": "space-between", + "marginHorizontal": 16, "marginVertical": 24, } } @@ -1391,25 +1422,54 @@ exports[`Tokens should render correctly 1`] = ` 0 USD + + Portfolio + @@ -2231,7 +2291,8 @@ exports[`Tokens should show all balance tokens when hideZeroBalanceTokens settin Object { "alignItems": "center", "flexDirection": "row", - "marginLeft": 16, + "justifyContent": "space-between", + "marginHorizontal": 16, "marginVertical": 24, } } @@ -2249,21 +2310,20 @@ exports[`Tokens should show all balance tokens when hideZeroBalanceTokens settin > 0 USD - - - + variant="Secondary" + width="full" + /> } data={ @@ -2333,7 +2393,8 @@ exports[`Tokens should show all balance tokens when hideZeroBalanceTokens settin Object { "alignItems": "center", "flexDirection": "row", - "marginLeft": 16, + "justifyContent": "space-between", + "marginHorizontal": 16, "marginVertical": 24, } } @@ -2354,25 +2415,54 @@ exports[`Tokens should show all balance tokens when hideZeroBalanceTokens settin 0 USD + + Portfolio +