Skip to content

fix: update onboarding copy and links for default privacy settings #14971

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

Merged
merged 3 commits into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion app/components/UI/ManageNetworks/ManageNetworks.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
// Third party dependencies.
import React from 'react';

import { Linking } from 'react-native';
// Internal dependencies.
import ManageNetworks from './ManageNetworks';
import renderWithProvider from '../../../util/test/renderWithProvider';
import { useNavigation } from '@react-navigation/native';
import { useSelector } from 'react-redux';
import { selectNetworkName } from '../../../selectors/networkInfos';
import AppConstants from '../../../core/AppConstants';
import { fireEvent } from '@testing-library/react-native';

jest.mock('react-native/Libraries/Linking/Linking', () => ({
addEventListener: jest.fn(),
removeEventListener: jest.fn(),
openURL: jest.fn(),
}));

jest.mock('@react-navigation/native', () => {
const actualReactNavigation = jest.requireActual('@react-navigation/native');
Expand Down Expand Up @@ -35,4 +43,27 @@ describe('ManageNetworks', () => {
);
expect(toJSON()).toMatchSnapshot();
});

it.each([
[
{
link: AppConstants.URLS.PRIVACY_POLICY_2024,
testId: 'privacy-policy-link',
},
{
link: AppConstants.URLS.ADD_SOLANA_ACCOUNT_PRIVACY_POLICY,
testId: 'solana-privacy-policy-link',
},
],
])('opens link %link', ({ link, testId }) => {
useSelector.mockImplementation((selector) => {
if (selector === selectNetworkName) return mockNetworkName;
});
const { getByTestId } = renderWithProvider(
<ManageNetworks navigation={useNavigation()} />,
);
const button = getByTestId(testId);
fireEvent.press(button);
expect(Linking.openURL).toHaveBeenCalledWith(link);
});
});
21 changes: 18 additions & 3 deletions app/components/UI/ManageNetworks/ManageNetworks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ export default function ManageNetworksComponent() {
);
}, [navigation, trackEvent, chainId, createEventBuilder]);

const handleLink = () => {
const openPrivacyPolicyLink = useCallback(() => {
Linking.openURL(AppConstants.URLS.PRIVACY_POLICY_2024);
};
}, []);

const openAddSolanaAccountPrivacyPolicyLink = useCallback(() => {
Linking.openURL(AppConstants.URLS.ADD_SOLANA_ACCOUNT_PRIVACY_POLICY);
}, []);

return (
<View style={styles.setting}>
Expand All @@ -60,10 +64,21 @@ export default function ManageNetworksComponent() {
style={styles.description}
>
{strings('default_settings.manage_networks_body')}
<Text color={TextColor.Info} onPress={handleLink}>
<Text
color={TextColor.Info}
testID="privacy-policy-link"
onPress={openPrivacyPolicyLink}
>
{strings('default_settings.privacy_policy')}
</Text>
{strings('default_settings.manage_networks_body2')}
<Text
color={TextColor.Info}
testID="solana-privacy-policy-link"
onPress={openAddSolanaAccountPrivacyPolicyLink}
>
{strings('default_settings.manage_networks_body3')}
</Text>
</Text>
<PickerNetwork
label={networkName}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,28 @@ exports[`ManageNetworks should render correctly 1`] = `
"lineHeight": 24,
}
}
testID="privacy-policy-link"
>
Privacy policy
</Text>
to learn more about how Infura handles data.
to learn more about how Infura handles data for EVM accounts, for Solana accounts
<Text
accessibilityRole="text"
onPress={[Function]}
style={
{
"color": "#4459ff",
"fontFamily": "CentraNo1-Book",
"fontSize": 16,
"fontWeight": "400",
"letterSpacing": 0,
"lineHeight": 24,
}
}
testID="solana-privacy-policy-link"
>
click here.
</Text>
</Text>
<TouchableOpacity
disabled={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,28 @@ exports[`OnboardingGeneralSettings should render correctly 1`] = `
"lineHeight": 24,
}
}
testID="privacy-policy-link"
>
Privacy policy
</Text>
to learn more about how Infura handles data.
to learn more about how Infura handles data for EVM accounts, for Solana accounts
<Text
accessibilityRole="text"
onPress={[Function]}
style={
{
"color": "#4459ff",
"fontFamily": "CentraNo1-Book",
"fontSize": 16,
"fontWeight": "400",
"letterSpacing": 0,
"lineHeight": 24,
}
}
testID="solana-privacy-policy-link"
>
click here.
</Text>
</Text>
<TouchableOpacity
disabled={false}
Expand Down
1 change: 1 addition & 0 deletions app/core/AppConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export default {
SMART_TXS:
'https://support.metamask.io/transactions-and-gas/transactions/smart-transactions/',
STAKING_RISK_DISCLOSURE: 'https://consensys.io/staking-risk-disclosures',
ADD_SOLANA_ACCOUNT_PRIVACY_POLICY: 'https://support.metamask.io/configure/accounts/how-to-add-accounts-in-your-wallet/#solana-accounts'
},
DECODING_API_URL: process.env.DECODING_API_URL || 'https://signature-insights.api.cx.metamask.io/v1',
ERRORS: {
Expand Down
3 changes: 2 additions & 1 deletion locales/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3719,7 +3719,8 @@
"basic_functionality": "Basic functionality",
"manage_networks": "Choose your network",
"manage_networks_body": "We use Infura as our remote procedure call (RPC) provider to offer the most reliable and private access to Ethereum data we can. You can choose your own RPC, but remember that any RPC will receive your IP address and Ethereum wallet to make transactions. Read our ",
"manage_networks_body2": " to learn more about how Infura handles data.",
"manage_networks_body2": " to learn more about how Infura handles data for EVM accounts, for Solana accounts ",
"manage_networks_body3": "click here.",
"functionality_body": "MetaMask offers basic features like token details and gas settings through internet services. When you use internet services, your IP address is shared, in this case with MetaMask. This is just like when you visit any website. MetaMask uses this data temporarily and never sells your data. You can use a VPN or turn off these services, but it may affect your MetaMask experience. Read our ",
"functionality_body2": " to learn more.",
"sheet": {
Expand Down
Loading