Skip to content

Commit 276e723

Browse files
authored
fix: cp-7.46.0 Temporarily disable send flow via token details on non-evm networks (#15096)
## **Description** It looks like Send flow via the Token Details screen is not supported as of 7.46. There is another PR opened that begins to implement this: #15095 This PR can be used as a cherry-pick in the meantime into 7.46 to disable send flow via tokens details for non-evm networks. Worth mentioning that users can still enter the send flow via the main tokens screen. ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** https://github.com/user-attachments/assets/58fa7961-6533-43b0-8d1e-b441de159577 ## **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** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] 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.
1 parent 1593770 commit 276e723

File tree

2 files changed

+18
-120
lines changed

2 files changed

+18
-120
lines changed

app/components/UI/AssetOverview/__snapshots__/AssetOverview.test.tsx.snap

Lines changed: 0 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -3018,112 +3018,6 @@ exports[`AssetOverview should render native balances when non evm network is sel
30183018
Bridge
30193019
</Text>
30203020
</View>
3021-
<View
3022-
style={
3023-
{
3024-
"alignItems": "center",
3025-
"display": "flex",
3026-
"flexDirection": "column",
3027-
}
3028-
}
3029-
>
3030-
<TouchableOpacity
3031-
disabled={false}
3032-
onPress={[Function]}
3033-
style={
3034-
[
3035-
{
3036-
"alignItems": "flex-start",
3037-
"flexDirection": "row",
3038-
"justifyContent": "flex-start",
3039-
"paddingVertical": 16,
3040-
"width": "100%",
3041-
},
3042-
{
3043-
"alignItems": "flex-start",
3044-
"flexDirection": "row",
3045-
"justifyContent": "flex-start",
3046-
"paddingTop": 16,
3047-
"paddingVertical": 2,
3048-
"width": "100%",
3049-
},
3050-
false,
3051-
]
3052-
}
3053-
testID="token-send-button"
3054-
>
3055-
<View
3056-
style={
3057-
{
3058-
"alignItems": "center",
3059-
"backgroundColor": "#4459ff",
3060-
"borderRadius": 20,
3061-
"height": 40,
3062-
"justifyContent": "center",
3063-
"marginHorizontal": 16,
3064-
"overflow": "hidden",
3065-
"width": 40,
3066-
}
3067-
}
3068-
>
3069-
<SvgMock
3070-
color="#ffffff"
3071-
height={24}
3072-
name="Arrow2Upright"
3073-
style={
3074-
{
3075-
"height": 24,
3076-
"width": 24,
3077-
}
3078-
}
3079-
width={24}
3080-
/>
3081-
</View>
3082-
<View>
3083-
<Text
3084-
accessibilityRole="text"
3085-
style={
3086-
{
3087-
"color": "#121314",
3088-
"fontFamily": "CentraNo1-Medium",
3089-
"fontSize": 18,
3090-
"fontWeight": "500",
3091-
"letterSpacing": 0,
3092-
"lineHeight": 24,
3093-
}
3094-
}
3095-
/>
3096-
<Text
3097-
accessibilityRole="text"
3098-
style={
3099-
{
3100-
"color": "#686e7d",
3101-
"fontFamily": "CentraNo1-Book",
3102-
"fontSize": 16,
3103-
"fontWeight": "400",
3104-
"letterSpacing": 0,
3105-
"lineHeight": 24,
3106-
}
3107-
}
3108-
/>
3109-
</View>
3110-
</TouchableOpacity>
3111-
<Text
3112-
accessibilityRole="text"
3113-
style={
3114-
{
3115-
"color": "#121314",
3116-
"fontFamily": "CentraNo1-Book",
3117-
"fontSize": 16,
3118-
"fontWeight": "400",
3119-
"letterSpacing": 0,
3120-
"lineHeight": 24,
3121-
}
3122-
}
3123-
>
3124-
Send
3125-
</Text>
3126-
</View>
31273021
<View
31283022
style={
31293023
{

app/components/Views/AssetDetails/AssetDetailsActions/AssetDetailsActions.tsx

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import Text, {
1212
import { TokenOverviewSelectorsIDs } from '../../../../../e2e/selectors/wallet/TokenOverview.selectors';
1313
import { useSelector } from 'react-redux';
1414
import { selectCanSignTransactions } from '../../../../selectors/accountsController';
15+
import { selectIsEvmNetworkSelected } from '../../../../selectors/multichainNetworkController';
1516

1617
export interface AssetDetailsActionsProps {
1718
displayBuyButton: boolean | undefined;
@@ -36,6 +37,7 @@ export const AssetDetailsActions: React.FC<AssetDetailsActionsProps> = ({
3637
onSend,
3738
onReceive,
3839
}) => {
40+
const isEvmNetworkSelected = useSelector(selectIsEvmNetworkSelected);
3941
const { styles } = useStyles(styleSheet, {});
4042
const canSignTransactions = useSelector(selectCanSignTransactions);
4143

@@ -89,20 +91,22 @@ export const AssetDetailsActions: React.FC<AssetDetailsActionsProps> = ({
8991
</Text>
9092
</View>
9193
) : null}
92-
<View style={styles.buttonWrapper}>
93-
<WalletAction
94-
iconName={IconName.Arrow2Upright}
95-
onPress={onSend}
96-
iconStyle={styles.icon}
97-
containerStyle={styles.containerStyle}
98-
iconSize={AvatarSize.Lg}
99-
disabled={!canSignTransactions}
100-
actionID={TokenOverviewSelectorsIDs.SEND_BUTTON}
101-
/>
102-
<Text variant={TextVariant.BodyMD}>
103-
{strings('asset_overview.send_button')}
104-
</Text>
105-
</View>
94+
{isEvmNetworkSelected && (
95+
<View style={styles.buttonWrapper}>
96+
<WalletAction
97+
iconName={IconName.Arrow2Upright}
98+
onPress={onSend}
99+
iconStyle={styles.icon}
100+
containerStyle={styles.containerStyle}
101+
iconSize={AvatarSize.Lg}
102+
disabled={!canSignTransactions}
103+
actionID={TokenOverviewSelectorsIDs.SEND_BUTTON}
104+
/>
105+
<Text variant={TextVariant.BodyMD}>
106+
{strings('asset_overview.send_button')}
107+
</Text>
108+
</View>
109+
)}
106110
<View style={styles.buttonWrapper}>
107111
<WalletAction
108112
iconName={IconName.QrCode}

0 commit comments

Comments
 (0)