diff --git a/.eslintrc.js b/.eslintrc.js index 94d1bf66c66..df74ef0d17d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -29,6 +29,7 @@ module.exports = { ignoreRestSiblings: true, // this line is what has changed }, ], + '@typescript-eslint/no-explicit-any': 'error', }, }, { diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 65a071f0a94..d6f7046d844 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,7 +4,9 @@ * @MetaMask/mobile-devs app/component-library/ @MetaMask/design-system-engineers @MetaMask/mobile-platform patches/ @MetaMask/mobile-platform -bitrise.yml @MetaMask/mobile-platform +bitrise.yml @MetaMask/supply-chain @MetaMask/mobile-platform +yarn.lock @MetaMask/supply-chain @MetaMask/mobile-platform +ios/Podfile.lock @MetaMask/supply-chain @MetaMask/mobile-platform app/components/UI/Ramp/ @MetaMask/ramp @MetaMask/mobile-platform app/reducers/fiatOrders/ @MetaMask/ramp @MetaMask/mobile-platform app/components/Views/confirmations @MetaMask/confirmations @MetaMask/mobile-platform @@ -27,3 +29,7 @@ app/core/Encryptor/ @MetaMask/accounts-engineers # Swaps Team app/components/UI/Swaps @MetaMask/swaps-engineers @MetaMask/mobile-platform + +# LavaMoat Team +ses.cjs @MetaMask/supply-chain +patches/react-native+0.*.patch @MetaMask/supply-chain diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 0eaf7de40fd..c20c7c41357 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -4,5 +4,5 @@ contact_links: url: https://community.metamask.io/c/feature-requests-ideas/ about: Request new features and vote on the ones that are important to you - name: Get support or ask a question - url: https://metamask.zendesk.com/hc/en-us + url: https://support.metamask.io about: Use the MetaMask support system to get help and ask questions diff --git a/CHANGELOG.md b/CHANGELOG.md index f6d2e701c83..7a30a43dd6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,86 @@ ## Current Main Branch +## 7.24.2 - Jun 13, 2024 +### Added +- [#9687](https://github.com/MetaMask/metamask-mobile/pull/9687): feat: adds "data collection for marketing" toggles + +### Fixed +- [#9905](https://github.com/MetaMask/metamask-mobile/pull/9905): fix: remove metametrics redundant calls and improve compliance + +## 7.24.1 - Jun 13, 2024 +### Fixed +- [#9943](https://github.com/MetaMask/metamask-mobile/pull/9943): fix: Remove duplicate accounts (#9943) +- [#10006](https://github.com/MetaMask/metamask-mobile/pull/10006): fix: Fix order of accounts (#10006) +- [#10004](https://github.com/MetaMask/metamask-mobile/pull/10004): fix: Synchronize account names (#10004) +- [#9974](https://github.com/MetaMask/metamask-mobile/pull/9974): fix: Fix freeze on buy and sell flow (#9974) +- [#9980](https://github.com/MetaMask/metamask-mobile/pull/9980): fix: Fix initialization crash / login error "Engine does not exist (#9980) + +## 7.24.0 - Jun 11, 2024 +### Added +- [#9767](https://github.com/MetaMask/metamask-mobile/pull/9767): feat: push Privacy policy date to 2024 Jun 18 12:00 UTC (#9767) +- [#9707](https://github.com/MetaMask/metamask-mobile/pull/9707): feat: adds strings for the opt in toggles (#9707) +- [#9661](https://github.com/MetaMask/metamask-mobile/pull/9661): feat: smart-tx opt in modal 2 (#9661) +- [#9448](https://github.com/MetaMask/metamask-mobile/pull/9448): feat: smart tx small views (#9448) +- [#9442](https://github.com/MetaMask/metamask-mobile/pull/9442): feat: smart-tx-small-logic (#9442) +- [#9204](https://github.com/MetaMask/metamask-mobile/pull/9204): feat: Add new privacy policy alert toast (#9204) +- [#9651](https://github.com/MetaMask/metamask-mobile/pull/9651): feat: Upgrade signature Controller to v14 (#9651) +- [#9394](https://github.com/MetaMask/metamask-mobile/pull/9394): feat: Network & Gas & Assets & Utils controllers update (#9394) +- [#9625](https://github.com/MetaMask/metamask-mobile/pull/9625): feat: Update signature controller v13 (#9625) +- [#9129](https://github.com/MetaMask/metamask-mobile/pull/9129): feat: setting to show fiat values on testnets (#9129) +- [#9740](https://github.com/MetaMask/metamask-mobile/pull/9740): feat: Update checkbox to be able to override checkbox style (#9740) +- [#9346](https://github.com/MetaMask/metamask-mobile/pull/9346): feat: notifications LIST screen UI - [9 of 10] (#9346) +- [#9572](https://github.com/MetaMask/metamask-mobile/pull/9572): feat: notifications onboarding wizard - [8 of 10] (#9572) + +### Changed +- [#9612](https://github.com/MetaMask/metamask-mobile/pull/9612): revert: feat(swaps): enable Base for swaps (#9286) (#9612) +- [#9735](https://github.com/MetaMask/metamask-mobile/pull/9735): chore: add swaps team to swaps domain folder (#9735) +- [#9683](https://github.com/MetaMask/metamask-mobile/pull/9683): refactor: the network name and image utils into selectors (#9683) +- [#9639](https://github.com/MetaMask/metamask-mobile/pull/9639): chore: New Crowdin translations by Github Action (#9639) +- [#9725](https://github.com/MetaMask/metamask-mobile/pull/9725): chore: make test code dev env only (#9725) +- [#9574](https://github.com/MetaMask/metamask-mobile/pull/9574): chore: update confirmations codeowners (#9574) +- [#9663](https://github.com/MetaMask/metamask-mobile/pull/9663): chore: update tx controller v13 patch notes (#9663) +- [#9629](https://github.com/MetaMask/metamask-mobile/pull/9629): chore: apply string changes from #9565 (#9629) +- [#9753](https://github.com/MetaMask/metamask-mobile/pull/9753): chore: Chore/optimize Wallet screen re-renders (#9753) +- [#9771](https://github.com/MetaMask/metamask-mobile/pull/9771): chore: align main and flask build numbers (#9771) +- [#9751](https://github.com/MetaMask/metamask-mobile/pull/9751): test: disable flakey test (#9751) +- [#9708](https://github.com/MetaMask/metamask-mobile/pull/9708): test: add send to saved contact e2e test (#9708) +- [#9690](https://github.com/MetaMask/metamask-mobile/pull/9690): test: Address App launch times failure test (#9690) +- [#9694](https://github.com/MetaMask/metamask-mobile/pull/9694): test: send flow page object refactor (#9694) +- [#9658](https://github.com/MetaMask/metamask-mobile/pull/9658): chore: Upgrade react-native-svg to 15.3 (#9658) +- [#9657](https://github.com/MetaMask/metamask-mobile/pull/9657): chore: Update boost checksum (#9657) +- [#9609](https://github.com/MetaMask/metamask-mobile/pull/9609): chore: add deprecated tag to the websiteicon component (#9609) +- [#9619](https://github.com/MetaMask/metamask-mobile/pull/9619): chore(deps): remove unused react-native-v8 (#9619) +- [#9599](https://github.com/MetaMask/metamask-mobile/pull/9599): chore: update Encryptor CODEOWNER to Accounts Team (#9599) +- [#9734](https://github.com/MetaMask/metamask-mobile/pull/9734): test: Added swap ERC20->ETH test case (#9734) +- [#9712](https://github.com/MetaMask/metamask-mobile/pull/9712): chore: remove unnecessary patch imports and change the patch branch name (#9712) + +### Fixed +- [#9301](https://github.com/MetaMask/metamask-mobile/pull/9301): fix: flaky tests issues template skip 2 (#9301) +- [#9774](https://github.com/MetaMask/metamask-mobile/pull/9774): fix: unit tests (#9774) +- [#9706](https://github.com/MetaMask/metamask-mobile/pull/9706): fix: QR scanner crash when user dismisses camera view in web view (#9706) +- [#9787](https://github.com/MetaMask/metamask-mobile/pull/9787): fix: revert use of sponge not available in actions Ubuntu image (#9787) +- [#9780](https://github.com/MetaMask/metamask-mobile/pull/9780): fix: make version setting script work with both main and flask (#9780) +- [#9721](https://github.com/MetaMask/metamask-mobile/pull/9721): fix: App slower when changing account and switching network (#9721) +- [#9775](https://github.com/MetaMask/metamask-mobile/pull/9775): fix: Update boost checksum (#9775) +- [#9772](https://github.com/MetaMask/metamask-mobile/pull/9772): fix: Fix/ruby install (#9772) +- [#9773](https://github.com/MetaMask/metamask-mobile/pull/9773): fix: e2e builds (#9773) +- [#9742](https://github.com/MetaMask/metamask-mobile/pull/9742): fix: Selecting custom ethereum mainnet on fresh install (#9742) +- [#9733](https://github.com/MetaMask/metamask-mobile/pull/9733): fix: Fix/9662 account section disappears (#9733) +- [#9699](https://github.com/MetaMask/metamask-mobile/pull/9699): fix: Move permission middleware to be later than rpc method middleware (#9699) +- [#9680](https://github.com/MetaMask/metamask-mobile/pull/9680): fix: Increase waiting for swaps and switch account on E2E (#9680) +- [#9656](https://github.com/MetaMask/metamask-mobile/pull/9656): fix: Fix/1723 broken sign verification (#9656) +- [#9630](https://github.com/MetaMask/metamask-mobile/pull/9630): fix: Fix/rn svg pod files (#9630) +- [#9614](https://github.com/MetaMask/metamask-mobile/pull/9614): fix: migrations key numbers (#9614) +- [#9611](https://github.com/MetaMask/metamask-mobile/pull/9611): fix: Fix/9345 bitrise cache failure (#9611) +- [#9696](https://github.com/MetaMask/metamask-mobile/pull/9696): fix(devDeps): @lavamoat/allow-scripts@^2.3.1->^3.0.4 (#9696) +- [#9685](https://github.com/MetaMask/metamask-mobile/pull/9685): fix(deps): @metamask/eth-sig-util@^4.0.1->^7.0.2 (#9685) +- [#9682](https://github.com/MetaMask/metamask-mobile/pull/9682): fix: update base nickname (#9682) +- [#9686](https://github.com/MetaMask/metamask-mobile/pull/9686): fix: update sepolia nickname (#9686) +- [#9764](https://github.com/MetaMask/metamask-mobile/pull/9764): fix: selectSelectedInternalAccount: Account with ID not found (#9764) +- [#9568](https://github.com/MetaMask/metamask-mobile/pull/9568): fix: 9559 issue android json parse (#9568) +- [#9616](https://github.com/MetaMask/metamask-mobile/pull/9616): fix: fix the issue 9560 which QR code accounts has been reappeared aftter user `remove wallets` (#9616) + ## 7.23.0 - May 10, 2024 ### Added - [#9595](https://github.com/MetaMask/metamask-mobile/pull/9595): feat: Upgrade to react-native-svg to 15.2.0 (#9595) diff --git a/Gemfile.lock b/Gemfile.lock index 97f857fb537..e9c4de67225 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -75,8 +75,10 @@ GEM netrc (0.11.0) nkf (0.2.0) public_suffix (4.0.7) - rexml (3.2.6) + rexml (3.2.8) + strscan (>= 3.0.9) ruby-macho (2.5.1) + strscan (3.1.0) typhoeus (1.4.1) ethon (>= 0.9.0) tzinfo (2.0.6) diff --git a/android/app/build.gradle b/android/app/build.gradle index e89826b1770..b7c7b5d720e 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -181,8 +181,8 @@ android { applicationId "io.metamask" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 1333 - versionName "7.23.0" + versionCode 1348 + versionName "7.24.2" testBuildType System.getProperty('testBuildType', 'debug') missingDimensionStrategy 'react-native-camera', 'general' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/component-library/base-components/TagBase/TagBase.stories.tsx b/app/component-library/base-components/TagBase/TagBase.stories.tsx index 7dde24a53c7..ff50ddebe89 100644 --- a/app/component-library/base-components/TagBase/TagBase.stories.tsx +++ b/app/component-library/base-components/TagBase/TagBase.stories.tsx @@ -65,6 +65,8 @@ export const TagBase = { endAccessory: false, includesBorder: false, }, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any render: (args: any) => ( { const { theme, vars } = params; const { style, shape, containerSize, severity, includesBorder } = vars; diff --git a/app/component-library/base-components/TagBase/__snapshots__/TagBase.test.tsx.snap b/app/component-library/base-components/TagBase/__snapshots__/TagBase.test.tsx.snap index 70ab6d178d9..83e43c56ae7 100644 --- a/app/component-library/base-components/TagBase/__snapshots__/TagBase.test.tsx.snap +++ b/app/component-library/base-components/TagBase/__snapshots__/TagBase.test.tsx.snap @@ -9,11 +9,11 @@ exports[`TagBase should render TagBase 1`] = ` { "alignItems": "center", "alignSelf": "flex-start", - "backgroundColor": "#FFFFFF", - "borderColor": "#BBC0C5", + "backgroundColor": "#ffffff", + "borderColor": "#bbc0c5", "borderRadius": 999, "borderWidth": 0, - "color": "#24272A", + "color": "#141618", "flexDirection": "row", "padding": 16, "paddingHorizontal": 8, @@ -23,7 +23,7 @@ exports[`TagBase should render TagBase 1`] = ` testID="tagbase" > ( { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const [error, setError] = useState(undefined); const [svgSource, setSvgSource] = useState(''); const { styles } = useStyles(stylesheet, { style }); @@ -38,6 +40,8 @@ const AvatarFavicon = ({ [setError], ); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const onSvgError = useCallback((e: any) => setError(e), [setError]); // TODO add the fallback with uppercase letter initial @@ -55,6 +59,8 @@ const AvatarFavicon = ({ const response = await fetch(uri, { method: 'HEAD' }); const contentType = response.headers.get('Content-Type'); return contentType?.includes('image/svg+xml'); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (err: any) { return false; } @@ -80,6 +86,8 @@ const AvatarFavicon = ({ height="100%" uri={svgSource} style={styles.image} + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any onError={(e: any) => onSvgError(e)} /> ) : null; diff --git a/app/component-library/components/Avatars/Avatar/variants/AvatarIcon/__snapshots__/AvatarIcon.test.tsx.snap b/app/component-library/components/Avatars/Avatar/variants/AvatarIcon/__snapshots__/AvatarIcon.test.tsx.snap index 9086ebeb045..6c4f0afa310 100644 --- a/app/component-library/components/Avatars/Avatar/variants/AvatarIcon/__snapshots__/AvatarIcon.test.tsx.snap +++ b/app/component-library/components/Avatars/Avatar/variants/AvatarIcon/__snapshots__/AvatarIcon.test.tsx.snap @@ -6,7 +6,7 @@ exports[`AvatarIcon should render correctly 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "justifyContent": "center", } } diff --git a/app/component-library/components/Avatars/Avatar/variants/AvatarNetwork/AvatarNetwork.stories.tsx b/app/component-library/components/Avatars/Avatar/variants/AvatarNetwork/AvatarNetwork.stories.tsx index 4e03aedb347..76c943bc692 100644 --- a/app/component-library/components/Avatars/Avatar/variants/AvatarNetwork/AvatarNetwork.stories.tsx +++ b/app/component-library/components/Avatars/Avatar/variants/AvatarNetwork/AvatarNetwork.stories.tsx @@ -29,6 +29,8 @@ const AvatarNetworkMeta = { export default AvatarNetworkMeta; export const AvatarNetwork = { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any render: (args: any) => ( ( { const findOverflowCounter = ( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any node: ShallowWrapper, ) => node.prop('testID') === STACKED_AVATARS_OVERFLOW_COUNTER_ID; diff --git a/app/component-library/components/Avatars/AvatarGroup/__snapshots__/AvatarGroup.test.tsx.snap b/app/component-library/components/Avatars/AvatarGroup/__snapshots__/AvatarGroup.test.tsx.snap index b5458f98d9e..260892299c1 100644 --- a/app/component-library/components/Avatars/AvatarGroup/__snapshots__/AvatarGroup.test.tsx.snap +++ b/app/component-library/components/Avatars/AvatarGroup/__snapshots__/AvatarGroup.test.tsx.snap @@ -24,7 +24,7 @@ exports[`AvatarGroup should render correctly 1`] = ` style={ [ { - "borderColor": "#FFFFFF", + "borderColor": "#ffffff", "borderRadius": 50, "borderWidth": 1, "position": "absolute", @@ -50,7 +50,7 @@ exports[`AvatarGroup should render correctly 1`] = ` style={ [ { - "borderColor": "#FFFFFF", + "borderColor": "#ffffff", "borderRadius": 50, "borderWidth": 1, "position": "absolute", @@ -76,7 +76,7 @@ exports[`AvatarGroup should render correctly 1`] = ` style={ [ { - "borderColor": "#FFFFFF", + "borderColor": "#ffffff", "borderRadius": 50, "borderWidth": 1, "position": "absolute", @@ -102,7 +102,7 @@ exports[`AvatarGroup should render correctly 1`] = ` style={ [ { - "borderColor": "#FFFFFF", + "borderColor": "#ffffff", "borderRadius": 50, "borderWidth": 1, "position": "absolute", @@ -135,7 +135,7 @@ exports[`AvatarGroup should render correctly 1`] = ` style={ { "bottom": 2, - "color": "#535A61", + "color": "#6a737d", "marginLeft": 2, } } diff --git a/app/component-library/components/Badges/Badge/Badge.test.tsx b/app/component-library/components/Badges/Badge/Badge.test.tsx index b0cf5aa0550..94032146f46 100644 --- a/app/component-library/components/Badges/Badge/Badge.test.tsx +++ b/app/component-library/components/Badges/Badge/Badge.test.tsx @@ -12,6 +12,7 @@ import Badge from './Badge'; import { BADGE_BADGENETWORK_TEST_ID, BADGE_BADGESTATUS_TEST_ID, + BADGE_BADGENOTIFICATIONS_TEST_ID, } from './Badge.constants'; describe('Badge', () => { @@ -36,4 +37,18 @@ describe('Badge', () => { ); expect(contentElement.exists()).toBe(true); }); + + it('should render badge notifications given the badge notification variant', () => { + const wrapper = shallow( + , + ); + expect(wrapper).toMatchSnapshot(); + const contentElement = wrapper.findWhere( + (node) => node.prop('testID') === BADGE_BADGENOTIFICATIONS_TEST_ID, + ); + expect(contentElement.exists()).toBe(true); + }); }); diff --git a/app/component-library/components/Badges/Badge/__snapshots__/Badge.test.tsx.snap b/app/component-library/components/Badges/Badge/__snapshots__/Badge.test.tsx.snap index 97556606f4a..9d09c20a3ed 100644 --- a/app/component-library/components/Badges/Badge/__snapshots__/Badge.test.tsx.snap +++ b/app/component-library/components/Badges/Badge/__snapshots__/Badge.test.tsx.snap @@ -14,6 +14,13 @@ exports[`Badge should render badge network given the badge network variant 1`] = /> `; +exports[`Badge should render badge notifications given the badge notification variant 1`] = ` + +`; + exports[`Badge should render badge status given the badge status variant 1`] = ` { +describe('BadgeNotifications', () => { it('should render badge notifications correctly', () => { const { toJSON } = render( , ); expect(toJSON()).toMatchSnapshot(); }); }); - -describe('BadgeNotifications', () => { - it('should render badge notifications with the given content', () => { - const { findByTestId } = render( - , - ); - - expect(findByTestId(BADGE_NOTIFICATIONS_TEST_ID)).toBeTruthy(); - }); -}); diff --git a/app/component-library/components/Badges/Badge/variants/BadgeNotifications/BadgeNotifications.tsx b/app/component-library/components/Badges/Badge/variants/BadgeNotifications/BadgeNotifications.tsx index 2616c60029f..42d096ee46e 100644 --- a/app/component-library/components/Badges/Badge/variants/BadgeNotifications/BadgeNotifications.tsx +++ b/app/component-library/components/Badges/Badge/variants/BadgeNotifications/BadgeNotifications.tsx @@ -9,16 +9,19 @@ import Icon, { IconSize, IconColor } from '../../../../Icons/Icon'; // Internal dependencies import { BadgeNotificationsProps } from './BadgeNotifications.types'; import styleSheet from './BadgeNotifications.styles'; -import { BADGE_NOTIFICATIONS_TEST_ID } from './BadgeNotifications.constants'; -const BadgeNotifications = ({ style, iconName }: BadgeNotificationsProps) => { +const BadgeNotifications = ({ + style, + iconName, + testID, +}: BadgeNotificationsProps) => { const { size: containerSize, onLayout: onLayoutContainerSize } = useComponentSize(); const { styles } = useStyles(styleSheet, { style, containerSize }); return ( diff --git a/app/component-library/components/Badges/Badge/variants/BadgeNotifications/BadgeNotifications.types.ts b/app/component-library/components/Badges/Badge/variants/BadgeNotifications/BadgeNotifications.types.ts index 974cbc244f6..3958e6c5a49 100644 --- a/app/component-library/components/Badges/Badge/variants/BadgeNotifications/BadgeNotifications.types.ts +++ b/app/component-library/components/Badges/Badge/variants/BadgeNotifications/BadgeNotifications.types.ts @@ -11,6 +11,10 @@ export interface BadgeNotificationsProps * Required prop to provide the icon to be used by the notification badge. */ iconName: IconName; + /** + * Optional prop to provide testID to be used by the notification badge unit tests. + */ + testID?: string; } /** diff --git a/app/component-library/components/Badges/Badge/variants/BadgeNotifications/__snapshots__/BadgeNotifications.test.tsx.snap b/app/component-library/components/Badges/Badge/variants/BadgeNotifications/__snapshots__/BadgeNotifications.test.tsx.snap index e61b30a7be5..7e8c03ce7ab 100644 --- a/app/component-library/components/Badges/Badge/variants/BadgeNotifications/__snapshots__/BadgeNotifications.test.tsx.snap +++ b/app/component-library/components/Badges/Badge/variants/BadgeNotifications/__snapshots__/BadgeNotifications.test.tsx.snap @@ -1,14 +1,14 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`BadgeNotifications - snapshots should render badge notifications correctly 1`] = ` +exports[`BadgeNotifications should render badge notifications correctly 1`] = ` { const { badge, anchorElementShape, ...props } = args; let badgeProps: BadgeProps; diff --git a/app/component-library/components/Badges/BadgeWrapper/__snapshots__/BadgeWrapper.test.tsx.snap b/app/component-library/components/Badges/BadgeWrapper/__snapshots__/BadgeWrapper.test.tsx.snap index f663a700f9e..f618c0d96ee 100644 --- a/app/component-library/components/Badges/BadgeWrapper/__snapshots__/BadgeWrapper.test.tsx.snap +++ b/app/component-library/components/Badges/BadgeWrapper/__snapshots__/BadgeWrapper.test.tsx.snap @@ -16,7 +16,7 @@ exports[`BadgeWrapper should render BadgeWrapper correctly 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 12, "height": 24, "justifyContent": "center", diff --git a/app/component-library/components/Banners/Banner/__snapshots__/Banner.test.tsx.snap b/app/component-library/components/Banners/Banner/__snapshots__/Banner.test.tsx.snap index 6141b319bf3..6190781fd07 100644 --- a/app/component-library/components/Banners/Banner/__snapshots__/Banner.test.tsx.snap +++ b/app/component-library/components/Banners/Banner/__snapshots__/Banner.test.tsx.snap @@ -4,8 +4,8 @@ exports[`Banner should render correctly 1`] = ` ( ( ( ( = ({ }); const onBlurHandler = useCallback( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (e: any) => { if (!isDisabled) { setIsFocused(false); @@ -53,6 +55,8 @@ const TextField: React.FC = ({ ); const onFocusHandler = useCallback( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (e: any) => { if (!isDisabled) { setIsFocused(true); diff --git a/app/component-library/components/Form/TextField/__snapshots__/TextField.test.tsx.snap b/app/component-library/components/Form/TextField/__snapshots__/TextField.test.tsx.snap index e2cfa5ed4a3..96b84e5d5da 100644 --- a/app/component-library/components/Form/TextField/__snapshots__/TextField.test.tsx.snap +++ b/app/component-library/components/Form/TextField/__snapshots__/TextField.test.tsx.snap @@ -5,8 +5,8 @@ exports[`TextField should render default settings correctly 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", - "borderColor": "#BBC0C5", + "backgroundColor": "#ffffff", + "borderColor": "#bbc0c5", "borderRadius": 8, "borderWidth": 1, "flexDirection": "row", diff --git a/app/component-library/components/Form/TextField/foundation/Input/Input.tsx b/app/component-library/components/Form/TextField/foundation/Input/Input.tsx index 5adf9970365..facc8e6e6fd 100644 --- a/app/component-library/components/Form/TextField/foundation/Input/Input.tsx +++ b/app/component-library/components/Form/TextField/foundation/Input/Input.tsx @@ -35,6 +35,8 @@ const Input: React.FC = ({ }); const onBlurHandler = useCallback( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (e: any) => { if (!isDisabled) { setIsFocused(false); @@ -45,6 +47,8 @@ const Input: React.FC = ({ ); const onFocusHandler = useCallback( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (e: any) => { if (!isDisabled) { setIsFocused(true); diff --git a/app/component-library/components/Form/TextField/foundation/Input/__snapshots__/Input.test.tsx.snap b/app/component-library/components/Form/TextField/foundation/Input/__snapshots__/Input.test.tsx.snap index 0d6bf1aa44c..99a88ffc241 100644 --- a/app/component-library/components/Form/TextField/foundation/Input/__snapshots__/Input.test.tsx.snap +++ b/app/component-library/components/Form/TextField/foundation/Input/__snapshots__/Input.test.tsx.snap @@ -8,10 +8,10 @@ exports[`Input should render correctly 1`] = ` onFocus={[Function]} style={ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderColor": "transparent", "borderWidth": 1, - "color": "#24272A", + "color": "#141618", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", diff --git a/app/component-library/components/HeaderBase/__snapshots__/HeaderBase.test.tsx.snap b/app/component-library/components/HeaderBase/__snapshots__/HeaderBase.test.tsx.snap index 127d9629d55..f83d54f918f 100644 --- a/app/component-library/components/HeaderBase/__snapshots__/HeaderBase.test.tsx.snap +++ b/app/component-library/components/HeaderBase/__snapshots__/HeaderBase.test.tsx.snap @@ -5,7 +5,7 @@ exports[`HeaderBase should render snapshot correctly 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "flexDirection": "row", } } @@ -35,7 +35,7 @@ exports[`HeaderBase should render snapshot correctly 1`] = ` accessibilityRole="text" style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "Euclid Circular B", "fontSize": 16, "fontWeight": "700", diff --git a/app/component-library/components/Icons/Icon/Icon.styles.ts b/app/component-library/components/Icons/Icon/Icon.styles.ts index f2ac8ef9c49..fce092d9666 100644 --- a/app/component-library/components/Icons/Icon/Icon.styles.ts +++ b/app/component-library/components/Icons/Icon/Icon.styles.ts @@ -8,6 +8,8 @@ import { StyleSheet, ImageStyle } from 'react-native'; * @param params.vars Inputs that the style sheet depends on. * @returns StyleSheet object. */ +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const styleSheet = (params: { vars: any }) => { const { vars: { style, size }, diff --git a/app/component-library/components/Icons/Icon/__snapshots__/Icon.test.tsx.snap b/app/component-library/components/Icons/Icon/__snapshots__/Icon.test.tsx.snap index c40db4829a0..d56be0cd7c4 100644 --- a/app/component-library/components/Icons/Icon/__snapshots__/Icon.test.tsx.snap +++ b/app/component-library/components/Icons/Icon/__snapshots__/Icon.test.tsx.snap @@ -2,7 +2,7 @@ exports[`Icon renders correctly 1`] = ` ( diff --git a/app/component-library/components/List/ListItemMultiSelect/__snapshots__/ListItemMultiSelect.test.tsx.snap b/app/component-library/components/List/ListItemMultiSelect/__snapshots__/ListItemMultiSelect.test.tsx.snap index 82190784c54..8ad70722b3d 100644 --- a/app/component-library/components/List/ListItemMultiSelect/__snapshots__/ListItemMultiSelect.test.tsx.snap +++ b/app/component-library/components/List/ListItemMultiSelect/__snapshots__/ListItemMultiSelect.test.tsx.snap @@ -6,7 +6,7 @@ exports[`ListItemMultiSelect should render snapshot correctly 1`] = ` style={ { "alignItems": "flex-start", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 4, "opacity": 1, "padding": 16, @@ -41,8 +41,8 @@ exports[`ListItemMultiSelect should render snapshot correctly 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", - "borderColor": "#24272A", + "backgroundColor": "#ffffff", + "borderColor": "#141618", "borderRadius": 4, "borderWidth": 2, "height": 20, diff --git a/app/component-library/components/List/ListItemSelect/ListItemSelect.stories.tsx b/app/component-library/components/List/ListItemSelect/ListItemSelect.stories.tsx index da4b68061e3..2db739f57b8 100644 --- a/app/component-library/components/List/ListItemSelect/ListItemSelect.stories.tsx +++ b/app/component-library/components/List/ListItemSelect/ListItemSelect.stories.tsx @@ -27,6 +27,8 @@ const ListItemSelectMeta = { export default ListItemSelectMeta; export const ListItemSelect = { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any render: (args: any) => ( diff --git a/app/component-library/components/List/ListItemSelect/__snapshots__/ListItemSelect.test.tsx.snap b/app/component-library/components/List/ListItemSelect/__snapshots__/ListItemSelect.test.tsx.snap index 5f8d2fabf53..4199cc4eb07 100644 --- a/app/component-library/components/List/ListItemSelect/__snapshots__/ListItemSelect.test.tsx.snap +++ b/app/component-library/components/List/ListItemSelect/__snapshots__/ListItemSelect.test.tsx.snap @@ -5,7 +5,7 @@ exports[`ListItemSelect should render snapshot correctly 1`] = ` disabled={false} style={ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 4, "opacity": 1, "padding": 16, diff --git a/app/component-library/components/Modals/ModalConfirmation/__snapshots__/ModalConfirmation.test.tsx.snap b/app/component-library/components/Modals/ModalConfirmation/__snapshots__/ModalConfirmation.test.tsx.snap index a4a854ec896..99a488ff4d7 100644 --- a/app/component-library/components/Modals/ModalConfirmation/__snapshots__/ModalConfirmation.test.tsx.snap +++ b/app/component-library/components/Modals/ModalConfirmation/__snapshots__/ModalConfirmation.test.tsx.snap @@ -12,7 +12,7 @@ exports[`ModalConfirmation should render correctly 1`] = ` { const { colors } = useTheme(); @@ -143,8 +137,7 @@ const ModalMandatory = ({ route }: MandatoryModalProps) => { ]} > @@ -216,11 +209,11 @@ const ModalMandatory = ({ route }: MandatoryModalProps) => { return ( - + {renderHeader()} {body.source === 'WebView' ? renderWebView(body.uri) : renderBody()} @@ -228,7 +221,7 @@ const ModalMandatory = ({ route }: MandatoryModalProps) => { style={styles.checkboxContainer} onPress={handleSelect} activeOpacity={1} - {...generateTestId(Platform, TERMS_OF_USE_CHECKBOX_ICON_ID)} + testID={TermsOfUseModalSelectorsIDs.CHECKBOX} > {checkboxText} @@ -245,7 +238,7 @@ const ModalMandatory = ({ route }: MandatoryModalProps) => { ...buttonBackgroundColor(), }} onPress={onPress} - {...generateTestId(Platform, buttonTestId)} + testID={buttonTestId} /> {isScrollToEndNeeded && renderScrollEndButton()} {footerHelpText ? ( diff --git a/app/component-library/components/Navigation/TabBar/TabBar.stories.tsx b/app/component-library/components/Navigation/TabBar/TabBar.stories.tsx index dd595674360..50389c64ea7 100644 --- a/app/component-library/components/Navigation/TabBar/TabBar.stories.tsx +++ b/app/component-library/components/Navigation/TabBar/TabBar.stories.tsx @@ -29,6 +29,8 @@ const TabBarStorybook = () => { { name: 'WalletRoute', key: 'WalletRoute' }, { name: 'BrowserRoute', key: 'BrowserRoute' }, ]; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const mockTabBarProps: any = { state: { routes, @@ -62,6 +64,8 @@ const TabBarStorybook = () => { const TabBarMeta = { title: 'Component Library / Navigation', decorators: [ + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (Story: any) => ( diff --git a/app/component-library/components/Navigation/TabBar/TabBar.test.tsx b/app/component-library/components/Navigation/TabBar/TabBar.test.tsx index 86c0296057d..e009d59d2bf 100644 --- a/app/component-library/components/Navigation/TabBar/TabBar.test.tsx +++ b/app/component-library/components/Navigation/TabBar/TabBar.test.tsx @@ -86,7 +86,11 @@ describe('TabBar', () => { const { toJSON } = renderWithProvider( } + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any descriptors={descriptors as any} + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any navigation={navigation as any} />, { state: mockInitialState }, @@ -98,7 +102,11 @@ describe('TabBar', () => { const { getByTestId } = renderWithProvider( } + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any descriptors={descriptors as any} + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any navigation={navigation as any} />, { state: mockInitialState }, diff --git a/app/component-library/components/Navigation/TabBar/TabBar.tsx b/app/component-library/components/Navigation/TabBar/TabBar.tsx index c9658dab766..9ec1e39f408 100644 --- a/app/component-library/components/Navigation/TabBar/TabBar.tsx +++ b/app/component-library/components/Navigation/TabBar/TabBar.tsx @@ -33,6 +33,8 @@ const TabBar = ({ state, descriptors, navigation }: TabBarProps) => { /** * Current onboarding wizard step */ + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const wizardStep = useSelector((reduxState: any) => reduxState.wizard.step); /** * Return current step of onboarding wizard if not step 5 nor 0 diff --git a/app/component-library/components/Navigation/TabBar/__snapshots__/TabBar.test.tsx.snap b/app/component-library/components/Navigation/TabBar/__snapshots__/TabBar.test.tsx.snap index e985649aa96..08ee293ae8f 100644 --- a/app/component-library/components/Navigation/TabBar/__snapshots__/TabBar.test.tsx.snap +++ b/app/component-library/components/Navigation/TabBar/__snapshots__/TabBar.test.tsx.snap @@ -5,7 +5,7 @@ exports[`TabBar renders correctly 1`] = ` ( console.log("I'm clicked!")} /> ), diff --git a/app/component-library/components/Pickers/PickerAccount/__snapshots__/PickerAccount.test.tsx.snap b/app/component-library/components/Pickers/PickerAccount/__snapshots__/PickerAccount.test.tsx.snap index e6fe5a7dc72..ab2934d2b21 100644 --- a/app/component-library/components/Pickers/PickerAccount/__snapshots__/PickerAccount.test.tsx.snap +++ b/app/component-library/components/Pickers/PickerAccount/__snapshots__/PickerAccount.test.tsx.snap @@ -6,8 +6,8 @@ exports[`PickerAccount should render correctly 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", - "borderColor": "#BBC0C5", + "backgroundColor": "#ffffff", + "borderColor": "#bbc0c5", "borderRadius": 4, "borderWidth": 1, "flexDirection": "row", @@ -26,7 +26,7 @@ exports[`PickerAccount should render correctly 1`] = ` ( ( { const { vars } = params; const { style } = vars; diff --git a/app/component-library/components/Select/SelectButton/foundation/__snapshots__/SelectButtonBase.test.tsx.snap b/app/component-library/components/Select/SelectButton/foundation/__snapshots__/SelectButtonBase.test.tsx.snap index 21040a18017..ef82c878dd0 100644 --- a/app/component-library/components/Select/SelectButton/foundation/__snapshots__/SelectButtonBase.test.tsx.snap +++ b/app/component-library/components/Select/SelectButton/foundation/__snapshots__/SelectButtonBase.test.tsx.snap @@ -35,7 +35,7 @@ exports[`SelectButtonBase should render snapshot correctly 1`] = ` ( ( { const { vars } = params; const { style } = vars; diff --git a/app/component-library/components/Sheet/SheetBottom/__snapshots__/SheetBottom.test.tsx.snap b/app/component-library/components/Sheet/SheetBottom/__snapshots__/SheetBottom.test.tsx.snap index e7927f5278c..3d462325bf6 100644 --- a/app/component-library/components/Sheet/SheetBottom/__snapshots__/SheetBottom.test.tsx.snap +++ b/app/component-library/components/Sheet/SheetBottom/__snapshots__/SheetBottom.test.tsx.snap @@ -51,7 +51,7 @@ exports[`SheetBottom should render correctly on android: android 1`] = ` style={ [ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderTopLeftRadius": 16, "borderTopRightRadius": 16, "maxHeight": 1083, @@ -72,7 +72,7 @@ exports[`SheetBottom should render correctly on android: android 1`] = ` style={ { "alignSelf": "center", - "backgroundColor": "#D6D9DC", + "backgroundColor": "#bbc0c566", "borderRadius": 2, "height": 4, "marginTop": 4, @@ -137,7 +137,7 @@ exports[`SheetBottom should render correctly on ios: ios 1`] = ` style={ [ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderTopLeftRadius": 16, "borderTopRightRadius": 16, "maxHeight": 1083, @@ -158,7 +158,7 @@ exports[`SheetBottom should render correctly on ios: ios 1`] = ` style={ { "alignSelf": "center", - "backgroundColor": "#D6D9DC", + "backgroundColor": "#bbc0c566", "borderRadius": 2, "height": 4, "marginTop": 4, diff --git a/app/component-library/components/Sheet/SheetHeader/SheetHeader.stories.tsx b/app/component-library/components/Sheet/SheetHeader/SheetHeader.stories.tsx index 3336b041ba8..a0e7b8dbcf2 100644 --- a/app/component-library/components/Sheet/SheetHeader/SheetHeader.stories.tsx +++ b/app/component-library/components/Sheet/SheetHeader/SheetHeader.stories.tsx @@ -23,6 +23,8 @@ const SheetHeaderMeta = { export default SheetHeaderMeta; export const SheetHeader = { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any render: ({ title, actionButtonlabel }: any) => ( ( diff --git a/app/component-library/components/Tags/Tag/__snapshots__/Tag.test.tsx.snap b/app/component-library/components/Tags/Tag/__snapshots__/Tag.test.tsx.snap index c10992b7200..2cf1fc619e6 100644 --- a/app/component-library/components/Tags/Tag/__snapshots__/Tag.test.tsx.snap +++ b/app/component-library/components/Tags/Tag/__snapshots__/Tag.test.tsx.snap @@ -4,8 +4,8 @@ exports[`Tag should render correctly 1`] = ` ( { const { theme, vars } = params; const { variant, style, color } = vars; diff --git a/app/component-library/components/Texts/Text/__snapshots__/Text.test.tsx.snap b/app/component-library/components/Texts/Text/__snapshots__/Text.test.tsx.snap index bd2c817ebea..5b3145834ee 100644 --- a/app/component-library/components/Texts/Text/__snapshots__/Text.test.tsx.snap +++ b/app/component-library/components/Texts/Text/__snapshots__/Text.test.tsx.snap @@ -5,7 +5,7 @@ exports[`Text should render Text 1`] = ` accessibilityRole="text" style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "Euclid Circular B", "fontSize": 16, "fontWeight": "400", diff --git a/app/component-library/components/Texts/TextWithPrefixIcon/TextWithPrefixIcon.stories.tsx b/app/component-library/components/Texts/TextWithPrefixIcon/TextWithPrefixIcon.stories.tsx index d9eca3be9b4..7c6ed2b3e67 100644 --- a/app/component-library/components/Texts/TextWithPrefixIcon/TextWithPrefixIcon.stories.tsx +++ b/app/component-library/components/Texts/TextWithPrefixIcon/TextWithPrefixIcon.stories.tsx @@ -57,6 +57,8 @@ const TextWithPrefixIconMeta = { export default TextWithPrefixIconMeta; export const TextWithPrefixIcon = { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any render: ({ iconSize, iconName, iconColor, ...props }: any) => ( diff --git a/app/component-library/components/Toast/Toast.stories.tsx b/app/component-library/components/Toast/Toast.stories.tsx index b8a854a2a6e..e9710ed395c 100644 --- a/app/component-library/components/Toast/Toast.stories.tsx +++ b/app/component-library/components/Toast/Toast.stories.tsx @@ -22,6 +22,8 @@ const ToastMeta = { title: 'Component Library / Toast', component: ToastComponent, decorators: [ + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (Story: any) => ( @@ -43,9 +45,13 @@ const ToastMeta = { export default ToastMeta; export const Toast = { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any render: (args: any) => { // eslint-disable-next-line react-hooks/rules-of-hooks const { toastRef } = useContext(ToastContext); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any let otherToastProps: any; switch (args.variant) { diff --git a/app/components/Approvals/AddChainApproval/AddChainApproval.test.tsx b/app/components/Approvals/AddChainApproval/AddChainApproval.test.tsx index ab165ddae69..a41f3d290fc 100644 --- a/app/components/Approvals/AddChainApproval/AddChainApproval.test.tsx +++ b/app/components/Approvals/AddChainApproval/AddChainApproval.test.tsx @@ -7,11 +7,15 @@ import { ApprovalRequest } from '@metamask/approval-controller'; jest.mock('../../Views/confirmations/hooks/useApprovalRequest'); +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const mockApprovalRequest = (approvalRequest?: ApprovalRequest) => { ( useApprovalRequest as jest.MockedFn ).mockReturnValue({ approvalRequest, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); }; @@ -23,6 +27,8 @@ describe('AddChainApproval', () => { it('renders', () => { mockApprovalRequest({ type: ApprovalTypes.ADD_ETHEREUM_CHAIN, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); const wrapper = shallow(); @@ -38,6 +44,8 @@ describe('AddChainApproval', () => { }); it('returns null if incorrect approval request type', () => { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any mockApprovalRequest({ type: ApprovalTypes.CONNECT_ACCOUNTS } as any); const wrapper = shallow(); diff --git a/app/components/Approvals/ConnectApproval/ConnectApproval.test.tsx b/app/components/Approvals/ConnectApproval/ConnectApproval.test.tsx index 2fed0ef1ce9..5917288a309 100644 --- a/app/components/Approvals/ConnectApproval/ConnectApproval.test.tsx +++ b/app/components/Approvals/ConnectApproval/ConnectApproval.test.tsx @@ -7,11 +7,15 @@ import ConnectApproval from './ConnectApproval'; jest.mock('../../Views/confirmations/hooks/useApprovalRequest'); +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const mockApprovalRequest = (approvalRequest?: ApprovalRequest) => { ( useApprovalRequest as jest.MockedFn ).mockReturnValue({ approvalRequest, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); }; @@ -23,6 +27,8 @@ describe('ConnectApproval', () => { it('renders', () => { mockApprovalRequest({ type: ApprovalTypes.CONNECT_ACCOUNTS, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); const wrapper = shallow(); @@ -38,6 +44,8 @@ describe('ConnectApproval', () => { }); it('sets isVisible to false if incorrect approval request type', () => { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any mockApprovalRequest({ type: ApprovalTypes.ADD_ETHEREUM_CHAIN } as any); const wrapper = shallow(); diff --git a/app/components/Approvals/ConnectApproval/ConnectApproval.tsx b/app/components/Approvals/ConnectApproval/ConnectApproval.tsx index a95ee20254c..9c9222175b1 100644 --- a/app/components/Approvals/ConnectApproval/ConnectApproval.tsx +++ b/app/components/Approvals/ConnectApproval/ConnectApproval.tsx @@ -5,6 +5,8 @@ import ApprovalModal from '../ApprovalModal'; import AccountApproval from '../../UI/AccountApproval'; export interface ConnectApprovalProps { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any navigation: any; } diff --git a/app/components/Approvals/FlowLoaderModal/FlowLoaderModal.test.tsx b/app/components/Approvals/FlowLoaderModal/FlowLoaderModal.test.tsx index bc4ac05ca3d..462942cc574 100644 --- a/app/components/Approvals/FlowLoaderModal/FlowLoaderModal.test.tsx +++ b/app/components/Approvals/FlowLoaderModal/FlowLoaderModal.test.tsx @@ -17,17 +17,23 @@ const APPROVAL_FLOW_MOCK: ApprovalFlowState = { loadingText: 'testLoadingText', }; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const mockApprovalRequest = (approvalRequest?: ApprovalRequest) => { ( useApprovalRequest as jest.MockedFn ).mockReturnValue({ approvalRequest, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); }; const mockApprovalFlow = (approvalFlow?: ApprovalFlowState) => { (useApprovalFlow as jest.MockedFn).mockReturnValue({ approvalFlow, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); }; @@ -55,6 +61,8 @@ describe('FlowLoaderModal', () => { it('returns null if approval request', () => { mockApprovalFlow(APPROVAL_FLOW_MOCK); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any mockApprovalRequest({ type: ApprovalTypes.CONNECT_ACCOUNTS } as any); const wrapper = shallow(); diff --git a/app/components/Approvals/InstallSnapApproval/InstallSnapApproval.tsx b/app/components/Approvals/InstallSnapApproval/InstallSnapApproval.tsx index a4b0ee63132..a9abea4aa60 100644 --- a/app/components/Approvals/InstallSnapApproval/InstallSnapApproval.tsx +++ b/app/components/Approvals/InstallSnapApproval/InstallSnapApproval.tsx @@ -39,6 +39,8 @@ const InstallSnapApproval = () => { } }, [approvalRequest]); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const getSnapName = (request: ApprovalRequest): string => { // We first look for the name inside the snapId approvalRequest data const snapId = request?.requestData?.snapId; @@ -51,6 +53,8 @@ const InstallSnapApproval = () => { // If there is no snapId present in the approvalRequest data, we look for the name inside the snapIds caveat const snapIdsCaveat = request?.requestData?.permissions?.wallet_snap?.caveats?.find( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (c: any) => c.type === 'snapIds', ); // return an empty string if we can't find the snap name in the approvalRequest data diff --git a/app/components/Approvals/InstallSnapApproval/InstallSnapApproval.types.ts b/app/components/Approvals/InstallSnapApproval/InstallSnapApproval.types.ts index 7f5cc0ad676..59b2c10f49f 100644 --- a/app/components/Approvals/InstallSnapApproval/InstallSnapApproval.types.ts +++ b/app/components/Approvals/InstallSnapApproval/InstallSnapApproval.types.ts @@ -1,5 +1,7 @@ ///: BEGIN:ONLY_INCLUDE_IF(snaps) interface InstallSnapFlowProps { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any approvalRequest: any; snapName: string; onConfirm: () => void; diff --git a/app/components/Approvals/InstallSnapApproval/test/InstallSnapApproval.test.tsx b/app/components/Approvals/InstallSnapApproval/test/InstallSnapApproval.test.tsx index 965dce1b3c2..a67acb452a7 100644 --- a/app/components/Approvals/InstallSnapApproval/test/InstallSnapApproval.test.tsx +++ b/app/components/Approvals/InstallSnapApproval/test/InstallSnapApproval.test.tsx @@ -20,6 +20,8 @@ jest.mock('../../../Views/confirmations/hooks/useApprovalRequest'); const onConfirm = jest.fn(); const onReject = jest.fn(); +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const mockApprovalRequest = (approvalRequest?: ApprovalRequest) => { ( useApprovalRequest as jest.MockedFn @@ -27,6 +29,8 @@ const mockApprovalRequest = (approvalRequest?: ApprovalRequest) => { approvalRequest, onConfirm, onReject, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); }; diff --git a/app/components/Approvals/PermissionApproval/PermissionApproval.test.tsx b/app/components/Approvals/PermissionApproval/PermissionApproval.test.tsx index 86ad746e141..3333b2b3501 100644 --- a/app/components/Approvals/PermissionApproval/PermissionApproval.test.tsx +++ b/app/components/Approvals/PermissionApproval/PermissionApproval.test.tsx @@ -35,15 +35,21 @@ const NAV_DETAILS_MOCK = [ }, ]; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const mockApprovalRequest = (approvalRequest?: ApprovalRequest) => { ( useApprovalRequest as jest.MockedFn ).mockReturnValue({ approvalRequest, onConfirm: jest.fn(), + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); }; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const mockCreateAccountConnectNavDetails = (details: any) => { ( createAccountConnectNavDetails as jest.MockedFn< @@ -52,6 +58,8 @@ const mockCreateAccountConnectNavDetails = (details: any) => { ).mockReturnValue(details); }; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const mockSelectorState = (state: any) => { (useSelector as jest.MockedFn).mockImplementation( (selector) => selector(state), @@ -86,6 +94,8 @@ describe('PermissionApproval', () => { mockApprovalRequest({ type: ApprovalTypes.REQUEST_PERMISSIONS, requestData: HOST_INFO_MOCK, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); mockCreateAccountConnectNavDetails(NAV_DETAILS_MOCK); @@ -110,6 +120,8 @@ describe('PermissionApproval', () => { mockApprovalRequest({ type: ApprovalTypes.REQUEST_PERMISSIONS, requestData: HOST_INFO_MOCK, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); mockCreateAccountConnectNavDetails(NAV_DETAILS_MOCK); @@ -161,6 +173,8 @@ describe('PermissionApproval', () => { mockApprovalRequest({ type: ApprovalTypes.ADD_ETHEREUM_CHAIN, requestData: HOST_INFO_MOCK, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); render(); @@ -176,6 +190,8 @@ describe('PermissionApproval', () => { mockApprovalRequest({ type: ApprovalTypes.REQUEST_PERMISSIONS, requestData: { ...HOST_INFO_MOCK, permissions: { eth_accounts: false } }, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); render(); @@ -193,6 +209,8 @@ describe('PermissionApproval', () => { mockApprovalRequest({ type: ApprovalTypes.REQUEST_PERMISSIONS, requestData: HOST_INFO_MOCK, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); const { rerender } = render( @@ -202,6 +220,8 @@ describe('PermissionApproval', () => { mockApprovalRequest({ type: ApprovalTypes.REQUEST_PERMISSIONS, requestData: HOST_INFO_MOCK, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); rerender(); @@ -219,6 +239,8 @@ describe('PermissionApproval', () => { mockApprovalRequest({ type: ApprovalTypes.REQUEST_PERMISSIONS, requestData: HOST_INFO_MOCK, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); const { rerender } = render( @@ -232,6 +254,8 @@ describe('PermissionApproval', () => { mockApprovalRequest({ type: ApprovalTypes.REQUEST_PERMISSIONS, requestData: HOST_INFO_MOCK, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); rerender(); diff --git a/app/components/Approvals/PermissionApproval/PermissionApproval.tsx b/app/components/Approvals/PermissionApproval/PermissionApproval.tsx index 4a12bdae5d8..a63b45b0076 100644 --- a/app/components/Approvals/PermissionApproval/PermissionApproval.tsx +++ b/app/components/Approvals/PermissionApproval/PermissionApproval.tsx @@ -9,6 +9,8 @@ import { selectAccountsLength } from '../../../selectors/accountTrackerControlle import { useMetrics } from '../../../components/hooks/useMetrics'; export interface PermissionApprovalProps { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any navigation: any; } diff --git a/app/components/Approvals/SignatureApproval/SignatureApproval.test.tsx b/app/components/Approvals/SignatureApproval/SignatureApproval.test.tsx index baaaf4a9573..ab463f5c3be 100644 --- a/app/components/Approvals/SignatureApproval/SignatureApproval.test.tsx +++ b/app/components/Approvals/SignatureApproval/SignatureApproval.test.tsx @@ -7,12 +7,16 @@ import SignatureApproval from './SignatureApproval'; jest.mock('../../Views/confirmations/hooks/useApprovalRequest'); +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const mockApprovalRequest = (approvalRequest?: ApprovalRequest) => { ( useApprovalRequest as jest.MockedFn ).mockReturnValue({ approvalRequest, onConfirm: jest.fn(), + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); }; @@ -31,6 +35,8 @@ describe('SignatureApproval', () => { mockApprovalRequest({ type: approvalType, requestData: { test: 'value' }, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); const wrapper = shallow(); @@ -47,6 +53,8 @@ describe('SignatureApproval', () => { }); it('provides no message params if incorrect approval request type', () => { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any mockApprovalRequest({ type: ApprovalTypes.ADD_ETHEREUM_CHAIN } as any); const wrapper = shallow(); diff --git a/app/components/Approvals/SwitchChainApproval/SwitchChainApproval.test.tsx b/app/components/Approvals/SwitchChainApproval/SwitchChainApproval.test.tsx index ac57bba0e20..4630f1984cc 100644 --- a/app/components/Approvals/SwitchChainApproval/SwitchChainApproval.test.tsx +++ b/app/components/Approvals/SwitchChainApproval/SwitchChainApproval.test.tsx @@ -16,12 +16,16 @@ jest.mock('react-redux', () => ({ const URL_MOCK = 'test.com'; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const mockApprovalRequest = (approvalRequest?: ApprovalRequest) => { ( useApprovalRequest as jest.MockedFn ).mockReturnValue({ approvalRequest, onConfirm: jest.fn(), + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); }; @@ -33,6 +37,8 @@ describe('SwitchChainApproval', () => { it('renders', () => { mockApprovalRequest({ type: ApprovalTypes.SWITCH_ETHEREUM_CHAIN, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); const wrapper = shallow(); @@ -48,6 +54,8 @@ describe('SwitchChainApproval', () => { }); it('returns null if incorrect approval request type', () => { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any mockApprovalRequest({ type: ApprovalTypes.ADD_ETHEREUM_CHAIN } as any); const wrapper = shallow(); @@ -60,6 +68,8 @@ describe('SwitchChainApproval', () => { requestData: { rpcUrl: URL_MOCK, }, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); const wrapper = shallow(); diff --git a/app/components/Approvals/TemplateConfirmationModal/TemplateConfirmationModal.test.tsx b/app/components/Approvals/TemplateConfirmationModal/TemplateConfirmationModal.test.tsx index 5f8b8097da8..2393346b8e4 100644 --- a/app/components/Approvals/TemplateConfirmationModal/TemplateConfirmationModal.test.tsx +++ b/app/components/Approvals/TemplateConfirmationModal/TemplateConfirmationModal.test.tsx @@ -7,11 +7,15 @@ import TemplateConfirmationModal from './TemplateConfirmationModal'; jest.mock('../../Views/confirmations/hooks/useApprovalRequest'); +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const mockApprovalRequest = (approvalRequest?: ApprovalRequest) => { ( useApprovalRequest as jest.MockedFn ).mockReturnValue({ approvalRequest, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); }; @@ -26,6 +30,8 @@ describe('TemplateConfirmationModal', () => { requestData: { test: 'value', }, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); const wrapper = shallow(); @@ -39,6 +45,8 @@ describe('TemplateConfirmationModal', () => { requestData: { test: 'value', }, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); const wrapper = shallow(); @@ -54,6 +62,8 @@ describe('TemplateConfirmationModal', () => { }); it('renders nothing if incorrect approval request type', () => { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any mockApprovalRequest({ type: ApprovalTypes.ADD_ETHEREUM_CHAIN } as any); const wrapper = shallow(); diff --git a/app/components/Approvals/TransactionApproval/TransactionApproval.test.tsx b/app/components/Approvals/TransactionApproval/TransactionApproval.test.tsx index 3c9eafa35b2..dd97d0722fb 100644 --- a/app/components/Approvals/TransactionApproval/TransactionApproval.test.tsx +++ b/app/components/Approvals/TransactionApproval/TransactionApproval.test.tsx @@ -14,12 +14,16 @@ jest.mock('../../UI/QRHardware/withQRHardwareAwareness', () => jest.fn((component) => component), ); +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const mockApprovalRequest = (approvalRequest?: ApprovalRequest) => { ( useApprovalRequest as jest.MockedFn ).mockReturnValue({ approvalRequest, onConfirm: jest.fn(), + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); }; @@ -31,6 +35,8 @@ describe('TransactionApproval', () => { it('renders approval component if transaction type is dapp', () => { mockApprovalRequest({ type: ApprovalTypes.TRANSACTION, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); const wrapper = shallow( @@ -43,6 +49,8 @@ describe('TransactionApproval', () => { it('renders approve component if transaction type is transaction', () => { mockApprovalRequest({ type: ApprovalTypes.TRANSACTION, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); const wrapper = shallow( @@ -57,6 +65,8 @@ describe('TransactionApproval', () => { it('renders QR signing modal if signing QR object', () => { mockApprovalRequest({ type: ApprovalTypes.TRANSACTION, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); const wrapper = shallow( @@ -77,6 +87,8 @@ describe('TransactionApproval', () => { it('returns null if incorrect approval request type', () => { mockApprovalRequest({ type: ApprovalTypes.ADD_ETHEREUM_CHAIN, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); const wrapper = shallow(); @@ -87,6 +99,8 @@ describe('TransactionApproval', () => { it('returns null if incorrect transaction type', () => { mockApprovalRequest({ type: ApprovalTypes.TRANSACTION, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); const wrapper = shallow(); diff --git a/app/components/Approvals/TransactionApproval/TransactionApproval.tsx b/app/components/Approvals/TransactionApproval/TransactionApproval.tsx index 4ee7b9e8d74..9c63edba82c 100644 --- a/app/components/Approvals/TransactionApproval/TransactionApproval.tsx +++ b/app/components/Approvals/TransactionApproval/TransactionApproval.tsx @@ -14,6 +14,8 @@ export enum TransactionModalType { export interface TransactionApprovalProps { transactionType?: TransactionModalType; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any navigation: any; onComplete: () => void; QRState?: IQRState; @@ -62,6 +64,8 @@ const TransactionApprovalInternal = (props: TransactionApprovalProps) => { return ( { }; export const TransactionApproval = withQRHardwareAwareness( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any TransactionApprovalInternal as any, ); diff --git a/app/components/Approvals/WalletConnectApproval/WalletConnectApproval.test.tsx b/app/components/Approvals/WalletConnectApproval/WalletConnectApproval.test.tsx index f773d5bb200..6531278cba7 100644 --- a/app/components/Approvals/WalletConnectApproval/WalletConnectApproval.test.tsx +++ b/app/components/Approvals/WalletConnectApproval/WalletConnectApproval.test.tsx @@ -7,11 +7,15 @@ import WalletConnectApproval from './WalletConnectApproval'; jest.mock('../../Views/confirmations/hooks/useApprovalRequest'); +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const mockApprovalRequest = (approvalRequest?: ApprovalRequest) => { ( useApprovalRequest as jest.MockedFn ).mockReturnValue({ approvalRequest, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); }; @@ -24,6 +28,8 @@ describe('WalletConnectApproval', () => { mockApprovalRequest({ type: ApprovalTypes.WALLET_CONNECT, requestData: {}, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); const wrapper = shallow(); @@ -37,6 +43,8 @@ describe('WalletConnectApproval', () => { requestData: { peerMeta: { name: 'testName', url: 'testUrl', icons: ['testIcon'] }, }, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); const wrapper = shallow(); @@ -55,6 +63,8 @@ describe('WalletConnectApproval', () => { mockApprovalRequest({ type: ApprovalTypes.ADD_ETHEREUM_CHAIN, requestData: {}, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); const wrapper = shallow(); diff --git a/app/components/Approvals/WatchAssetApproval/WatchAssetApproval.test.tsx b/app/components/Approvals/WatchAssetApproval/WatchAssetApproval.test.tsx index be4cc50719c..003527502c2 100644 --- a/app/components/Approvals/WatchAssetApproval/WatchAssetApproval.test.tsx +++ b/app/components/Approvals/WatchAssetApproval/WatchAssetApproval.test.tsx @@ -7,11 +7,15 @@ import WatchAssetApproval from './WatchAssetApproval'; jest.mock('../../Views/confirmations/hooks/useApprovalRequest'); +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const mockApprovalRequest = (approvalRequest?: ApprovalRequest) => { ( useApprovalRequest as jest.MockedFn ).mockReturnValue({ approvalRequest, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); }; @@ -24,6 +28,8 @@ describe('WatchAssetApproval', () => { mockApprovalRequest({ type: ApprovalTypes.WATCH_ASSET, requestData: {}, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); const wrapper = shallow(); @@ -34,6 +40,8 @@ describe('WatchAssetApproval', () => { it('returns null if no request data', () => { mockApprovalRequest({ type: ApprovalTypes.WATCH_ASSET, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); const wrapper = shallow(); @@ -52,6 +60,8 @@ describe('WatchAssetApproval', () => { mockApprovalRequest({ type: ApprovalTypes.ADD_ETHEREUM_CHAIN, requestData: {}, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); const wrapper = shallow(); diff --git a/app/components/Base/Alert.tsx b/app/components/Base/Alert.tsx index db1a8122865..56c46c7e226 100644 --- a/app/components/Base/Alert.tsx +++ b/app/components/Base/Alert.tsx @@ -30,6 +30,8 @@ interface Props { children?: ReactNode; } +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const createStyles = (colors: any) => StyleSheet.create({ base: { @@ -69,6 +71,8 @@ const createStyles = (colors: any) => const getAlertStyles: ( alertType: AlertType, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any styles: StyleSheet.NamedStyles, ) => [StyleProp, StyleProp] = (alertType, styles) => { switch (alertType) { diff --git a/app/components/Nav/Main/MainNavigator.js b/app/components/Nav/Main/MainNavigator.js index d95e9dfb392..70810f5ad67 100644 --- a/app/components/Nav/Main/MainNavigator.js +++ b/app/components/Nav/Main/MainNavigator.js @@ -14,6 +14,7 @@ import SecuritySettings from '../../Views/Settings/SecuritySettings'; import ExperimentalSettings from '../../Views/Settings/ExperimentalSettings'; import NetworksSettings from '../../Views/Settings/NetworksSettings'; import NotificationsSettings from '../../Views/Settings/NotificationsSettings'; +import NotificationsDetails from '../../Views/Notifications/Details'; import OptIn from '../../Views/Notifications/OptIn'; import AppInformation from '../../Views/Settings/AppInformation'; import Contacts from '../../Views/Settings/Contacts'; @@ -79,6 +80,8 @@ import { getDecimalChainId } from '../../../util/networks'; import { useMetrics } from '../../../components/hooks/useMetrics'; import DeprecatedNetworkDetails from '../../UI/DeprecatedNetworkModal'; import ConfirmAddAsset from '../../UI/ConfirmAddAsset'; +import { AesCryptoTestForm } from '../../Views/AesCryptoTestForm'; +import { isTest } from '../../../util/test/utils'; const Stack = createStackNavigator(); const Tab = createBottomTabNavigator(); @@ -273,6 +276,21 @@ const SettingsFlow = () => ( name={Routes.RAMP.ACTIVATION_KEY_FORM} component={RampActivationKeyForm} /> + { + /** + * This screen should only accessed in test mode. + * It is used to test the AES crypto functions. + * + * If this is in production, it is a bug. + */ + isTest && ( + + ) + } ( ); -const NotificationsModeView = () => ( +/* eslint-disable react/prop-types */ +const NotificationsModeView = (props) => ( ( component={NotificationsSettings} options={NotificationsSettings.navigationOptions} /> + { + const [transactionMetaIdsForListening, setTransactionMetaIdsForListening] = + useState([]); + + const addTransactionMetaIdForListening = (txMetaId) => { + setTransactionMetaIdsForListening([ + ...transactionMetaIdsForListening, + txMetaId, + ]); + }; + + useEffect(() => { + // Cannot directly call trackSwaps from the event listener in autoSign due to stale closure of swapsTransactions + const [txMetaId, ...restTxMetaIds] = transactionMetaIdsForListening; + + if (txMetaId && swapsTransactions[txMetaId]) { + TransactionController.hub.once( + `${txMetaId}:confirmed`, + (transactionMeta) => { + if ( + swapsTransactions[transactionMeta.id]?.analytics && + swapsTransactions[transactionMeta.id]?.paramsForAnalytics + ) { + trackSwaps( + MetaMetricsEvents.SWAP_COMPLETED, + transactionMeta, + swapsTransactions, + ); + } + }, + ); + setTransactionMetaIdsForListening(restTxMetaIds); + } + }, [ + trackSwaps, + transactionMetaIdsForListening, + swapsTransactions, + TransactionController, + ]); + + return { + addTransactionMetaIdForListening, + transactionMetaIdsForListening, + }; +}; + const RootRPCMethodsUI = (props) => { const { trackEvent, trackAnonymousEvent } = useMetrics(); const [transactionModalType, setTransactionModalType] = useState(undefined); @@ -197,15 +247,22 @@ const RootRPCMethodsUI = (props) => { [ props.selectedAddress, props.shouldUseSmartTransaction, - trackEvent, trackAnonymousEvent, + trackEvent, ], ); + const { addTransactionMetaIdForListening } = useSwapConfirmedEvent({ + TransactionController: Engine.context.TransactionController, + swapsTransactions: props.swapsTransactions, + trackSwaps, + }); + const autoSign = useCallback( async (transactionMeta) => { const { TransactionController, KeyringController } = Engine.context; const swapsTransactions = props.swapsTransactions; + try { TransactionController.hub.once( `${transactionMeta.id}:finished`, @@ -227,21 +284,10 @@ const RootRPCMethodsUI = (props) => { } }, ); - TransactionController.hub.once( - `${transactionMeta.id}:confirmed`, - (transactionMeta) => { - if ( - swapsTransactions[transactionMeta.id]?.analytics && - swapsTransactions[transactionMeta.id]?.paramsForAnalytics - ) { - trackSwaps( - MetaMetricsEvents.SWAP_COMPLETED, - transactionMeta, - swapsTransactions, - ); - } - }, - ); + + // Queue txMetaId to listen for confirmation event + addTransactionMetaIdForListening(transactionMeta.id); + await KeyringController.resetQRKeyringState(); const isLedgerAccount = isHardwareAccount( @@ -281,7 +327,13 @@ const RootRPCMethodsUI = (props) => { } } }, - [props.navigation, props.swapsTransactions, trackSwaps, trackEvent], + [ + props.navigation, + trackSwaps, + trackEvent, + props.swapsTransactions, + addTransactionMetaIdForListening, + ], ); const onUnapprovedTransaction = useCallback( @@ -373,11 +425,7 @@ const RootRPCMethodsUI = (props) => { }); } - if ( - data && - data.substr(0, 10) === APPROVE_FUNCTION_SIGNATURE && - (!value || isZeroValue(value)) - ) { + if (isApprovalTransaction(data) && (!value || isZeroValue(value))) { setTransactionModalType(TransactionModalType.Transaction); } else { setTransactionModalType(TransactionModalType.Dapp); @@ -482,7 +530,7 @@ RootRPCMethodsUI.propTypes = { }; const mapStateToProps = (state) => ({ - selectedAddress: selectSelectedAddress(state), + selectedAddress: selectSelectedInternalAccountChecksummedAddress(state), chainId: selectChainId(state), tokens: selectTokens(state), swapsTransactions: diff --git a/app/components/Nav/Main/index.test.tsx b/app/components/Nav/Main/index.test.tsx index 7ebf162b490..965d5097ba7 100644 --- a/app/components/Nav/Main/index.test.tsx +++ b/app/components/Nav/Main/index.test.tsx @@ -1,8 +1,13 @@ +/* eslint-disable import/no-nodejs-modules */ import React from 'react'; import { shallow } from 'enzyme'; // eslint-disable-next-line import/named import { NavigationContainer } from '@react-navigation/native'; +import EventEmitter from 'events'; import Main from './'; +import { useSwapConfirmedEvent } from './RootRPCMethodsUI'; +import { renderHook, act } from '@testing-library/react-hooks'; +import { MetaMetricsEvents } from '../../hooks/useMetrics'; describe('Main', () => { it('should render correctly', () => { @@ -14,4 +19,131 @@ describe('Main', () => { const wrapper = shallow(); expect(wrapper).toMatchSnapshot(); }); + + describe('useSwapConfirmedEvent', () => { + const txMetaId = '04541dc0-2e69-11ef-b995-33aef2c88d1e'; + const swapsTransactions = { + [txMetaId]: { + action: 'swap', + analytics: { + available_quotes: 5, + best_quote_source: 'oneInchV5', + chain_id: '1', + custom_slippage: false, + network_fees_ETH: '0.00337', + network_fees_USD: '$12.04', + other_quote_selected: false, + request_type: 'Order', + token_from: 'ETH', + token_from_amount: '0.001254', + token_to: 'USDC', + token_to_amount: '4.440771', + }, + destinationAmount: '4440771', + destinationToken: { + address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', + decimals: 6, + }, + paramsForAnalytics: { + approvalTransactionMetaId: {}, + ethAccountBalance: '0xedfffbea734a07', + gasEstimate: '0x33024', + sentAt: '0x66732203', + }, + sourceAmount: '1254000000000000', + sourceAmountInFiat: '$4.47', + sourceToken: { + address: '0x0000000000000000000000000000000000000000', + decimals: 18, + }, + }, + }; + + it('queues transactionMeta ids correctly', () => { + const eventEmitter = new EventEmitter(); + + const { result } = renderHook(() => + useSwapConfirmedEvent({ + TransactionController: { + hub: eventEmitter, + }, + swapsTransactions: {}, // This has to be empty object, otherwise test fails + trackSwaps: jest.fn(), + }), + ); + act(() => { + result.current.addTransactionMetaIdForListening(txMetaId); + }); + + expect(result.current.transactionMetaIdsForListening).toEqual([txMetaId]); + }); + it('adds a listener for transaction confirmation on the TransactionController', () => { + const eventEmitter = new EventEmitter(); + + const { result } = renderHook(() => + useSwapConfirmedEvent({ + TransactionController: { + hub: eventEmitter, + }, + swapsTransactions, + trackSwaps: jest.fn(), + }), + ); + act(() => { + result.current.addTransactionMetaIdForListening(txMetaId); + }); + + expect(eventEmitter.listenerCount(`${txMetaId}:confirmed`)).toBe(1); + }); + it('tracks Swap Confirmed after transaction confirmed', () => { + const eventEmitter = new EventEmitter(); + const trackSwaps = jest.fn(); + const txMeta = { + id: txMetaId, + }; + + const { result } = renderHook(() => + useSwapConfirmedEvent({ + TransactionController: { + hub: eventEmitter, + }, + swapsTransactions, + trackSwaps, + }), + ); + act(() => { + result.current.addTransactionMetaIdForListening(txMetaId); + }); + eventEmitter.emit(`${txMetaId}:confirmed`, txMeta); + + expect(trackSwaps).toHaveBeenCalledWith( + MetaMetricsEvents.SWAP_COMPLETED, + txMeta, + swapsTransactions, + ); + }); + it('removes transactionMeta id after tracking', () => { + const eventEmitter = new EventEmitter(); + const trackSwaps = jest.fn(); + const txMeta = { + id: txMetaId, + }; + + const { result } = renderHook(() => + useSwapConfirmedEvent({ + TransactionController: { + hub: eventEmitter, + }, + swapsTransactions, + trackSwaps, + }), + ); + act(() => { + result.current.addTransactionMetaIdForListening(txMetaId); + }); + eventEmitter.emit(`${txMetaId}:confirmed`, txMeta); + + expect(result.current.transactionMetaIdsForListening).toEqual([]); + }); + }); }); diff --git a/app/components/UI/AccountApproval/__snapshots__/index.test.tsx.snap b/app/components/UI/AccountApproval/__snapshots__/index.test.tsx.snap index 9b8dd271ca4..9864f17e99f 100644 --- a/app/components/UI/AccountApproval/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/AccountApproval/__snapshots__/index.test.tsx.snap @@ -4,7 +4,7 @@ exports[`AccountApproval should render correctly 1`] = ` + + + + + + + > + 0xC496...a756 + ( + 0xC496...a756 ) @@ -306,13 +370,13 @@ exports[`AccountApproval should render correctly 1`] = ` { "0": { "alignSelf": "flex-start", - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 14, "fontWeight": "100", }, "1": undefined, - "color": "#24272A", + "color": "#141618", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -352,8 +416,8 @@ exports[`AccountApproval should render correctly 1`] = ` "padding": 15, }, { - "backgroundColor": "#FFFFFF", - "borderColor": "#535A61", + "backgroundColor": "#ffffff", + "borderColor": "#6a737d", "borderWidth": 1, }, [ @@ -388,7 +452,7 @@ exports[`AccountApproval should render correctly 1`] = ` "textAlign": "center", }, { - "color": "#535A61", + "color": "#6a737d", }, undefined, ], @@ -414,7 +478,7 @@ exports[`AccountApproval should render correctly 1`] = ` "padding": 15, }, { - "backgroundColor": "#0376C9", + "backgroundColor": "#0376c9", "minHeight": 50, }, [ @@ -450,7 +514,7 @@ exports[`AccountApproval should render correctly 1`] = ` "textAlign": "center", }, { - "color": "#FFFFFF", + "color": "#ffffff", }, undefined, ], diff --git a/app/components/UI/AccountApproval/index.js b/app/components/UI/AccountApproval/index.js index c2872f58347..037f1966f7d 100644 --- a/app/components/UI/AccountApproval/index.js +++ b/app/components/UI/AccountApproval/index.js @@ -25,7 +25,7 @@ import { } from '../../../selectors/networkController'; import { selectTokensLength } from '../../../selectors/tokensController'; import { selectAccountsLength } from '../../../selectors/accountTrackerController'; -import { selectSelectedAddress } from '../../../selectors/preferencesController'; +import { selectSelectedInternalAccountChecksummedAddress } from '../../../selectors/accountsController'; import AppConstants from '../../../../app/core/AppConstants'; import { shuffle } from 'lodash'; import SDKConnect from '../../../core/SDKConnect/SDKConnect'; @@ -376,7 +376,7 @@ class AccountApproval extends PureComponent { const mapStateToProps = (state) => ({ accountsLength: selectAccountsLength(state), tokensLength: selectTokensLength(state), - selectedAddress: selectSelectedAddress(state), + selectedAddress: selectSelectedInternalAccountChecksummedAddress(state), networkType: selectProviderType(state), chainId: selectChainId(state), }); diff --git a/app/components/UI/AccountApproval/index.test.tsx b/app/components/UI/AccountApproval/index.test.tsx index 87af67f7f05..75fc09d5abc 100644 --- a/app/components/UI/AccountApproval/index.test.tsx +++ b/app/components/UI/AccountApproval/index.test.tsx @@ -2,6 +2,7 @@ import React from 'react'; import AccountApproval from '.'; import initialBackgroundState from '../../../util/test/initial-background-state.json'; import renderWithProvider from '../../../util/test/renderWithProvider'; +import { MOCK_ACCOUNTS_CONTROLLER_STATE } from '../../../util/test/accountsControllerTestUtils'; jest.mock('../../../core/Engine', () => ({ context: { @@ -14,6 +15,13 @@ jest.mock('../../../core/Engine', () => ({ }, KeyringController: { getAccountKeyringType: () => Promise.resolve('HD Key Tree'), + state: { + keyrings: [ + { + accounts: ['0xC4955C0d639D99699Bfd7Ec54d9FaFEe40e4D272'], + }, + ], + }, }, }, })); @@ -22,6 +30,7 @@ const mockInitialState = { engine: { backgroundState: { ...initialBackgroundState, + AccountsController: MOCK_ACCOUNTS_CONTROLLER_STATE, }, }, }; diff --git a/app/components/UI/AccountFromToInfoCard/AccountFromToInfoCard.test.tsx b/app/components/UI/AccountFromToInfoCard/AccountFromToInfoCard.test.tsx index 2d3bf2bafbe..5f9914e8d3e 100644 --- a/app/components/UI/AccountFromToInfoCard/AccountFromToInfoCard.test.tsx +++ b/app/components/UI/AccountFromToInfoCard/AccountFromToInfoCard.test.tsx @@ -9,6 +9,15 @@ import { Transaction } from './AccountFromToInfoCard.types'; import AccountFromToInfoCard from '.'; import Engine from '../../../core/Engine'; import initialBackgroundState from '../../../util/test/initial-background-state.json'; +import { createMockAccountsControllerState } from '../../../util/test/accountsControllerTestUtils'; + +const MOCK_ADDRESS_1 = '0xe64dD0AB5ad7e8C5F2bf6Ce75C34e187af8b920A'; +const MOCK_ADDRESS_2 = '0x519d2CE57898513F676a5C3b66496c3C394c9CC7'; + +const MOCK_ACCOUNTS_CONTROLLER_STATE = createMockAccountsControllerState([ + MOCK_ADDRESS_1, + MOCK_ADDRESS_2, +]); const mockInitialState = { settings: {}, @@ -17,10 +26,10 @@ const mockInitialState = { ...initialBackgroundState, AccountTrackerController: { accounts: { - '0xe64dD0AB5ad7e8C5F2bf6Ce75C34e187af8b920A': { + [MOCK_ADDRESS_1]: { balance: 200, }, - '0x519d2CE57898513F676a5C3b66496c3C394c9CC7': { + [MOCK_ADDRESS_2]: { balance: 200, }, }, @@ -31,18 +40,19 @@ const mockInitialState = { }, }, PreferencesController: { - selectedAddress: '0xe64dD0AB5ad7e8C5F2bf6Ce75C34e187af8b920A', + selectedAddress: MOCK_ADDRESS_1, identities: { - '0xe64dD0AB5ad7e8C5F2bf6Ce75C34e187af8b920A': { - address: '0xe64dD0AB5ad7e8C5F2bf6Ce75C34e187af8b920A', + [MOCK_ADDRESS_1]: { + address: MOCK_ADDRESS_1, name: 'Account 1', }, - '0x519d2CE57898513F676a5C3b66496c3C394c9CC7': { - address: '0x519d2CE57898513F676a5C3b66496c3C394c9CC7', + [MOCK_ADDRESS_2]: { + address: MOCK_ADDRESS_2, name: 'Account 2', }, }, }, + AccountsController: MOCK_ACCOUNTS_CONTROLLER_STATE, }, }, }; @@ -70,6 +80,7 @@ jest.mock('../../../core/Engine', () => ({ ], }, }, + AccountsController: MOCK_ACCOUNTS_CONTROLLER_STATE, }, })); @@ -80,6 +91,8 @@ jest.mock('../../../util/ENSUtils', () => ({ jest.mock('react-redux', () => ({ ...jest.requireActual('react-redux'), + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any useSelector: (fn: any) => fn(mockInitialState), })); @@ -179,6 +192,8 @@ describe('AccountFromToInfoCard', () => { transactionToName: '0xF4e8263979A89Dc357d7f9F79533Febc7f3e287B', }; const { findByText } = renderWithProvider( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any , { state: mockInitialState }, ); @@ -194,6 +209,8 @@ describe('AccountFromToInfoCard', () => { }, transactionTo: '0x9004C7f302475BF5501fbc6254f69C64212A0d12', }; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (ENSCache.cache as any) = { '10x1': { name: 'test1.eth', @@ -232,6 +249,8 @@ describe('AccountFromToInfoCard', () => { value: '3a98', }, }; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any let mockGetERC20BalanceOf: any; beforeEach(() => { jest.useFakeTimers(); @@ -243,6 +262,8 @@ describe('AccountFromToInfoCard', () => { it('should render balance from AssetsContractController.getERC20BalanceOf if selectedAddress is different from fromAddress', async () => { const { findByText } = renderWithProvider( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any , { state: mockInitialState }, ); @@ -260,6 +281,8 @@ describe('AccountFromToInfoCard', () => { }, }; const { findByText } = renderWithProvider( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any , { state: mockInitialState }, ); diff --git a/app/components/UI/AccountFromToInfoCard/AccountFromToInfoCard.tsx b/app/components/UI/AccountFromToInfoCard/AccountFromToInfoCard.tsx index 4e5b10741ef..f567bfee7b7 100644 --- a/app/components/UI/AccountFromToInfoCard/AccountFromToInfoCard.tsx +++ b/app/components/UI/AccountFromToInfoCard/AccountFromToInfoCard.tsx @@ -172,6 +172,8 @@ const AccountFromToInfoCard = (props: AccountFromToInfoCardProps) => { ); }; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const mapStateToProps = (state: any) => ({ identities: selectIdentities(state), chainId: selectChainId(state), diff --git a/app/components/UI/AccountFromToInfoCard/__snapshots__/AccountFromToInfoCard.test.tsx.snap b/app/components/UI/AccountFromToInfoCard/__snapshots__/AccountFromToInfoCard.test.tsx.snap index 08c7e2b837e..0f197690731 100644 --- a/app/components/UI/AccountFromToInfoCard/__snapshots__/AccountFromToInfoCard.test.tsx.snap +++ b/app/components/UI/AccountFromToInfoCard/__snapshots__/AccountFromToInfoCard.test.tsx.snap @@ -31,7 +31,7 @@ exports[`AccountFromToInfoCard should match snapshot 1`] = ` accessibilityRole="text" style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 16, "fontWeight": "400", @@ -47,7 +47,7 @@ exports[`AccountFromToInfoCard should match snapshot 1`] = ` style={ [ { - "borderColor": "#BBC0C5", + "borderColor": "#bbc0c5", "borderRadius": 8, "borderWidth": 1, "flex": 1, @@ -58,7 +58,7 @@ exports[`AccountFromToInfoCard should match snapshot 1`] = ` "padding": 10, }, { - "borderColor": "#BBC0C5", + "borderColor": "#bbc0c5", }, ] } @@ -74,7 +74,7 @@ exports[`AccountFromToInfoCard should match snapshot 1`] = ` ({ resetState: jest.fn(), @@ -26,18 +30,12 @@ const mockInitialState = { ...initialBackgroundState, AccountTrackerController: { accounts: { - '0xC4955C0d639D99699Bfd7Ec54d9FaFEe40e4D272': { + [MOCK_ADDRESS_1]: { balance: '0x2', }, }, }, - PreferencesController: { - selectedAddress: '0xC4955C0d639D99699Bfd7Ec54d9FaFEe40e4D272', - identities: { - address: '0xC4955C0d639D99699Bfd7Ec54d9FaFEe40e4D272', - name: 'Account 1', - }, - }, + AccountsController: MOCK_ACCOUNTS_CONTROLLER_STATE, CurrencyRateController: { currentCurrency: 'inr', currencyRates: { diff --git a/app/components/UI/AccountOverview/__snapshots__/index.test.tsx.snap b/app/components/UI/AccountOverview/__snapshots__/index.test.tsx.snap index d39729be2c2..e1fc856aafc 100644 --- a/app/components/UI/AccountOverview/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/AccountOverview/__snapshots__/index.test.tsx.snap @@ -17,7 +17,7 @@ exports[`AccountOverview should render correctly 1`] = ` keyboardShouldPersistTaps="never" style={ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", } } > @@ -35,7 +35,7 @@ exports[`AccountOverview should render correctly 1`] = ` onPress={[Function]} style={ { - "borderColor": "#0376C9", + "borderColor": "#0376c9", "borderRadius": 80, "borderWidth": 2, "padding": 2, @@ -46,7 +46,7 @@ exports[`AccountOverview should render correctly 1`] = ` ({ - selectedAddress: selectSelectedAddress(state), + selectedAddress: selectSelectedInternalAccountChecksummedAddress(state), identities: selectIdentities(state), currentCurrency: selectCurrentCurrency(state), chainId: selectChainId(state), diff --git a/app/components/UI/AccountOverview/index.test.tsx b/app/components/UI/AccountOverview/index.test.tsx index 59ba0858837..90d3b464d96 100644 --- a/app/components/UI/AccountOverview/index.test.tsx +++ b/app/components/UI/AccountOverview/index.test.tsx @@ -4,8 +4,13 @@ import AccountOverview from './'; import initialBackgroundState from '../../../util/test/initial-background-state.json'; import Engine from '../../../core/Engine'; +import { + MOCK_ACCOUNTS_CONTROLLER_STATE, + MOCK_ADDRESS_1, +} from '../../../util/test/accountsControllerTestUtils'; const mockedEngine = Engine; + jest.mock('../../../core/Engine.ts', () => ({ init: () => mockedEngine.init({}), context: { @@ -14,7 +19,7 @@ jest.mock('../../../core/Engine.ts', () => ({ state: { keyrings: [ { - accounts: ['0x76cf1CdD1fcC252442b50D6e97207228aA4aefC3'], + accounts: ['0xC4955C0d639D99699Bfd7Ec54d9FaFEe40e4D272'], index: 0, type: 'HD Key Tree', }, @@ -30,8 +35,9 @@ const mockInitialState = { backgroundState: { ...initialBackgroundState, PreferencesController: { - selectedAddress: '0x76cf1CdD1fcC252442b50D6e97207228aA4aefC3', + selectedAddress: MOCK_ADDRESS_1, }, + AccountsController: MOCK_ACCOUNTS_CONTROLLER_STATE, }, }, }; diff --git a/app/components/UI/AccountRightButton/__snapshots__/index.test.tsx.snap b/app/components/UI/AccountRightButton/__snapshots__/index.test.tsx.snap index d8c30e5b6d2..c262dcb60a2 100644 --- a/app/components/UI/AccountRightButton/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/AccountRightButton/__snapshots__/index.test.tsx.snap @@ -331,7 +331,7 @@ exports[`AccountRightButton should render correctly 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 16, "borderWidth": 1, "height": 32, @@ -345,7 +345,7 @@ exports[`AccountRightButton should render correctly 1`] = ` accessibilityRole="text" style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "Euclid Circular B", "fontSize": 16, "fontWeight": "400", diff --git a/app/components/UI/AccountRightButton/index.tsx b/app/components/UI/AccountRightButton/index.tsx index 8db6547f66f..dacc103636d 100644 --- a/app/components/UI/AccountRightButton/index.tsx +++ b/app/components/UI/AccountRightButton/index.tsx @@ -64,6 +64,8 @@ const AccountRightButton = ({ const { trackEvent } = useMetrics(); const [isKeyboardVisible, setIsKeyboardVisible] = useState(false); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const accountAvatarType = useSelector((state: any) => state.settings.useBlockieIcon ? AvatarAccountType.Blockies diff --git a/app/components/UI/AccountSelectorList/AccountSelector.test.tsx b/app/components/UI/AccountSelectorList/AccountSelector.test.tsx index 6f4198feb5b..8961cd92278 100644 --- a/app/components/UI/AccountSelectorList/AccountSelector.test.tsx +++ b/app/components/UI/AccountSelectorList/AccountSelector.test.tsx @@ -8,15 +8,15 @@ import { View } from 'react-native'; import { ACCOUNT_BALANCE_BY_ADDRESS_TEST_ID } from '../../../../wdio/screen-objects/testIDs/Components/AccountListComponent.testIds'; import initialBackgroundState from '../../../util/test/initial-background-state.json'; import { regex } from '../../../../app/util/regex'; -import { MOCK_ACCOUNTS_CONTROLLER_STATE } from '../../../util/test/accountsControllerTestUtils'; -import { toChecksumAddress } from 'ethereumjs-util'; +import { createMockAccountsControllerState } from '../../../util/test/accountsControllerTestUtils'; -const MOCK_ACCOUNT_ADDRESSES = Object.values( - MOCK_ACCOUNTS_CONTROLLER_STATE.internalAccounts.accounts, -).map((account) => account.address); +const BUSINESS_ACCOUNT = '0xC4955C0d639D99699Bfd7Ec54d9FaFEe40e4D272'; +const PERSONAL_ACCOUNT = '0xd018538C87232FF95acbCe4870629b75640a78E7'; -const BUSINESS_ACCOUNT = toChecksumAddress(MOCK_ACCOUNT_ADDRESSES[0]); -const PERSONAL_ACCOUNT = toChecksumAddress(MOCK_ACCOUNT_ADDRESSES[1]); +const MOCK_ACCOUNTS_CONTROLLER_STATE = createMockAccountsControllerState([ + BUSINESS_ACCOUNT, + PERSONAL_ACCOUNT, +]); jest.mock('../../../util/address', () => { const actual = jest.requireActual('../../../util/address'); @@ -108,6 +108,8 @@ const AccountSelectorListRightAccessoryUseAccounts = () => { }; const renderComponent = ( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any state: any = {}, AccountSelectorListTest = AccountSelectorListUseAccounts, ) => renderWithProvider(, { state }); @@ -172,12 +174,12 @@ describe('AccountSelectorList', () => { expect(accounts.length).toBe(1); const businessAccountItem = await queryByTestId( - `${ACCOUNT_BALANCE_BY_ADDRESS_TEST_ID}-${PERSONAL_ACCOUNT}`, + `${ACCOUNT_BALANCE_BY_ADDRESS_TEST_ID}-${BUSINESS_ACCOUNT}`, ); - expect(within(businessAccountItem).getByText(regex.eth(2))).toBeDefined(); + expect(within(businessAccountItem).getByText(regex.eth(1))).toBeDefined(); expect( - within(businessAccountItem).getByText(regex.usd(6400)), + within(businessAccountItem).getByText(regex.usd(3200)), ).toBeDefined(); expect(toJSON()).toMatchSnapshot(); diff --git a/app/components/UI/AccountSelectorList/AccountSelectorList.tsx b/app/components/UI/AccountSelectorList/AccountSelectorList.tsx index a552c4443fb..8383e530089 100644 --- a/app/components/UI/AccountSelectorList/AccountSelectorList.tsx +++ b/app/components/UI/AccountSelectorList/AccountSelectorList.tsx @@ -46,10 +46,16 @@ const AccountSelectorList = ({ isAutoScrollEnabled = true, ...props }: AccountSelectorListProps) => { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const Engine = UntypedEngine as any; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const accountListRef = useRef(null); const accountsLengthRef = useRef(0); const { styles } = useStyles(styleSheet, {}); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const accountAvatarType = useSelector((state: any) => state.settings.useBlockieIcon ? AvatarAccountType.Blockies diff --git a/app/components/UI/AccountSelectorList/__snapshots__/AccountSelector.test.tsx.snap b/app/components/UI/AccountSelectorList/__snapshots__/AccountSelector.test.tsx.snap index 4b1dcedfd80..8b7c6c08b72 100644 --- a/app/components/UI/AccountSelectorList/__snapshots__/AccountSelector.test.tsx.snap +++ b/app/components/UI/AccountSelectorList/__snapshots__/AccountSelector.test.tsx.snap @@ -7,21 +7,21 @@ exports[`AccountSelectorList should render all accounts but only the balance for [ { "address": "0xC4955C0d639D99699Bfd7Ec54d9FaFEe40e4D272", - "assets": undefined, + "assets": { + "fiatBalance": "$3200.00 +1 ETH", + }, "balanceError": undefined, - "isSelected": false, + "isSelected": true, "name": "Account 1", "type": "HD Key Tree", "yOffset": 0, }, { - "address": "0xC4966c0D659D99699BFD7EB54D8fafEE40e4a756", - "assets": { - "fiatBalance": "$6400.00 -2 ETH", - }, + "address": "0xd018538C87232FF95acbCe4870629b75640a78E7", + "assets": undefined, "balanceError": undefined, - "isSelected": true, + "isSelected": false, "name": "Account 2", "type": "HD Key Tree", "yOffset": 78, @@ -59,7 +59,7 @@ exports[`AccountSelectorList should render all accounts but only the balance for onPress={[Function]} style={ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 4, "opacity": 1, "padding": 16, @@ -90,7 +90,7 @@ exports[`AccountSelectorList should render all accounts but only the balance for + + + + $3200.00 +1 ETH + + + + + + - 0xC496...a756 + 0xd018...78E7 - - - - $6400.00 -2 ETH - - - - - - @@ -346,19 +346,19 @@ exports[`AccountSelectorList should render all accounts with balances 1`] = ` 1 ETH", }, "balanceError": undefined, - "isSelected": false, + "isSelected": true, "name": "Account 1", "type": "HD Key Tree", "yOffset": 0, }, { - "address": "0xC4966c0D659D99699BFD7EB54D8fafEE40e4a756", + "address": "0xd018538C87232FF95acbCe4870629b75640a78E7", "assets": { "fiatBalance": "$6400.00 2 ETH", }, "balanceError": undefined, - "isSelected": true, + "isSelected": false, "name": "Account 2", "type": "HD Key Tree", "yOffset": 78, @@ -396,7 +396,7 @@ exports[`AccountSelectorList should render all accounts with balances 1`] = ` onPress={[Function]} style={ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 4, "opacity": 1, "padding": 16, @@ -427,7 +427,7 @@ exports[`AccountSelectorList should render all accounts with balances 1`] = ` + + + - 0xC496...a756 + 0xd018...78E7 - - - @@ -949,19 +949,19 @@ exports[`AccountSelectorList should render all accounts with right acessory 1`] 1 ETH", }, "balanceError": undefined, - "isSelected": false, + "isSelected": true, "name": "Account 1", "type": "HD Key Tree", "yOffset": 0, }, { - "address": "0xC4966c0D659D99699BFD7EB54D8fafEE40e4a756", + "address": "0xd018538C87232FF95acbCe4870629b75640a78E7", "assets": { "fiatBalance": "$6400.00 2 ETH", }, "balanceError": undefined, - "isSelected": true, + "isSelected": false, "name": "Account 2", "type": "HD Key Tree", "yOffset": 78, @@ -1000,7 +1000,7 @@ exports[`AccountSelectorList should render all accounts with right acessory 1`] onPress={[Function]} style={ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 4, "opacity": 1, "padding": 16, @@ -1031,7 +1031,7 @@ exports[`AccountSelectorList should render all accounts with right acessory 1`] - 0xC496...a756 + 0xd018...78E7 - 0xC4966c0D659D99699BFD7EB54D8fafEE40e4a756 - Account 2 + 0xd018538C87232FF95acbCe4870629b75640a78E7 - Account 2 @@ -1485,19 +1485,19 @@ exports[`AccountSelectorList should render correctly 1`] = ` 1 ETH", }, "balanceError": undefined, - "isSelected": false, + "isSelected": true, "name": "Account 1", "type": "HD Key Tree", "yOffset": 0, }, { - "address": "0xC4966c0D659D99699BFD7EB54D8fafEE40e4a756", + "address": "0xd018538C87232FF95acbCe4870629b75640a78E7", "assets": { "fiatBalance": "$6400.00 2 ETH", }, "balanceError": undefined, - "isSelected": true, + "isSelected": false, "name": "Account 2", "type": "HD Key Tree", "yOffset": 78, @@ -1535,7 +1535,7 @@ exports[`AccountSelectorList should render correctly 1`] = ` onPress={[Function]} style={ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 4, "opacity": 1, "padding": 16, @@ -1566,7 +1566,7 @@ exports[`AccountSelectorList should render correctly 1`] = ` + + + - 0xC496...a756 + 0xd018...78E7 - - - diff --git a/app/components/UI/ActionView/__snapshots__/index.test.tsx.snap b/app/components/UI/ActionView/__snapshots__/index.test.tsx.snap index 8c5548d987f..abfe114db4d 100644 --- a/app/components/UI/ActionView/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/ActionView/__snapshots__/index.test.tsx.snap @@ -101,8 +101,8 @@ exports[`ActionView should render correctly 1`] = ` "padding": 15, }, { - "backgroundColor": "#FFFFFF", - "borderColor": "#535A61", + "backgroundColor": "#ffffff", + "borderColor": "#6a737d", "borderWidth": 1, }, [ @@ -137,7 +137,7 @@ exports[`ActionView should render correctly 1`] = ` "textAlign": "center", }, { - "color": "#535A61", + "color": "#6a737d", }, undefined, ], @@ -162,8 +162,8 @@ exports[`ActionView should render correctly 1`] = ` "padding": 15, }, { - "backgroundColor": "#FFFFFF", - "borderColor": "#0376C9", + "backgroundColor": "#ffffff", + "borderColor": "#0376c9", "borderWidth": 1, }, [ @@ -200,7 +200,7 @@ exports[`ActionView should render correctly 1`] = ` "textAlign": "center", }, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, ], diff --git a/app/components/UI/AddCustomCollectible/index.tsx b/app/components/UI/AddCustomCollectible/index.tsx index d2e4b719018..a0bf94fd374 100644 --- a/app/components/UI/AddCustomCollectible/index.tsx +++ b/app/components/UI/AddCustomCollectible/index.tsx @@ -27,10 +27,12 @@ import { NFT_IDENTIFIER_INPUT_BOX_ID, } from '../../../../wdio/screen-objects/testIDs/Screens/NFTImportScreen.testIds'; import { selectChainId } from '../../../selectors/networkController'; -import { selectSelectedAddress } from '../../../selectors/preferencesController'; +import { selectSelectedInternalAccountChecksummedAddress } from '../../../selectors/accountsController'; import { getDecimalChainId } from '../../../util/networks'; import { useMetrics } from '../../../components/hooks/useMetrics'; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const createStyles = (colors: any) => StyleSheet.create({ wrapper: { @@ -42,6 +44,8 @@ const createStyles = (colors: any) => }, rowTitleText: { paddingBottom: 3, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any ...(fontStyles.normal as any), color: colors.text.default, }, @@ -50,17 +54,23 @@ const createStyles = (colors: any) => borderRadius: 4, borderColor: colors.border.default, padding: 16, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any ...(fontStyles.normal as any), color: colors.text.default, }, warningText: { marginTop: 15, color: colors.error.default, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any ...(fontStyles.normal as any), }, }); interface AddCustomCollectibleProps { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any navigation?: any; collectibleContract?: { address: string; @@ -80,12 +90,16 @@ const AddCustomCollectible = ({ Device.isAndroid() ? '99%' : undefined, ); const [loading, setLoading] = useState(false); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const assetTokenIdInput = React.createRef() as any; const { colors, themeAppearance } = useTheme(); const { trackEvent } = useMetrics(); const styles = createStyles(colors); - const selectedAddress = useSelector(selectSelectedAddress); + const selectedAddress = useSelector( + selectSelectedInternalAccountChecksummedAddress, + ); const chainId = useSelector(selectChainId); useEffect(() => { @@ -153,6 +167,8 @@ const AddCustomCollectible = ({ */ const validateCollectibleOwnership = async (): Promise => { try { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const { NftController } = Engine.context as any; const isOwner = await NftController.isNftOwner( selectedAddress, @@ -188,6 +204,8 @@ const AddCustomCollectible = ({ return; } + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const { NftController } = Engine.context as any; NftController.addNft(address, tokenId); diff --git a/app/components/UI/AddCustomToken/__snapshots__/index.test.tsx.snap b/app/components/UI/AddCustomToken/__snapshots__/index.test.tsx.snap index b48cbb19cd3..43ddb0bf6a8 100644 --- a/app/components/UI/AddCustomToken/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/AddCustomToken/__snapshots__/index.test.tsx.snap @@ -4,7 +4,7 @@ exports[`AddCustomToken render matches previous snapshot 1`] = ` @@ -125,7 +125,7 @@ exports[`AddCustomToken render matches previous snapshot 1`] = ` onPress={[Function]} style={ { - "color": "#0376C9", + "color": "#0376c9", } } suppressHighlighting={true} @@ -145,7 +145,7 @@ exports[`AddCustomToken render matches previous snapshot 1`] = ` StyleSheet.create({ addToAddressBookRoot: { diff --git a/app/components/UI/AddressCopy/AddressCopy.tsx b/app/components/UI/AddressCopy/AddressCopy.tsx index e25fbd155c0..80af16dcbeb 100644 --- a/app/components/UI/AddressCopy/AddressCopy.tsx +++ b/app/components/UI/AddressCopy/AddressCopy.tsx @@ -26,10 +26,8 @@ import generateTestId from '../../../../wdio/utils/generateTestId'; // Internal dependencies import styleSheet from './AddressCopy.styles'; import { AddressCopyProps } from './AddressCopy.types'; -import { - selectIdentities, - selectSelectedAddress, -} from '../../../selectors/preferencesController'; +import { selectIdentities } from '../../../selectors/preferencesController'; +import { selectSelectedInternalAccountChecksummedAddress } from '../../../selectors/accountsController'; import { useMetrics } from '../../../components/hooks/useMetrics'; const AddressCopy = ({ formatAddressType = 'full' }: AddressCopyProps) => { @@ -51,7 +49,9 @@ const AddressCopy = ({ formatAddressType = 'full' }: AddressCopyProps) => { /** * A string that represents the selected address */ - const selectedAddress = useSelector(selectSelectedAddress); + const selectedAddress = useSelector( + selectSelectedInternalAccountChecksummedAddress, + ); /** * An object containing each identity in the format address => account diff --git a/app/components/UI/AddressInputs/__snapshots__/index.test.jsx.snap b/app/components/UI/AddressInputs/__snapshots__/index.test.jsx.snap index d377f2057f6..be35d0b77fb 100644 --- a/app/components/UI/AddressInputs/__snapshots__/index.test.jsx.snap +++ b/app/components/UI/AddressInputs/__snapshots__/index.test.jsx.snap @@ -23,7 +23,7 @@ exports[`AddressInputs AddressFrom should match default snapshot 1`] = ` accessibilityRole="text" style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 16, "fontWeight": "400", @@ -39,7 +39,7 @@ exports[`AddressInputs AddressFrom should match default snapshot 1`] = ` style={ [ { - "borderColor": "#BBC0C5", + "borderColor": "#bbc0c5", "borderRadius": 8, "borderWidth": 1, "flex": 1, @@ -50,7 +50,7 @@ exports[`AddressInputs AddressFrom should match default snapshot 1`] = ` "padding": 10, }, { - "borderColor": "#BBC0C5", + "borderColor": "#bbc0c5", }, ] } @@ -66,7 +66,7 @@ exports[`AddressInputs AddressFrom should match default snapshot 1`] = ` StyleSheet.create({ logo: { @@ -53,7 +55,9 @@ const AssetIcon = memo((props: Props) => { const isImageUrl = isUrl(props.logo) || props.logo.substr(0, 4) === 'ipfs'; const source: ImageSourcePropType = isImageUrl ? { uri: props.logo } - : (staticLogos as any)[props.logo]; + : // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (staticLogos as any)[props.logo]; if (!source) { return null; diff --git a/app/components/UI/AssetOverview/AssetActionButton/__snapshots__/index.test.tsx.snap b/app/components/UI/AssetOverview/AssetActionButton/__snapshots__/index.test.tsx.snap index 03677293a3c..b9e1d907769 100644 --- a/app/components/UI/AssetOverview/AssetActionButton/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/AssetOverview/AssetActionButton/__snapshots__/index.test.tsx.snap @@ -20,7 +20,7 @@ exports[`AssetActionButtons should render correctly 1`] = ` { "alignContent": "center", "alignItems": "center", - "backgroundColor": "#0376C9", + "backgroundColor": "#0376c9", "borderRadius": 18, "height": 36, "justifyContent": "center", @@ -35,7 +35,7 @@ exports[`AssetActionButtons should render correctly 1`] = ` numberOfLines={1} style={ { - "color": "#0376C9", + "color": "#0376c9", "fontSize": 14, "marginHorizontal": 3, "marginTop": 8, @@ -67,7 +67,7 @@ exports[`AssetActionButtons should render type add correctly 1`] = ` { "alignContent": "center", "alignItems": "center", - "backgroundColor": "#0376C9", + "backgroundColor": "#0376c9", "borderRadius": 18, "height": 36, "justifyContent": "center", @@ -84,7 +84,7 @@ exports[`AssetActionButtons should render type add correctly 1`] = ` style={ { "alignContent": "center", - "color": "#FFFFFF", + "color": "#ffffff", "justifyContent": "center", "textAlign": "center", } @@ -96,7 +96,7 @@ exports[`AssetActionButtons should render type add correctly 1`] = ` numberOfLines={1} style={ { - "color": "#0376C9", + "color": "#0376c9", "fontSize": 14, "marginHorizontal": 3, "marginTop": 8, @@ -128,7 +128,7 @@ exports[`AssetActionButtons should render type information correctly 1`] = ` { "alignContent": "center", "alignItems": "center", - "backgroundColor": "#0376C9", + "backgroundColor": "#0376c9", "borderRadius": 18, "height": 36, "justifyContent": "center", @@ -145,7 +145,7 @@ exports[`AssetActionButtons should render type information correctly 1`] = ` style={ { "alignContent": "center", - "color": "#FFFFFF", + "color": "#ffffff", "justifyContent": "center", "textAlign": "center", } @@ -157,7 +157,7 @@ exports[`AssetActionButtons should render type information correctly 1`] = ` numberOfLines={1} style={ { - "color": "#0376C9", + "color": "#0376c9", "fontSize": 14, "marginHorizontal": 3, "marginTop": 8, @@ -189,7 +189,7 @@ exports[`AssetActionButtons should render type receive correctly 1`] = ` { "alignContent": "center", "alignItems": "center", - "backgroundColor": "#0376C9", + "backgroundColor": "#0376c9", "borderRadius": 18, "height": 36, "justifyContent": "center", @@ -201,14 +201,14 @@ exports[`AssetActionButtons should render type receive correctly 1`] = ` > void; }; asset: Asset; @@ -70,7 +72,9 @@ const AssetOverview: React.FC = ({ const primaryCurrency = useSelector( (state: RootStateOrAny) => state.settings.primaryCurrency, ); - const selectedAddress = useSelector(selectSelectedAddress); + const selectedAddress = useSelector( + selectSelectedInternalAccountChecksummedAddress, + ); const tokenExchangeRates = useSelector(selectContractExchangeRates); const tokenBalances = useSelector(selectContractBalances); const chainId = useSelector((state: RootStateOrAny) => selectChainId(state)); @@ -87,10 +91,14 @@ const AssetOverview: React.FC = ({ const dispatch = useDispatch(); useEffect(() => { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const { SwapsController } = Engine.context as { SwapsController: any }; const fetchTokenWithCache = async () => { try { await SwapsController.fetchTokenWithCache(); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (error: any) { Logger.error( error, diff --git a/app/components/UI/AssetOverview/Balance/__snapshots__/index.test.tsx.snap b/app/components/UI/AssetOverview/Balance/__snapshots__/index.test.tsx.snap index fc6f5ff2245..4a8ad81e02c 100644 --- a/app/components/UI/AssetOverview/Balance/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/AssetOverview/Balance/__snapshots__/index.test.tsx.snap @@ -8,7 +8,7 @@ exports[`Balance should render correctly with a fiat balance 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -54,7 +54,7 @@ exports[`Balance should render correctly with a fiat balance 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -85,7 +85,7 @@ exports[`Balance should render correctly with a fiat balance 1`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Bold", "fontSize": 18, "fontWeight": "600", @@ -110,7 +110,7 @@ exports[`Balance should render correctly with a fiat balance 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -163,7 +163,7 @@ exports[`Balance should render correctly without a fiat balance 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -209,7 +209,7 @@ exports[`Balance should render correctly without a fiat balance 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -240,7 +240,7 @@ exports[`Balance should render correctly without a fiat balance 1`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Bold", "fontSize": 18, "fontWeight": "600", @@ -265,7 +265,7 @@ exports[`Balance should render correctly without a fiat balance 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", diff --git a/app/components/UI/AssetSearch/__snapshots__/index.test.tsx.snap b/app/components/UI/AssetSearch/__snapshots__/index.test.tsx.snap index d60bd3f7a30..aeb8e0a21bb 100644 --- a/app/components/UI/AssetSearch/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/AssetSearch/__snapshots__/index.test.tsx.snap @@ -6,10 +6,10 @@ exports[`AssetSearch should render correctly 1`] = ` [ { "alignItems": "center", - "borderColor": "#BBC0C5", + "borderColor": "#bbc0c5", "borderRadius": 8, "borderWidth": 1, - "color": "#24272A", + "color": "#141618", "flex": 1, "flexDirection": "row", "justifyContent": "center", @@ -23,13 +23,13 @@ exports[`AssetSearch should render correctly 1`] = ` StyleSheet.create({ searchSection: { diff --git a/app/components/UI/BackupAlert/BackupAlert.tsx b/app/components/UI/BackupAlert/BackupAlert.tsx index 179cf78357c..2e804b39993 100644 --- a/app/components/UI/BackupAlert/BackupAlert.tsx +++ b/app/components/UI/BackupAlert/BackupAlert.tsx @@ -1,6 +1,6 @@ /* eslint-disable react/prop-types */ import React, { useState, useEffect } from 'react'; -import { View, TouchableOpacity, Platform } from 'react-native'; +import { View, TouchableOpacity } from 'react-native'; import ElevatedView from 'react-native-elevated-view'; import { strings } from '../../../../locales/i18n'; import { baseStyles } from '../../../styles/common'; @@ -8,11 +8,7 @@ import { useDispatch, useSelector } from 'react-redux'; import { backUpSeedphraseAlertNotVisible } from '../../../actions/user'; import { findRouteNameFromNavigatorState } from '../../../util/general'; import { MetaMetricsEvents } from '../../../core/Analytics'; -import generateTestId from '../../../../wdio/utils/generateTestId'; -import { - NOTIFICATION_REMIND_ME_LATER_BUTTON_ID, - SECURE_WALLET_BACKUP_ALERT_MODAL, -} from '../../../../wdio/screen-objects/testIDs/Screens/WalletView.testIds'; +import { ProtectWalletModalSelectorsIDs } from '../../../../e2e/selectors/Modals/ProtectWalletModal.selectors'; import styleSheet from './BackupAlert.styles'; import { useStyles } from '../../../component-library/hooks'; import { BackupAlertI } from './BackupAlert.types'; @@ -51,9 +47,13 @@ const BackupAlert = ({ navigation, onDismiss }: BackupAlertI) => { const [isVisible, setIsVisible] = useState(true); const { seedphraseBackedUp, backUpSeedphraseVisible } = useSelector( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (state: any) => state.user, ); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const onboardingWizardStep = useSelector((state: any) => state.wizard.step); const dispatch = useDispatch(); @@ -114,7 +114,7 @@ const BackupAlert = ({ navigation, onDismiss }: BackupAlertI) => { { {strings('backup_alert.left_button')} diff --git a/app/components/UI/BackupAlert/BackupAlert.types.ts b/app/components/UI/BackupAlert/BackupAlert.types.ts index 2bb40e1c788..0e72d265b54 100644 --- a/app/components/UI/BackupAlert/BackupAlert.types.ts +++ b/app/components/UI/BackupAlert/BackupAlert.types.ts @@ -1,4 +1,6 @@ export interface BackupAlertI { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any navigation: any; onDismiss: () => void; } diff --git a/app/components/UI/BackupAlert/__snapshots__/BackupAlert.test.tsx.snap b/app/components/UI/BackupAlert/__snapshots__/BackupAlert.test.tsx.snap index c87e648dff9..d0da5c4d5e6 100644 --- a/app/components/UI/BackupAlert/__snapshots__/BackupAlert.test.tsx.snap +++ b/app/components/UI/BackupAlert/__snapshots__/BackupAlert.test.tsx.snap @@ -13,8 +13,8 @@ exports[`BackupAlert should render correctly 1`] = ` }, [ { - "backgroundColor": "#FFFFFF", - "borderColor": "#BF5208", + "backgroundColor": "#ffffff", + "borderColor": "#bf5208", "borderRadius": 8, "borderWidth": 1, "left": 16, @@ -31,7 +31,7 @@ exports[`BackupAlert should render correctly 1`] = ` diff --git a/app/components/UI/BasicFunctionality/BasicFunctionalityModal/__snapshots__/BasicFunctionalityModal.test.js.snap b/app/components/UI/BasicFunctionality/BasicFunctionalityModal/__snapshots__/BasicFunctionalityModal.test.js.snap index 13928f4ccc0..f2360580166 100644 --- a/app/components/UI/BasicFunctionality/BasicFunctionalityModal/__snapshots__/BasicFunctionalityModal.test.js.snap +++ b/app/components/UI/BasicFunctionality/BasicFunctionalityModal/__snapshots__/BasicFunctionalityModal.test.js.snap @@ -69,15 +69,15 @@ exports[`BasicFunctionalityModal should render correctly 1`] = ` style={ [ { - "backgroundColor": "#FFFFFF", - "borderColor": "#D6D9DC", + "backgroundColor": "#ffffff", + "borderColor": "#bbc0c566", "borderTopLeftRadius": 8, "borderTopRightRadius": 8, "borderWidth": 1, "maxHeight": 1334, "overflow": "hidden", "paddingBottom": 0, - "shadowColor": "#0000001A", + "shadowColor": "#0000001a", "shadowOffset": { "height": 2, "width": 0, @@ -107,7 +107,7 @@ exports[`BasicFunctionalityModal should render correctly 1`] = ` @@ -60,7 +60,7 @@ exports[`BasicFunctionality should render correctly 1`] = ` accessibilityRole="text" style={ { - "color": "#535A61", + "color": "#6a737d", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -75,7 +75,7 @@ exports[`BasicFunctionality should render correctly 1`] = ` onPress={[Function]} style={ { - "color": "#0376C9", + "color": "#0376c9", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", diff --git a/app/components/UI/BiometryButton/__snapshots__/index.test.tsx.snap b/app/components/UI/BiometryButton/__snapshots__/index.test.tsx.snap index acd87d454ee..e3786b5e309 100644 --- a/app/components/UI/BiometryButton/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/BiometryButton/__snapshots__/index.test.tsx.snap @@ -23,7 +23,7 @@ exports[`BiometryButton should render correctly 1`] = ` style={ { "height": 24, - "tintColor": "#24272A", + "tintColor": "#141618", "width": 24, } } diff --git a/app/components/UI/BiometryButton/styles.ts b/app/components/UI/BiometryButton/styles.ts index 65fc05bd6f2..d2d00fa8741 100644 --- a/app/components/UI/BiometryButton/styles.ts +++ b/app/components/UI/BiometryButton/styles.ts @@ -1,6 +1,8 @@ /* eslint-disable import/prefer-default-export */ import { StyleSheet } from 'react-native'; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any export const createStyles = (colors: any) => StyleSheet.create({ fixCenterIcon: { diff --git a/app/components/UI/BlockingActionModal/__snapshots__/index.test.tsx.snap b/app/components/UI/BlockingActionModal/__snapshots__/index.test.tsx.snap index 23df9c84ea8..877f2d6e738 100644 --- a/app/components/UI/BlockingActionModal/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/BlockingActionModal/__snapshots__/index.test.tsx.snap @@ -51,7 +51,7 @@ exports[`BlockingActionModal should render correctly 1`] = ` { "alignItems": "center", "alignSelf": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 6, "justifyContent": "center", "minHeight": 200, diff --git a/app/components/UI/Bridge/utils/useGoToBridge.ts b/app/components/UI/Bridge/utils/useGoToBridge.ts index 4b865c90816..0019ea22ca1 100644 --- a/app/components/UI/Bridge/utils/useGoToBridge.ts +++ b/app/components/UI/Bridge/utils/useGoToBridge.ts @@ -19,6 +19,8 @@ import { isBridgeUrl } from '../../../../util/url'; */ export default function useGoToBridge(location: string) { const chainId = useSelector(selectChainId); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const browserTabs = useSelector((state: any) => state.browser.tabs); const { navigate } = useNavigation(); const { trackEvent } = useMetrics(); diff --git a/app/components/UI/BrowserBottomBar/__snapshots__/index.test.tsx.snap b/app/components/UI/BrowserBottomBar/__snapshots__/index.test.tsx.snap index 31a2d324c28..a1ea3530ab2 100644 --- a/app/components/UI/BrowserBottomBar/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/BrowserBottomBar/__snapshots__/index.test.tsx.snap @@ -12,8 +12,8 @@ exports[`BrowserBottomBar should render correctly 1`] = ` "shadowRadius": 5.94, }, { - "backgroundColor": "#FFFFFF", - "borderColor": "#D6D9DC", + "backgroundColor": "#ffffff", + "borderColor": "#bbc0c566", "borderTopWidth": 0.5, "flex": 0, "flexDirection": "row", @@ -49,7 +49,7 @@ exports[`BrowserBottomBar should render correctly 1`] = ` }, [ { - "color": "#24272A", + "color": "#141618", "height": 24, "textAlign": "center", "width": 24, @@ -95,13 +95,13 @@ exports[`BrowserBottomBar should render correctly 1`] = ` }, [ { - "color": "#24272A", + "color": "#141618", "height": 24, "textAlign": "center", "width": 24, }, { - "color": "#BBC0C5", + "color": "#9fa6ae", }, ], { @@ -141,7 +141,7 @@ exports[`BrowserBottomBar should render correctly 1`] = ` "fontSize": 24, }, { - "color": "#24272A", + "color": "#141618", "height": 24, "textAlign": "center", "width": 24, @@ -179,7 +179,7 @@ exports[`BrowserBottomBar should render correctly 1`] = ` [ { "alignItems": "center", - "borderColor": "#535A61", + "borderColor": "#6a737d", "borderRadius": 6, "borderWidth": 2, "justifyContent": "center", @@ -196,7 +196,7 @@ exports[`BrowserBottomBar should render correctly 1`] = ` style={ { "alignSelf": "center", - "color": "#535A61", + "color": "#6a737d", "flex": 0, "fontFamily": "EuclidCircularB-Regular", "fontSize": 15, @@ -235,7 +235,7 @@ exports[`BrowserBottomBar should render correctly 1`] = ` "fontSize": 22, }, { - "color": "#24272A", + "color": "#141618", "height": 24, "textAlign": "center", "width": 24, @@ -277,7 +277,7 @@ exports[`BrowserBottomBar should render correctly 1`] = ` "fontSize": 22, }, { - "color": "#24272A", + "color": "#141618", "height": 24, "textAlign": "center", "width": 24, diff --git a/app/components/UI/BrowserUrlBar/BrowserUrlBar.types.ts b/app/components/UI/BrowserUrlBar/BrowserUrlBar.types.ts index 342f173b7d0..fba86832f74 100644 --- a/app/components/UI/BrowserUrlBar/BrowserUrlBar.types.ts +++ b/app/components/UI/BrowserUrlBar/BrowserUrlBar.types.ts @@ -1,5 +1,7 @@ export interface BrowserUrlBarProps { url: string; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any route: any; onPress: () => void; } diff --git a/app/components/UI/Button/__snapshots__/index.test.tsx.snap b/app/components/UI/Button/__snapshots__/index.test.tsx.snap index c594c3f4408..181638ce3fa 100644 --- a/app/components/UI/Button/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/Button/__snapshots__/index.test.tsx.snap @@ -7,7 +7,7 @@ exports[`Button should render correctly 1`] = ` [ { "alignItems": "center", - "backgroundColor": "#0376C9", + "backgroundColor": "#0376c9", "borderRadius": 4, "flex": 1, "height": 40, diff --git a/app/components/UI/ButtonReveal/index.tsx b/app/components/UI/ButtonReveal/index.tsx index 3c467011a2a..06ef8ecdf29 100644 --- a/app/components/UI/ButtonReveal/index.tsx +++ b/app/components/UI/ButtonReveal/index.tsx @@ -24,6 +24,8 @@ const innerRadius = radius - strokeWidth / 2; const circumference = 2 * Math.PI * innerRadius; const animationDuration = 1200; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const createStyles = (colors: any) => StyleSheet.create({ container: { @@ -67,6 +69,8 @@ const createStyles = (colors: any) => label: { color: colors.primary.inverse, fontSize: 18, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any ...(fontStyles.normal as any), }, animatedCircle: { diff --git a/app/components/UI/CollectibleContractElement/index.js b/app/components/UI/CollectibleContractElement/index.js index 89d2b90dcaa..3b81cb82483 100644 --- a/app/components/UI/CollectibleContractElement/index.js +++ b/app/components/UI/CollectibleContractElement/index.js @@ -13,7 +13,7 @@ import { removeFavoriteCollectible } from '../../../actions/collectibles'; import { collectibleContractsSelector } from '../../../reducers/collectibles'; import { useTheme } from '../../../util/theme'; import { selectChainId } from '../../../selectors/networkController'; -import { selectSelectedAddress } from '../../../selectors/preferencesController'; +import { selectSelectedInternalAccountChecksummedAddress } from '../../../selectors/accountsController'; import Icon, { IconName, IconColor, @@ -306,7 +306,7 @@ CollectibleContractElement.propTypes = { const mapStateToProps = (state) => ({ collectibleContracts: collectibleContractsSelector(state), chainId: selectChainId(state), - selectedAddress: selectSelectedAddress(state), + selectedAddress: selectSelectedInternalAccountChecksummedAddress(state), }); const mapDispatchToProps = (dispatch) => ({ diff --git a/app/components/UI/CollectibleContracts/index.js b/app/components/UI/CollectibleContracts/index.js index e79b07deb1b..5d76737516c 100644 --- a/app/components/UI/CollectibleContracts/index.js +++ b/app/components/UI/CollectibleContracts/index.js @@ -36,9 +36,9 @@ import { import { selectDisplayNftMedia, selectIsIpfsGatewayEnabled, - selectSelectedAddress, selectUseNftDetection, } from '../../../selectors/preferencesController'; +import { selectSelectedInternalAccountChecksummedAddress } from '../../../selectors/accountsController'; import { IMPORT_NFT_BUTTON_ID, NFT_TAB_CONTAINER_ID, @@ -422,7 +422,7 @@ CollectibleContracts.propTypes = { const mapStateToProps = (state) => ({ networkType: selectProviderType(state), chainId: selectChainId(state), - selectedAddress: selectSelectedAddress(state), + selectedAddress: selectSelectedInternalAccountChecksummedAddress(state), useNftDetection: selectUseNftDetection(state), collectibleContracts: collectibleContractsSelector(state), collectibles: collectiblesSelector(state), diff --git a/app/components/UI/CollectibleContracts/index.test.tsx b/app/components/UI/CollectibleContracts/index.test.tsx index 78feb7a470f..b3ea91bbf42 100644 --- a/app/components/UI/CollectibleContracts/index.test.tsx +++ b/app/components/UI/CollectibleContracts/index.test.tsx @@ -13,6 +13,7 @@ import { cleanup, waitFor } from '@testing-library/react-native'; import Engine from '../../../core/Engine'; import TestHelpers from '../../../../e2e/helpers'; +import { createMockAccountsControllerState } from '../../../util/test/accountsControllerTestUtils'; jest.mock('@react-navigation/native', () => { const actualReactNavigation = jest.requireActual('@react-navigation/native'); @@ -44,6 +45,7 @@ jest.mock('../../../core/Engine', () => ({ })); const mockStore = configureMockStore(); + const initialState = { collectibles: { favorites: {}, @@ -54,6 +56,11 @@ const initialState = { }; const store = mockStore(initialState); +const MOCK_ADDRESS = '0xd018538C87232FF95acbCe4870629b75640a78E7'; +const MOCK_ACCOUNTS_CONTROLLER_STATE = createMockAccountsControllerState([ + MOCK_ADDRESS, +]); + describe('CollectibleContracts', () => { afterEach(cleanup); it('should render correctly', () => { @@ -66,7 +73,6 @@ describe('CollectibleContracts', () => { }); it('should only get owned collectibles', () => { - const CURRENT_ACCOUNT = '0x1a'; const mockState = { collectibles: { favorites: {}, @@ -83,20 +89,12 @@ describe('CollectibleContracts', () => { }, }, AccountTrackerController: { - accounts: { [CURRENT_ACCOUNT]: { balance: '0' } }, - }, - PreferencesController: { - selectedAddress: CURRENT_ACCOUNT, - identities: { - [CURRENT_ACCOUNT]: { - address: CURRENT_ACCOUNT, - name: 'Account 1', - }, - }, + accounts: { [MOCK_ADDRESS]: { balance: '0' } }, }, + AccountsController: MOCK_ACCOUNTS_CONTROLLER_STATE, NftController: { allNfts: { - [CURRENT_ACCOUNT]: { + [MOCK_ADDRESS]: { '0x1': [ { address: '0x72b1FDb6443338A158DeC2FbF411B71aeB157A42', @@ -128,7 +126,7 @@ describe('CollectibleContracts', () => { }, }, allNftContracts: { - [CURRENT_ACCOUNT]: { + [MOCK_ADDRESS]: { '0x1': [ { address: '0x72b1FDb6443338A158DeC2FbF411B71aeB157A42', @@ -154,7 +152,6 @@ describe('CollectibleContracts', () => { }); it('UI refresh changes NFT image when metadata image changes - detection disabled', async () => { - const CURRENT_ACCOUNT = '0x1a'; const collectibleData = [ { address: '0x72b1FDb6443338A158DeC2FbF411B71aeB157A42', @@ -209,28 +206,22 @@ describe('CollectibleContracts', () => { }, }, AccountTrackerController: { - accounts: { [CURRENT_ACCOUNT]: { balance: '0' } }, + accounts: { [MOCK_ADDRESS]: { balance: '0' } }, }, PreferencesController: { displayNftMedia: true, - selectedAddress: CURRENT_ACCOUNT, - identities: { - [CURRENT_ACCOUNT]: { - address: CURRENT_ACCOUNT, - name: 'Account 1', - }, - }, }, + AccountsController: MOCK_ACCOUNTS_CONTROLLER_STATE, NftController: { addNft: jest.fn(), updateNftMetadata: jest.fn(), allNfts: { - [CURRENT_ACCOUNT]: { + [MOCK_ADDRESS]: { '1': [], }, }, allNftContracts: { - [CURRENT_ACCOUNT]: { + [MOCK_ADDRESS]: { '1': [], }, }, @@ -274,7 +265,6 @@ describe('CollectibleContracts', () => { }); it('UI refresh changes NFT image when metadata image changes - detection enabled', async () => { - const CURRENT_ACCOUNT = '0x1a'; const collectibleData = [ { address: '0x72b1FDb6443338A158DeC2FbF411B71aeB157A42', @@ -329,29 +319,23 @@ describe('CollectibleContracts', () => { }, }, AccountTrackerController: { - accounts: { [CURRENT_ACCOUNT]: { balance: '0' } }, + accounts: { [MOCK_ADDRESS]: { balance: '0' } }, }, PreferencesController: { useNftDetection: true, displayNftMedia: true, - selectedAddress: CURRENT_ACCOUNT, - identities: { - [CURRENT_ACCOUNT]: { - address: CURRENT_ACCOUNT, - name: 'Account 1', - }, - }, }, + AccountsController: MOCK_ACCOUNTS_CONTROLLER_STATE, NftController: { addNft: jest.fn(), updateNftMetadata: jest.fn(), allNfts: { - [CURRENT_ACCOUNT]: { + [MOCK_ADDRESS]: { '1': [], }, }, allNftContracts: { - [CURRENT_ACCOUNT]: { + [MOCK_ADDRESS]: { '1': [], }, }, @@ -398,7 +382,6 @@ describe('CollectibleContracts', () => { }); it('UI pull down experience should call detectNfts when detection is enabled', async () => { - const CURRENT_ACCOUNT = '0x1a'; const collectibleData = [ { address: '0x72b1FDb6443338A158DeC2FbF411B71aeB157A42', @@ -453,29 +436,22 @@ describe('CollectibleContracts', () => { }, }, AccountTrackerController: { - accounts: { [CURRENT_ACCOUNT]: { balance: '0' } }, + accounts: { [MOCK_ADDRESS]: { balance: '0' } }, }, PreferencesController: { useNftDetection: true, displayNftMedia: true, - selectedAddress: CURRENT_ACCOUNT, - identities: { - [CURRENT_ACCOUNT]: { - address: CURRENT_ACCOUNT, - name: 'Account 1', - }, - }, }, NftController: { addNft: jest.fn(), updateNftMetadata: jest.fn(), allNfts: { - [CURRENT_ACCOUNT]: { + [MOCK_ADDRESS]: { '1': [], }, }, allNftContracts: { - [CURRENT_ACCOUNT]: { + [MOCK_ADDRESS]: { '1': [], }, }, diff --git a/app/components/UI/CollectibleDetectionModal/index.tsx b/app/components/UI/CollectibleDetectionModal/index.tsx index 8745b55e01e..50d2061585d 100644 --- a/app/components/UI/CollectibleDetectionModal/index.tsx +++ b/app/components/UI/CollectibleDetectionModal/index.tsx @@ -17,6 +17,8 @@ interface Props { /** * Navigation object needed to link to settings */ + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any navigation: any; } diff --git a/app/components/UI/CollectibleMedia/CollectibleMedia.styles.ts b/app/components/UI/CollectibleMedia/CollectibleMedia.styles.ts index 9e129f21b69..6c399c446e7 100644 --- a/app/components/UI/CollectibleMedia/CollectibleMedia.styles.ts +++ b/app/components/UI/CollectibleMedia/CollectibleMedia.styles.ts @@ -4,6 +4,8 @@ import Device from '../../../util/device'; import { MEDIA_WIDTH_MARGIN } from './Collectible.constants'; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const createStyles = (colors: any) => StyleSheet.create({ container(backgroundColor: string) { diff --git a/app/components/UI/CollectibleModal/CollectibleModal.test.tsx b/app/components/UI/CollectibleModal/CollectibleModal.test.tsx index 33093b2e2bf..3d69d9c6a27 100644 --- a/app/components/UI/CollectibleModal/CollectibleModal.test.tsx +++ b/app/components/UI/CollectibleModal/CollectibleModal.test.tsx @@ -10,10 +10,14 @@ import { selectIsIpfsGatewayEnabled, } from '../../../selectors/preferencesController'; import { useSelector } from 'react-redux'; +import { MOCK_ACCOUNTS_CONTROLLER_STATE } from '../../../util/test/accountsControllerTestUtils'; const mockInitialState = { engine: { - backgroundState: initialBackgroundState, + backgroundState: { + ...initialBackgroundState, + AccountsController: MOCK_ACCOUNTS_CONTROLLER_STATE, + }, }, }; diff --git a/app/components/UI/CollectibleModal/__snapshots__/CollectibleModal.test.tsx.snap b/app/components/UI/CollectibleModal/__snapshots__/CollectibleModal.test.tsx.snap index ce3f8297bf3..47663da06f3 100644 --- a/app/components/UI/CollectibleModal/__snapshots__/CollectibleModal.test.tsx.snap +++ b/app/components/UI/CollectibleModal/__snapshots__/CollectibleModal.test.tsx.snap @@ -112,7 +112,7 @@ exports[`CollectibleModal should render correctly 1`] = ` [ { "alignItems": "center", - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 8, "justifyContent": "flex-start", }, @@ -144,7 +144,7 @@ exports[`CollectibleModal should render correctly 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -216,7 +216,7 @@ exports[`CollectibleModal should render correctly 1`] = ` accessibilityRole="text" style={ { - "color": "#0376C9", + "color": "#0376c9", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -253,7 +253,7 @@ exports[`CollectibleModal should render correctly 1`] = ` onLayout={[Function]} style={ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderTopEndRadius": 8, "borderTopStartRadius": 8, "flex": 0, @@ -278,7 +278,7 @@ exports[`CollectibleModal should render correctly 1`] = ` ({ chainId: selectChainId(state), - selectedAddress: selectSelectedAddress(state), + selectedAddress: selectSelectedInternalAccountChecksummedAddress(state), isInFavorites: isCollectibleInFavoritesSelector(state, props.collectible), }); diff --git a/app/components/UI/Collectibles/__snapshots__/index.test.tsx.snap b/app/components/UI/Collectibles/__snapshots__/index.test.tsx.snap index c8f9f3409c5..374f704ba91 100644 --- a/app/components/UI/Collectibles/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/Collectibles/__snapshots__/index.test.tsx.snap @@ -4,7 +4,7 @@ exports[`Collectibles should render correctly 1`] = ` } > @@ -29,7 +29,7 @@ exports[`Collectibles should render correctly 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "justifyContent": "center", "marginTop": 50, } @@ -38,7 +38,7 @@ exports[`Collectibles should render correctly 1`] = ` { const { selectedAsset, networkName, chainId, ticker, addTokenList } = + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any useParams(); const { colors } = useTheme(); const styles = createStyles(colors); diff --git a/app/components/UI/ConfirmAddAsset/__snapshots__/ConfirmAddAsset.test.tsx.snap b/app/components/UI/ConfirmAddAsset/__snapshots__/ConfirmAddAsset.test.tsx.snap index 59c456385c1..60c2c813da7 100644 --- a/app/components/UI/ConfirmAddAsset/__snapshots__/ConfirmAddAsset.test.tsx.snap +++ b/app/components/UI/ConfirmAddAsset/__snapshots__/ConfirmAddAsset.test.tsx.snap @@ -13,7 +13,7 @@ exports[`ConfirmAddAsset render matches previous snapshot 1`] = ` accessibilityRole="text" style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -31,7 +31,7 @@ exports[`ConfirmAddAsset render matches previous snapshot 1`] = ` onGestureHandlerStateChange={[Function]} style={ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "height": "85%", "paddingHorizontal": 16, "paddingVertical": 16, @@ -65,7 +65,7 @@ exports[`ConfirmAddAsset render matches previous snapshot 1`] = ` StyleSheet.create({ bottomModal: { diff --git a/app/components/UI/Drawer/index.tsx b/app/components/UI/Drawer/index.tsx index 06e433ed493..c727479a850 100644 --- a/app/components/UI/Drawer/index.tsx +++ b/app/components/UI/Drawer/index.tsx @@ -78,6 +78,8 @@ const Drawer = forwardRef((props, ref) => { const prevNetwork = useRef(); const networkOnboardingState = useSelector( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (state: any) => state.networkOnboarded.networkOnboardedState, ); const chainId = useSelector(selectChainId); diff --git a/app/components/UI/DrawerView/__snapshots__/index.test.tsx.snap b/app/components/UI/DrawerView/__snapshots__/index.test.tsx.snap index 5b5031da576..3b18f8f3360 100644 --- a/app/components/UI/DrawerView/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/DrawerView/__snapshots__/index.test.tsx.snap @@ -4,7 +4,7 @@ exports[`DrawerView should render correctly 1`] = ` - Account 1 - + /> - 0x + 0xC496...a756 @@ -263,7 +261,7 @@ exports[`DrawerView should render correctly 1`] = ` style={ { "alignItems": "center", - "borderBottomColor": "#D6D9DC", + "borderBottomColor": "#bbc0c566", "borderBottomWidth": 1, "flexDirection": "row", "justifyContent": "center", @@ -285,8 +283,8 @@ exports[`DrawerView should render correctly 1`] = ` "padding": 15, }, { - "backgroundColor": "#FFFFFF", - "borderColor": "#0376C9", + "backgroundColor": "#ffffff", + "borderColor": "#0376c9", "borderWidth": 1, "padding": 8, }, @@ -324,7 +322,7 @@ exports[`DrawerView should render correctly 1`] = ` style={ [ { - "color": "#0376C9", + "color": "#0376c9", "fontSize": 22, }, { @@ -344,7 +342,7 @@ exports[`DrawerView should render correctly 1`] = ` ({ providerConfig: selectProviderConfig(state), accounts: selectAccounts(state), - selectedAddress: selectSelectedAddress(state), + selectedAddress: selectSelectedInternalAccountChecksummedAddress(state), identities: selectIdentities(state), networkConfigurations: selectNetworkConfigurations(state), currentCurrency: selectCurrentCurrency(state), diff --git a/app/components/UI/DrawerView/index.test.tsx b/app/components/UI/DrawerView/index.test.tsx index 782bfb1c4bb..9d06c981241 100644 --- a/app/components/UI/DrawerView/index.test.tsx +++ b/app/components/UI/DrawerView/index.test.tsx @@ -4,6 +4,10 @@ import DrawerView from './'; import initialBackgroundState from '../../../util/test/initial-background-state.json'; import Engine from '../../../core/Engine'; +import { + MOCK_ACCOUNTS_CONTROLLER_STATE, + MOCK_ADDRESS_1, +} from '../../../util/test/accountsControllerTestUtils'; const mockedEngine = Engine; @@ -12,11 +16,15 @@ const mockInitialState = { backgroundState: { ...initialBackgroundState, PreferencesController: { - selectedAddress: '0x', + selectedAddress: MOCK_ADDRESS_1, identities: { - '0x': { name: 'Account 1', address: '0x' }, + [MOCK_ADDRESS_1]: { + name: 'Account 1', + address: MOCK_ADDRESS_1, + }, }, }, + AccountsController: MOCK_ACCOUNTS_CONTROLLER_STATE, }, }, }; @@ -30,6 +38,11 @@ jest.mock('../../../core/Engine', () => ({ providerConfig: { chainId: '0x1' }, }, }, + KeyringController: { + state: { + keyrings: [], + }, + }, }, })); diff --git a/app/components/UI/EditGasFee1559/__snapshots__/index.test.tsx.snap b/app/components/UI/EditGasFee1559/__snapshots__/index.test.tsx.snap index a7266e3aebe..23e9d694ce4 100644 --- a/app/components/UI/EditGasFee1559/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/EditGasFee1559/__snapshots__/index.test.tsx.snap @@ -4,7 +4,7 @@ exports[`EditGasFee1559 should render correctly 1`] = ` @@ -51,7 +51,7 @@ exports[`EditGasFee1559 should render correctly 1`] = ` @@ -247,7 +247,7 @@ exports[`EditGasFee1559 should render correctly 1`] = ` size={14} style={ { - "color": "#BBC0C5", + "color": "#9fa6ae", } } /> @@ -303,7 +303,7 @@ exports[`EditGasFee1559 should render correctly 1`] = ` size={14} style={ { - "color": "#BBC0C5", + "color": "#9fa6ae", } } /> @@ -380,7 +380,7 @@ exports[`EditGasFee1559 should render correctly 1`] = ` size={14} style={ { - "color": "#BBC0C5", + "color": "#9fa6ae", } } /> diff --git a/app/components/UI/EditGasFeeLegacy/__snapshots__/index.test.tsx.snap b/app/components/UI/EditGasFeeLegacy/__snapshots__/index.test.tsx.snap index 283542a7cfe..2925ad35a5c 100644 --- a/app/components/UI/EditGasFeeLegacy/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/EditGasFeeLegacy/__snapshots__/index.test.tsx.snap @@ -4,7 +4,7 @@ exports[`EditGasFeeLegacy should render correctly 1`] = ` @@ -51,7 +51,7 @@ exports[`EditGasFeeLegacy should render correctly 1`] = ` @@ -176,7 +176,7 @@ exports[`EditGasFeeLegacy should render correctly 1`] = ` size={14} style={ { - "color": "#BBC0C5", + "color": "#9fa6ae", } } /> @@ -232,7 +232,7 @@ exports[`EditGasFeeLegacy should render correctly 1`] = ` size={14} style={ { - "color": "#BBC0C5", + "color": "#9fa6ae", } } /> diff --git a/app/components/UI/EnableAutomaticSecurityChecksModal/__snapshots__/EnableAutomaticSecurityChecksModal.test.tsx.snap b/app/components/UI/EnableAutomaticSecurityChecksModal/__snapshots__/EnableAutomaticSecurityChecksModal.test.tsx.snap index 2550d0225c5..20681c8e49d 100644 --- a/app/components/UI/EnableAutomaticSecurityChecksModal/__snapshots__/EnableAutomaticSecurityChecksModal.test.tsx.snap +++ b/app/components/UI/EnableAutomaticSecurityChecksModal/__snapshots__/EnableAutomaticSecurityChecksModal.test.tsx.snap @@ -356,7 +356,7 @@ exports[`EnableAutomaticSecurityChecksModal should render correctly 1`] = ` ], { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "flex": 1, "justifyContent": "space-between", "paddingHorizontal": 24, @@ -413,7 +413,7 @@ exports[`EnableAutomaticSecurityChecksModal should render correctly 1`] = ` accessibilityRole="text" style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "Euclid Circular B", "fontSize": 32, "fontWeight": "700", @@ -430,7 +430,7 @@ exports[`EnableAutomaticSecurityChecksModal should render correctly 1`] = ` accessibilityRole="text" style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -463,7 +463,7 @@ exports[`EnableAutomaticSecurityChecksModal should render correctly 1`] = ` { "alignItems": "center", "alignSelf": "stretch", - "backgroundColor": "#0376C9", + "backgroundColor": "#0376c9", "borderRadius": 20, "flexDirection": "row", "height": undefined, @@ -479,7 +479,7 @@ exports[`EnableAutomaticSecurityChecksModal should render correctly 1`] = ` accessibilityRole="text" style={ { - "color": "#FFFFFF", + "color": "#ffffff", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -517,7 +517,7 @@ exports[`EnableAutomaticSecurityChecksModal should render correctly 1`] = ` accessibilityRole="text" style={ { - "color": "#0376C9", + "color": "#0376c9", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", diff --git a/app/components/UI/EnableAutomaticSecurityChecksModal/styles.ts b/app/components/UI/EnableAutomaticSecurityChecksModal/styles.ts index 5a1485f4f54..9a901dac982 100644 --- a/app/components/UI/EnableAutomaticSecurityChecksModal/styles.ts +++ b/app/components/UI/EnableAutomaticSecurityChecksModal/styles.ts @@ -1,6 +1,8 @@ /* eslint-disable import/prefer-default-export */ import { StyleSheet } from 'react-native'; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any export const createStyles = (colors: any) => StyleSheet.create({ screen: { diff --git a/app/components/UI/FadeOutOverlay/__snapshots__/index.test.tsx.snap b/app/components/UI/FadeOutOverlay/__snapshots__/index.test.tsx.snap index 57dfb26f469..a5987985908 100644 --- a/app/components/UI/FadeOutOverlay/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/FadeOutOverlay/__snapshots__/index.test.tsx.snap @@ -5,7 +5,7 @@ exports[`FadeOutOverlay should render correctly 1`] = ` collapsable={false} style={ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "bottom": 0, "left": 0, "opacity": 1, diff --git a/app/components/UI/FoxScreen/__snapshots__/index.test.tsx.snap b/app/components/UI/FoxScreen/__snapshots__/index.test.tsx.snap index 09fc38824ca..8b78c162e96 100644 --- a/app/components/UI/FoxScreen/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/FoxScreen/__snapshots__/index.test.tsx.snap @@ -5,7 +5,7 @@ exports[`FoxScreen should render correctly 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "bottom": 0, "flex": 1, "justifyContent": "center", diff --git a/app/components/UI/HardwareWallet/AccountDetails/styles.tsx b/app/components/UI/HardwareWallet/AccountDetails/styles.tsx index 3ac75916446..6dbcde9501b 100644 --- a/app/components/UI/HardwareWallet/AccountDetails/styles.tsx +++ b/app/components/UI/HardwareWallet/AccountDetails/styles.tsx @@ -3,6 +3,8 @@ import { StyleSheet } from 'react-native'; import { fontStyles } from '../../../../styles/common'; import Device from '../../../../util/device'; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any export const createStyle = (colors: any) => StyleSheet.create({ rowContainer: { diff --git a/app/components/UI/HardwareWallet/AccountSelector/hooks.test.tsx b/app/components/UI/HardwareWallet/AccountSelector/hooks.test.tsx index e8dab71eeab..2d44f94c914 100644 --- a/app/components/UI/HardwareWallet/AccountSelector/hooks.test.tsx +++ b/app/components/UI/HardwareWallet/AccountSelector/hooks.test.tsx @@ -24,6 +24,8 @@ describe('useAccountsBalance', () => { '0x456': { balance: '200' }, }); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (Engine.context.AccountTrackerController as any).syncBalanceWithAddresses = mockSyncBalanceWithAddresses; }); diff --git a/app/components/UI/HardwareWallet/AccountSelector/hooks.tsx b/app/components/UI/HardwareWallet/AccountSelector/hooks.tsx index 5765aeb957b..4813d27587b 100644 --- a/app/components/UI/HardwareWallet/AccountSelector/hooks.tsx +++ b/app/components/UI/HardwareWallet/AccountSelector/hooks.tsx @@ -16,6 +16,8 @@ export interface AccountBalances { export const useAccountsBalance = (accounts: IAccount[]) => { const [trackedAccounts, setTrackedAccounts] = useState({}); const AccountTrackerController = useMemo( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any () => (Engine.context as any).AccountTrackerController, [], ); diff --git a/app/components/UI/HardwareWallet/AccountSelector/styles.tsx b/app/components/UI/HardwareWallet/AccountSelector/styles.tsx index 02ad21aac6c..306d52a971e 100644 --- a/app/components/UI/HardwareWallet/AccountSelector/styles.tsx +++ b/app/components/UI/HardwareWallet/AccountSelector/styles.tsx @@ -3,6 +3,8 @@ import { StyleSheet } from 'react-native'; import { fontStyles } from '../../../../styles/common'; import Device from '../../../../util/device'; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any export const createStyle = (colors: any) => StyleSheet.create({ container: { diff --git a/app/components/UI/HintModal/__snapshots__/index.test.tsx.snap b/app/components/UI/HintModal/__snapshots__/index.test.tsx.snap index b0a3a8359b1..33d3926e104 100644 --- a/app/components/UI/HintModal/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/HintModal/__snapshots__/index.test.tsx.snap @@ -24,7 +24,7 @@ exports[`HintModal should render correctly 1`] = ` = ({ ); }; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const mapStateToProps = (state: any) => ({ useBlockieIcon: state.settings.useBlockieIcon, }); diff --git a/app/components/UI/ImageIcon/index.tsx b/app/components/UI/ImageIcon/index.tsx index a1396f234ba..34826c50dbd 100644 --- a/app/components/UI/ImageIcon/index.tsx +++ b/app/components/UI/ImageIcon/index.tsx @@ -4,6 +4,8 @@ import images from 'images/image-icons'; interface ImageIconPropTypes { image: string; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any style: any; } diff --git a/app/components/UI/LedgerModals/LedgerMessageSignModal.tsx b/app/components/UI/LedgerModals/LedgerMessageSignModal.tsx index 5c4d5c422a9..0a2ef706ee9 100644 --- a/app/components/UI/LedgerModals/LedgerMessageSignModal.tsx +++ b/app/components/UI/LedgerModals/LedgerMessageSignModal.tsx @@ -17,13 +17,23 @@ import { RPCStageTypes, iEventGroup } from '../../../reducers/rpcEvents'; import { resetEventStage } from '../../../actions/rpcEvents'; export interface LedgerMessageSignModalParams { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any messageParams: any; onConfirmationComplete: ( confirmed: boolean, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any rawSignature?: any, ) => Promise; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any version: any; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any type: any; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any deviceId: any; } diff --git a/app/components/UI/LedgerModals/LedgerTransactionModal.tsx b/app/components/UI/LedgerModals/LedgerTransactionModal.tsx index 6094e4a8c0f..7719dfd9728 100644 --- a/app/components/UI/LedgerModals/LedgerTransactionModal.tsx +++ b/app/components/UI/LedgerModals/LedgerTransactionModal.tsx @@ -41,6 +41,8 @@ const LedgerTransactionModal = () => { const modalRef = useRef(null); const { colors } = useAppThemeFromContext() || mockTheme; const styles = createStyles(colors); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const { TransactionController, ApprovalController } = Engine.context as any; const { transactionId, onConfirmationComplete, deviceId, replacementParams } = diff --git a/app/components/UI/LedgerModals/Steps/__snapshots__/OpenETHAppStep.test.tsx.snap b/app/components/UI/LedgerModals/Steps/__snapshots__/OpenETHAppStep.test.tsx.snap index bc885b3f21e..0bf779667ea 100644 --- a/app/components/UI/LedgerModals/Steps/__snapshots__/OpenETHAppStep.test.tsx.snap +++ b/app/components/UI/LedgerModals/Steps/__snapshots__/OpenETHAppStep.test.tsx.snap @@ -30,7 +30,7 @@ exports[`OpenETHAppStep matches snapshot 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -85,7 +85,7 @@ exports[`OpenETHAppStep matches snapshot 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -122,7 +122,7 @@ exports[`OpenETHAppStep matches snapshot 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -161,7 +161,7 @@ exports[`OpenETHAppStep matches snapshot 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -215,8 +215,8 @@ exports[`OpenETHAppStep matches snapshot 1`] = ` "padding": 15, }, { - "backgroundColor": "#FFFFFF", - "borderColor": "#535A61", + "backgroundColor": "#ffffff", + "borderColor": "#6a737d", "borderWidth": 1, }, undefined, @@ -243,7 +243,7 @@ exports[`OpenETHAppStep matches snapshot 1`] = ` "textAlign": "center", }, { - "color": "#535A61", + "color": "#6a737d", }, { "width": 600, diff --git a/app/components/UI/LedgerModals/Steps/__snapshots__/SearchingForDeviceStep.test.tsx.snap b/app/components/UI/LedgerModals/Steps/__snapshots__/SearchingForDeviceStep.test.tsx.snap index 9fb7cddd994..25f2be4f378 100644 --- a/app/components/UI/LedgerModals/Steps/__snapshots__/SearchingForDeviceStep.test.tsx.snap +++ b/app/components/UI/LedgerModals/Steps/__snapshots__/SearchingForDeviceStep.test.tsx.snap @@ -38,7 +38,7 @@ exports[`SearchingForDeviceStep matches snapshot for Android < 12 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -101,7 +101,7 @@ exports[`SearchingForDeviceStep matches snapshot for Android < 12 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -140,7 +140,7 @@ exports[`SearchingForDeviceStep matches snapshot for Android < 12 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -181,7 +181,7 @@ exports[`SearchingForDeviceStep matches snapshot for Android < 12 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -222,7 +222,7 @@ exports[`SearchingForDeviceStep matches snapshot for Android < 12 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -263,7 +263,7 @@ exports[`SearchingForDeviceStep matches snapshot for Android < 12 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -304,7 +304,7 @@ exports[`SearchingForDeviceStep matches snapshot for Android < 12 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -350,7 +350,7 @@ exports[`SearchingForDeviceStep matches snapshot for Android < 12 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -379,7 +379,7 @@ exports[`SearchingForDeviceStep matches snapshot for Android < 12 1`] = ` undefined, undefined, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, undefined, @@ -438,7 +438,7 @@ exports[`SearchingForDeviceStep matches snapshot for Android 12+ 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -501,7 +501,7 @@ exports[`SearchingForDeviceStep matches snapshot for Android 12+ 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -540,7 +540,7 @@ exports[`SearchingForDeviceStep matches snapshot for Android 12+ 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -581,7 +581,7 @@ exports[`SearchingForDeviceStep matches snapshot for Android 12+ 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -622,7 +622,7 @@ exports[`SearchingForDeviceStep matches snapshot for Android 12+ 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -663,7 +663,7 @@ exports[`SearchingForDeviceStep matches snapshot for Android 12+ 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -704,7 +704,7 @@ exports[`SearchingForDeviceStep matches snapshot for Android 12+ 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -750,7 +750,7 @@ exports[`SearchingForDeviceStep matches snapshot for Android 12+ 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -779,7 +779,7 @@ exports[`SearchingForDeviceStep matches snapshot for Android 12+ 1`] = ` undefined, undefined, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, undefined, diff --git a/app/components/UI/LedgerModals/__snapshots__/LedgerConfirmationModal.test.tsx.snap b/app/components/UI/LedgerModals/__snapshots__/LedgerConfirmationModal.test.tsx.snap index 64bc919fee0..d6ef54ee996 100644 --- a/app/components/UI/LedgerModals/__snapshots__/LedgerConfirmationModal.test.tsx.snap +++ b/app/components/UI/LedgerModals/__snapshots__/LedgerConfirmationModal.test.tsx.snap @@ -4,7 +4,7 @@ exports[`LedgerConfirmationModal render matches latest snapshot 1`] = ` state.security.allowLoginWithRememberMe, ); const [rememberMeEnabled, setRememberMeEnabled] = useState(false); @@ -66,7 +68,7 @@ const LoginOptionsSwitch = ({ true: colors.primary.default, false: colors.border.muted, }} - thumbColor={theme.brandColors.white000} + thumbColor={theme.brandColors.white} ios_backgroundColor={colors.border.muted} testID={LoginOptionsSwitchSelectorsIDs.BIOMETRICS_SWITCH} /> @@ -86,7 +88,7 @@ const LoginOptionsSwitch = ({ true: colors.primary.default, false: colors.border.muted, }} - thumbColor={theme.brandColors.white000} + thumbColor={theme.brandColors.white} ios_backgroundColor={colors.border.muted} {...generateTestId(Platform, LOGIN_WITH_REMEMBER_ME_SWITCH)} /> diff --git a/app/components/UI/LoginOptionsSwitch/styles.ts b/app/components/UI/LoginOptionsSwitch/styles.ts index a8c8c05fb3b..41b6d96bf23 100644 --- a/app/components/UI/LoginOptionsSwitch/styles.ts +++ b/app/components/UI/LoginOptionsSwitch/styles.ts @@ -2,6 +2,8 @@ import { fontStyles } from '../../../styles/common'; import { StyleSheet } from 'react-native'; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any export const createStyles = (colors: any) => StyleSheet.create({ screen: { diff --git a/app/components/UI/ManageNetworks/__snapshots__/ManageNetworks.test.js.snap b/app/components/UI/ManageNetworks/__snapshots__/ManageNetworks.test.js.snap index 8fa01bd4173..8cd5b831ceb 100644 --- a/app/components/UI/ManageNetworks/__snapshots__/ManageNetworks.test.js.snap +++ b/app/components/UI/ManageNetworks/__snapshots__/ManageNetworks.test.js.snap @@ -21,7 +21,7 @@ exports[`ManageNetworks should render correctly 1`] = ` accessibilityRole="text" style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "Euclid Circular B", "fontSize": 16, "fontWeight": "700", @@ -37,7 +37,7 @@ exports[`ManageNetworks should render correctly 1`] = ` accessibilityRole="text" style={ { - "color": "#535A61", + "color": "#6a737d", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -54,7 +54,7 @@ exports[`ManageNetworks should render correctly 1`] = ` onPress={[Function]} style={ { - "color": "#0376C9", + "color": "#0376c9", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -73,7 +73,7 @@ exports[`ManageNetworks should render correctly 1`] = ` { "alignItems": "center", "alignSelf": "flex-start", - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 16, "flexDirection": "row", "height": 32, @@ -87,7 +87,7 @@ exports[`ManageNetworks should render correctly 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 8, "borderWidth": 1, "height": 16, @@ -101,7 +101,7 @@ exports[`ManageNetworks should render correctly 1`] = ` accessibilityRole="text" style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "Euclid Circular B", "fontSize": 10, "fontWeight": "400", @@ -118,7 +118,7 @@ exports[`ManageNetworks should render correctly 1`] = ` numberOfLines={1} style={ { - "color": "#24272A", + "color": "#141618", "flexShrink": 1, "fontFamily": "Euclid Circular B", "fontSize": 14, @@ -133,7 +133,7 @@ exports[`ManageNetworks should render correctly 1`] = ` Ethereum Main Network StyleSheet.create({ main: { @@ -61,7 +63,11 @@ const MetaMaskAnimation = ({ onAnimationFinish, }: { opacity: number; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any animationRef: any; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any animationName: any; onAnimationFinish: () => void; }): JSX.Element => { diff --git a/app/components/UI/MultiAssetListItems/MultiAssetListItems.tsx b/app/components/UI/MultiAssetListItems/MultiAssetListItems.tsx index 0e1abbc1af6..303596448e4 100644 --- a/app/components/UI/MultiAssetListItems/MultiAssetListItems.tsx +++ b/app/components/UI/MultiAssetListItems/MultiAssetListItems.tsx @@ -20,14 +20,20 @@ interface Props { /** * Array of assets objects returned from the search */ + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any searchResults: any[]; /** * Callback triggered when a token is selected */ + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any handleSelectAsset: (asset: any) => void; /** * Object of the currently-selected token */ + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any selectedAsset: any[]; /** * Search query that generated "searchResults" diff --git a/app/components/UI/MultiAssetListItems/__snapshots__/MultiAssetListItems.test.tsx.snap b/app/components/UI/MultiAssetListItems/__snapshots__/MultiAssetListItems.test.tsx.snap index a1622b9dad2..6f0e3721e34 100644 --- a/app/components/UI/MultiAssetListItems/__snapshots__/MultiAssetListItems.test.tsx.snap +++ b/app/components/UI/MultiAssetListItems/__snapshots__/MultiAssetListItems.test.tsx.snap @@ -12,7 +12,7 @@ exports[`MultiAssetListItems render matches previous snapshot 1`] = ` accessibilityRole="text" style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 14, "fontWeight": "400", diff --git a/app/components/UI/Name/Name.test.tsx b/app/components/UI/Name/Name.test.tsx index b645afd8073..b927c680ba8 100644 --- a/app/components/UI/Name/Name.test.tsx +++ b/app/components/UI/Name/Name.test.tsx @@ -16,6 +16,7 @@ jest.mock('../../hooks/DisplayName/useDisplayName', () => ({ const UNKNOWN_ADDRESS_CHECKSUMMED = '0x299007B3F9E23B8d432D5f545F8a4a2B3E9A5B4e'; +const EXPECTED_UNKNOWN_ADDRESS_CHECKSUMMED = '0x29900...A5B4e'; const UNKNOWN_ADDRESS_NOT_CHECKSUMMED = UNKNOWN_ADDRESS_CHECKSUMMED.toLowerCase(); @@ -46,7 +47,9 @@ describe('Name', () => { , ); - expect(wrapper.getByText(UNKNOWN_ADDRESS_CHECKSUMMED)).toBeTruthy(); + expect( + wrapper.getByText(EXPECTED_UNKNOWN_ADDRESS_CHECKSUMMED), + ).toBeTruthy(); expect(wrapper).toMatchSnapshot(); }); }); diff --git a/app/components/UI/Name/Name.tsx b/app/components/UI/Name/Name.tsx index 226273d4905..1f338a8b0a7 100644 --- a/app/components/UI/Name/Name.tsx +++ b/app/components/UI/Name/Name.tsx @@ -1,21 +1,21 @@ /* eslint-disable react/prop-types */ - import React from 'react'; +import { TextProps, View } from 'react-native'; + +import { useStyles } from '../../../component-library/hooks'; import Text, { TextVariant, } from '../../../component-library/components/Texts/Text'; -import { NameProperties, NameType } from './Name.types'; -import { TextProps, View } from 'react-native'; +import Icon, { + IconName, +} from '../../../component-library/components/Icons/Icon'; +import { renderShortAddress } from '../../../util/address'; import useDisplayName, { DisplayNameVariant, } from '../../hooks/DisplayName/useDisplayName'; -import { useStyles } from '../../../component-library/hooks'; -import styleSheet from './Name.styles'; import Identicon from '../Identicon'; -import Icon, { - IconName, -} from '../../../component-library/components/Icons/Icon'; -import { toChecksumAddress } from 'ethereumjs-util'; +import { NameProperties, NameType } from './Name.types'; +import styleSheet from './Name.styles'; const NameLabel: React.FC<{ displayNameVariant: DisplayNameVariant; @@ -41,7 +41,7 @@ const UnknownEthereumAddress: React.FC<{ address: string }> = ({ address }) => { - {toChecksumAddress(address)} + {renderShortAddress(address, 5)} ); diff --git a/app/components/UI/Name/__snapshots__/Name.test.tsx.snap b/app/components/UI/Name/__snapshots__/Name.test.tsx.snap index 14509edc251..75d9eb71ec6 100644 --- a/app/components/UI/Name/__snapshots__/Name.test.tsx.snap +++ b/app/components/UI/Name/__snapshots__/Name.test.tsx.snap @@ -6,7 +6,7 @@ exports[`Name recognized address should return name 1`] = ` { "alignItems": "center", "alignSelf": "center", - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 99, "flexDirection": "row", "gap": 5, @@ -19,7 +19,7 @@ exports[`Name recognized address should return name 1`] = ` - 0x299007B3F9E23B8d432D5f545F8a4a2B3E9A5B4e + 0x29900...A5B4e -`; +`; \ No newline at end of file diff --git a/app/components/UI/NavbarBrowserTitle/__snapshots__/index.test.tsx.snap b/app/components/UI/NavbarBrowserTitle/__snapshots__/index.test.tsx.snap index b3f9bf4d204..0c8b8ee591d 100644 --- a/app/components/UI/NavbarBrowserTitle/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/NavbarBrowserTitle/__snapshots__/index.test.tsx.snap @@ -27,7 +27,7 @@ exports[`NavbarBrowserTitle should render correctly 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 14, "fontWeight": "400", @@ -48,7 +48,7 @@ exports[`NavbarBrowserTitle should render correctly 1`] = ` "fontSize": 14, }, { - "color": "#24272A", + "color": "#141618", "marginLeft": 10, "marginTop": 2, }, @@ -92,7 +92,7 @@ exports[`NavbarBrowserTitle should render correctly 1`] = ` numberOfLines={1} style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 11, "fontWeight": "400", diff --git a/app/components/UI/NetworkInfo/index.tsx b/app/components/UI/NetworkInfo/index.tsx index c172e8066a7..dfca807590c 100644 --- a/app/components/UI/NetworkInfo/index.tsx +++ b/app/components/UI/NetworkInfo/index.tsx @@ -211,6 +211,8 @@ const NetworkInfo = (props: NetworkInfoProps) => { ); }; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const mapStateToProps = (state: any) => ({ isTokenDetectionEnabled: selectUseTokenDetection(state), }); diff --git a/app/components/UI/NetworkMainAssetLogo/__snapshots__/index.test.tsx.snap b/app/components/UI/NetworkMainAssetLogo/__snapshots__/index.test.tsx.snap new file mode 100644 index 00000000000..f590b2bf297 --- /dev/null +++ b/app/components/UI/NetworkMainAssetLogo/__snapshots__/index.test.tsx.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`NetworkMainAssetLogo should renders correctly 1`] = `"ETH"`; diff --git a/app/components/UI/NetworkMainAssetLogo/index.js b/app/components/UI/NetworkMainAssetLogo/index.js index b85e38b64d1..2b1c1d717ca 100644 --- a/app/components/UI/NetworkMainAssetLogo/index.js +++ b/app/components/UI/NetworkMainAssetLogo/index.js @@ -8,14 +8,33 @@ import { selectTicker, } from '../../../selectors/networkController'; -function NetworkMainAssetLogo({ chainId, ticker, style, big, biggest }) { +function NetworkMainAssetLogo({ + chainId, + ticker, + style, + big, + biggest, + testID, +}) { if (chainId === ChainId.mainnet) { return ( - + ); } return ( - + ); } @@ -30,6 +49,7 @@ NetworkMainAssetLogo.propTypes = { style: PropTypes.object, big: PropTypes.bool, biggest: PropTypes.bool, + testID: PropTypes.string, }; export default connect(mapStateToProps)(NetworkMainAssetLogo); diff --git a/app/components/UI/NetworkMainAssetLogo/index.test.tsx b/app/components/UI/NetworkMainAssetLogo/index.test.tsx new file mode 100644 index 00000000000..687a841d2be --- /dev/null +++ b/app/components/UI/NetworkMainAssetLogo/index.test.tsx @@ -0,0 +1,45 @@ +import React from 'react'; +import { Provider } from 'react-redux'; +import configureMockStore from 'redux-mock-store'; +import { ChainId } from '@metamask/controller-utils'; +import { render } from '@testing-library/react-native'; + +import NetworkMainAssetLogo from '.'; +import initialBackgroundState from '../../../util/test/initial-background-state.json'; + +jest.mock('../Swaps/components/TokenIcon', () => { + const originalModule = jest.requireActual('../Swaps/components/TokenIcon'); + return { + ...originalModule, + __esModule: true, + default: jest.fn(({ symbol }) => symbol), + }; +}); + +const mockInitialState = { + engine: { + backgroundState: { + ...initialBackgroundState, + }, + }, + network: { + provider: { + chainId: ChainId.mainnet, + ticker: 'ETH', + }, + }, +}; + +describe('NetworkMainAssetLogo', () => { + const mockStore = configureMockStore(); + const store = mockStore(mockInitialState); + + it('should renders correctly', () => { + const { toJSON } = render( + + + , + ); + expect(toJSON()).toMatchSnapshot(); + }); +}); diff --git a/app/components/UI/NetworkModal/NetworkAdded/index.tsx b/app/components/UI/NetworkModal/NetworkAdded/index.tsx index 139ae4cbe03..17a9e360336 100644 --- a/app/components/UI/NetworkModal/NetworkAdded/index.tsx +++ b/app/components/UI/NetworkModal/NetworkAdded/index.tsx @@ -6,6 +6,8 @@ import Text from '../../../Base/Text'; import { useTheme } from '../../../../util/theme'; import { NetworkAddedModalSelectorsIDs } from '../../../../../e2e/selectors/Modals/NetworkAddedModal.selectors'; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const createStyles = (colors: any) => StyleSheet.create({ buttonView: { diff --git a/app/components/UI/NetworkModal/NetworkDetails/index.tsx b/app/components/UI/NetworkModal/NetworkDetails/index.tsx index 1e7d2ed3fa3..9cbd21cb053 100644 --- a/app/components/UI/NetworkModal/NetworkDetails/index.tsx +++ b/app/components/UI/NetworkModal/NetworkDetails/index.tsx @@ -6,6 +6,8 @@ import Text from '../../../Base/Text'; import { useTheme } from '../../../../util/theme'; import { getDecimalChainId } from '../../../../util/networks'; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const createStyles = (colors: any) => StyleSheet.create({ accountInformation: { diff --git a/app/components/UI/NetworkModal/__snapshots__/index.test.tsx.snap b/app/components/UI/NetworkModal/__snapshots__/index.test.tsx.snap index 185e1643839..9bcd53ef6a1 100644 --- a/app/components/UI/NetworkModal/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/NetworkModal/__snapshots__/index.test.tsx.snap @@ -103,7 +103,7 @@ exports[`NetworkDetails renders correctly 1`] = ` void; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any networkConfiguration: any; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any navigation: any; shouldNetworkSwitchPopToWallet: boolean; onNetworkSwitch?: () => void; diff --git a/app/components/UI/NetworkModal/index.tsx b/app/components/UI/NetworkModal/index.tsx index f4b160fed4d..52acacc924c 100644 --- a/app/components/UI/NetworkModal/index.tsx +++ b/app/components/UI/NetworkModal/index.tsx @@ -37,7 +37,11 @@ import { useMetrics } from '../../../components/hooks/useMetrics'; interface NetworkProps { isVisible: boolean; onClose: () => void; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any networkConfiguration: any; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any navigation: any; shouldNetworkSwitchPopToWallet: boolean; onNetworkSwitch?: () => void; diff --git a/app/components/UI/NetworkVerificationInfo/NetworkVerificationInfo.types.ts b/app/components/UI/NetworkVerificationInfo/NetworkVerificationInfo.types.ts index 41d31f75a40..fcfee04c246 100644 --- a/app/components/UI/NetworkVerificationInfo/NetworkVerificationInfo.types.ts +++ b/app/components/UI/NetworkVerificationInfo/NetworkVerificationInfo.types.ts @@ -12,5 +12,7 @@ export interface CustomNetworkInformation { ticker: string; blockExplorerUrl: string; alerts: Alert[]; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any icon: any; } diff --git a/app/components/UI/NetworkVerificationInfo/__snapshots__/NetworkVerificationInfo.test.tsx.snap b/app/components/UI/NetworkVerificationInfo/__snapshots__/NetworkVerificationInfo.test.tsx.snap index 84039e1d4aa..c4847cccd7f 100644 --- a/app/components/UI/NetworkVerificationInfo/__snapshots__/NetworkVerificationInfo.test.tsx.snap +++ b/app/components/UI/NetworkVerificationInfo/__snapshots__/NetworkVerificationInfo.test.tsx.snap @@ -8,7 +8,7 @@ exports[`NetworkVerificationInfo renders correctly 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "flexDirection": "row", "padding": 16, } @@ -39,7 +39,7 @@ exports[`NetworkVerificationInfo renders correctly 1`] = ` accessibilityRole="text" style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "Euclid Circular B", "fontSize": 18, "fontWeight": "700", @@ -69,7 +69,7 @@ exports[`NetworkVerificationInfo renders correctly 1`] = ` onGestureHandlerStateChange={[Function]} style={ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "paddingHorizontal": 16, } } @@ -81,7 +81,7 @@ exports[`NetworkVerificationInfo renders correctly 1`] = ` { "alignItems": "center", "alignSelf": "center", - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 16, "flexDirection": "row", "height": 32, @@ -94,7 +94,7 @@ exports[`NetworkVerificationInfo renders correctly 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 8, "height": 16, "justifyContent": "center", @@ -127,7 +127,7 @@ exports[`NetworkVerificationInfo renders correctly 1`] = ` numberOfLines={1} style={ { - "color": "#24272A", + "color": "#141618", "flexShrink": 1, "fontFamily": "Euclid Circular B", "fontSize": 14, @@ -145,8 +145,8 @@ exports[`NetworkVerificationInfo renders correctly 1`] = ` diff --git a/app/components/UI/Notification/List/index.tsx b/app/components/UI/Notification/List/index.tsx index 2b6a867d4d5..dd5676ad02c 100644 --- a/app/components/UI/Notification/List/index.tsx +++ b/app/components/UI/Notification/List/index.tsx @@ -20,6 +20,8 @@ import { import { NotificationsViewSelectorsIDs } from '../../../../../e2e/selectors/NotificationsView.selectors'; interface NotificationsList { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any navigation: any; allNotifications: Notification[]; walletNotifications: HalRawNotification[]; diff --git a/app/components/UI/Notification/Row/Actions.tsx b/app/components/UI/Notification/Row/Actions.tsx index 825d768d9e8..fa286dcdb5f 100644 --- a/app/components/UI/Notification/Row/Actions.tsx +++ b/app/components/UI/Notification/Row/Actions.tsx @@ -17,6 +17,8 @@ interface NotificationActionsProps { actionUrl: string; isExternal: boolean; }; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any styles: any; } diff --git a/app/components/UI/Notification/Row/Content.tsx b/app/components/UI/Notification/Row/Content.tsx index 5617a1ab968..29f63db5412 100644 --- a/app/components/UI/Notification/Row/Content.tsx +++ b/app/components/UI/Notification/Row/Content.tsx @@ -16,6 +16,8 @@ interface NotificationContentProps { }; createdAt: string; value: string; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any styles: StyleSheet.NamedStyles; } diff --git a/app/components/UI/Notification/Row/Icon.tsx b/app/components/UI/Notification/Row/Icon.tsx index 9d42188348e..e3b188bdb20 100644 --- a/app/components/UI/Notification/Row/Icon.tsx +++ b/app/components/UI/Notification/Row/Icon.tsx @@ -16,6 +16,8 @@ import { ETHEREUM_LOGO } from '../../../../constants/urls'; const metamask_fox = require('../../../../images/fox.png'); // eslint-disable-line interface NotificationIconProps { notificationType: TRIGGER_TYPES; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any styles: any; badgeIcon?: IconName; imageUrl?: string; diff --git a/app/components/UI/Notification/Row/Root.tsx b/app/components/UI/Notification/Row/Root.tsx index 6d160d56f82..5e9b18dfd59 100644 --- a/app/components/UI/Notification/Row/Root.tsx +++ b/app/components/UI/Notification/Row/Root.tsx @@ -21,6 +21,8 @@ import Icon, { interface NotificationRootProps extends Pick { children: React.ReactNode; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any styles: StyleSheet.NamedStyles; handleOnPress: () => void; onDismiss?: () => void; diff --git a/app/components/UI/Notification/Row/__snapshots__/Actions.test.tsx.snap b/app/components/UI/Notification/Row/__snapshots__/Actions.test.tsx.snap index f65c1e4eed7..c0efe11a2f9 100644 --- a/app/components/UI/Notification/Row/__snapshots__/Actions.test.tsx.snap +++ b/app/components/UI/Notification/Row/__snapshots__/Actions.test.tsx.snap @@ -13,7 +13,7 @@ exports[`NotificationActions matches snapshot 1`] = ` "alignItems": "center", "alignSelf": "flex-start", "backgroundColor": "transparent", - "borderColor": "#0376C9", + "borderColor": "#0376c9", "borderRadius": 20, "borderWidth": 1, "flexDirection": "row", @@ -29,7 +29,7 @@ exports[`NotificationActions matches snapshot 1`] = ` accessibilityRole="text" style={ { - "color": "#0376C9", + "color": "#0376c9", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -41,7 +41,7 @@ exports[`NotificationActions matches snapshot 1`] = ` Learn more { return { accounts: selectAccounts(state), - selectedAddress: selectSelectedAddress(state), + selectedAddress: selectSelectedInternalAccountChecksummedAddress(state), transactions: TransactionController.transactions, ticker: selectTicker(state), chainId, diff --git a/app/components/UI/Notification/__mocks__/mock_notifications.ts b/app/components/UI/Notification/__mocks__/mock_notifications.ts index 9fe5b01f4fe..276afc91d0f 100644 --- a/app/components/UI/Notification/__mocks__/mock_notifications.ts +++ b/app/components/UI/Notification/__mocks__/mock_notifications.ts @@ -13,29 +13,14 @@ interface NotificationAction { isExternal: boolean; } -interface CommonData { - network_fee: { - gas_price: string; - native_token_price_in_usd: string; - }; - from?: string; - to?: string; - amount?: { - usd: string; - eth?: string; - }; - image?: string; - symbol?: string; -} - const createNotificationBase = ( id: string, - type: TRIGGER_TYPES, + type: keyof typeof TRIGGER_TYPES, createdAt: Date = new Date(), isRead = false, ): Omit => ({ id, - type, + type: TRIGGER_TYPES[type], createdAt, isRead, }); @@ -48,7 +33,7 @@ import SVG_MM_LOGO_PATH from '../../../../images/fox.svg'; const MOCK_NOTIFICATIONS: Notification[] = [ { - ...createNotificationBase('1', TRIGGER_TYPES.FEATURES_ANNOUNCEMENT), + ...createNotificationBase('1', 'FEATURES_ANNOUNCEMENT'), data: { title: 'Welcome to the new MyMetaverse!', shortDescription: @@ -74,13 +59,14 @@ const MOCK_NOTIFICATIONS: Notification[] = [ }, }, { - ...createNotificationBase( - '9d9b1467-b3ee-5492-8ca2-22382657b690', - TRIGGER_TYPES.LIDO_STAKE_COMPLETED, - ), - block_number: 18487118, - block_timestamp: '1698961091', + ...createNotificationBase('2', 'LIDO_STAKE_COMPLETED'), + trigger_id: 'some-trigger-id', chain_id: 1, + block_number: 20069079, + block_timestamp: '1698961091', + tx_hash: + '0x6271899e371c87ff96307d5ffed7ddcc39dcee5742bfab4f395501f6bf4c2002', + unread: false, created_at: '2023-11-02T22:28:49.970865Z', data: { kind: 'lido_stake_completed', @@ -106,8 +92,8 @@ const MOCK_NOTIFICATIONS: Notification[] = [ gas_price: '26536359866', native_token_price_in_usd: '1806.33', }, - } as CommonData, - }, + }, + } as Notification, ]; export default MOCK_NOTIFICATIONS; diff --git a/app/components/UI/OnboardingWizard/Coachmark/__snapshots__/index.test.tsx.snap b/app/components/UI/OnboardingWizard/Coachmark/__snapshots__/index.test.tsx.snap index 740268e290e..ef9f7b93f0a 100644 --- a/app/components/UI/OnboardingWizard/Coachmark/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/OnboardingWizard/Coachmark/__snapshots__/index.test.tsx.snap @@ -23,7 +23,7 @@ exports[`Coachmark should render correctly 1`] = ` style={ { "backgroundColor": "transparent", - "borderBottomColor": "#0376C9", + "borderBottomColor": "#0376c9", "borderBottomWidth": 12, "borderLeftColor": "transparent", "borderLeftWidth": 15, @@ -41,7 +41,7 @@ exports[`Coachmark should render correctly 1`] = ` style={ [ { - "backgroundColor": "#0376C9", + "backgroundColor": "#0376c9", "borderRadius": 8, "padding": 20, }, @@ -78,7 +78,7 @@ exports[`Coachmark should render correctly 1`] = ` testID="onboarding-wizard-back-button" > @@ -176,7 +176,7 @@ exports[`Coachmark should render correctly 1`] = ` "padding": 15, }, { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", }, [ { @@ -212,7 +212,7 @@ exports[`Coachmark should render correctly 1`] = ` "textAlign": "center", }, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, ], diff --git a/app/components/UI/OnboardingWizard/Step1/__snapshots__/index.test.tsx.snap b/app/components/UI/OnboardingWizard/Step1/__snapshots__/index.test.tsx.snap index 30e09c12ad7..83fed814489 100644 --- a/app/components/UI/OnboardingWizard/Step1/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/OnboardingWizard/Step1/__snapshots__/index.test.tsx.snap @@ -32,7 +32,7 @@ exports[`Step1 should render correctly 1`] = ` style={ [ { - "backgroundColor": "#0376C9", + "backgroundColor": "#0376c9", "borderRadius": 8, "padding": 20, }, @@ -56,7 +56,7 @@ exports[`Step1 should render correctly 1`] = ` style={ { "alignSelf": "center", - "color": "#FFFFFF", + "color": "#ffffff", "fontFamily": "EuclidCircularB-Bold", "fontSize": 18, "fontWeight": "600", @@ -84,7 +84,7 @@ exports[`Step1 should render correctly 1`] = ` } > @@ -220,7 +220,7 @@ exports[`Step2 should render correctly 1`] = ` "padding": 15, }, { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", }, [ { @@ -256,7 +256,7 @@ exports[`Step2 should render correctly 1`] = ` "textAlign": "center", }, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, ], diff --git a/app/components/UI/OnboardingWizard/Step2/index.tsx b/app/components/UI/OnboardingWizard/Step2/index.tsx index 6fda98c61af..6f50dce98c4 100644 --- a/app/components/UI/OnboardingWizard/Step2/index.tsx +++ b/app/components/UI/OnboardingWizard/Step2/index.tsx @@ -30,6 +30,8 @@ const styles = StyleSheet.create({ }); interface Step2Props { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any coachmarkRef: any; onClose: () => Promise; } diff --git a/app/components/UI/OnboardingWizard/Step3/__snapshots__/index.test.tsx.snap b/app/components/UI/OnboardingWizard/Step3/__snapshots__/index.test.tsx.snap index d1563861d6d..80013e2cbc1 100644 --- a/app/components/UI/OnboardingWizard/Step3/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/OnboardingWizard/Step3/__snapshots__/index.test.tsx.snap @@ -45,7 +45,7 @@ exports[`Step3 should render correctly 1`] = ` style={ { "backgroundColor": "transparent", - "borderBottomColor": "#0376C9", + "borderBottomColor": "#0376c9", "borderBottomWidth": 12, "borderLeftColor": "transparent", "borderLeftWidth": 15, @@ -63,7 +63,7 @@ exports[`Step3 should render correctly 1`] = ` style={ [ { - "backgroundColor": "#0376C9", + "backgroundColor": "#0376c9", "borderRadius": 8, "padding": 20, }, @@ -100,7 +100,7 @@ exports[`Step3 should render correctly 1`] = ` testID="onboarding-wizard-back-button" > @@ -221,7 +221,7 @@ exports[`Step3 should render correctly 1`] = ` "padding": 15, }, { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", }, [ { @@ -257,7 +257,7 @@ exports[`Step3 should render correctly 1`] = ` "textAlign": "center", }, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, ], diff --git a/app/components/UI/OnboardingWizard/Step3/index.tsx b/app/components/UI/OnboardingWizard/Step3/index.tsx index 3ea13a9f5e4..4e3c984b104 100644 --- a/app/components/UI/OnboardingWizard/Step3/index.tsx +++ b/app/components/UI/OnboardingWizard/Step3/index.tsx @@ -28,6 +28,8 @@ const styles = StyleSheet.create({ }); interface Step3Props { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any coachmarkRef: any; onClose: () => Promise; } diff --git a/app/components/UI/OnboardingWizard/Step4/__snapshots__/index.test.tsx.snap b/app/components/UI/OnboardingWizard/Step4/__snapshots__/index.test.tsx.snap index 45ff51b63b8..d326e11c7af 100644 --- a/app/components/UI/OnboardingWizard/Step4/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/OnboardingWizard/Step4/__snapshots__/index.test.tsx.snap @@ -45,7 +45,7 @@ exports[`Step4 should render correctly 1`] = ` style={ { "backgroundColor": "transparent", - "borderBottomColor": "#0376C9", + "borderBottomColor": "#0376c9", "borderBottomWidth": 12, "borderLeftColor": "transparent", "borderLeftWidth": 15, @@ -63,7 +63,7 @@ exports[`Step4 should render correctly 1`] = ` style={ [ { - "backgroundColor": "#0376C9", + "backgroundColor": "#0376c9", "borderRadius": 8, "padding": 20, }, @@ -100,7 +100,7 @@ exports[`Step4 should render correctly 1`] = ` testID="onboarding-wizard-back-button" > @@ -221,7 +221,7 @@ exports[`Step4 should render correctly 1`] = ` "padding": 15, }, { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", }, [ { @@ -257,7 +257,7 @@ exports[`Step4 should render correctly 1`] = ` "textAlign": "center", }, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, ], diff --git a/app/components/UI/OnboardingWizard/Step5/__snapshots__/index.test.tsx.snap b/app/components/UI/OnboardingWizard/Step5/__snapshots__/index.test.tsx.snap index 4a649af8112..0d7b327c54f 100644 --- a/app/components/UI/OnboardingWizard/Step5/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/OnboardingWizard/Step5/__snapshots__/index.test.tsx.snap @@ -33,7 +33,7 @@ exports[`Step5 should render correctly 1`] = ` style={ [ { - "backgroundColor": "#0376C9", + "backgroundColor": "#0376c9", "borderRadius": 8, "padding": 20, }, @@ -70,7 +70,7 @@ exports[`Step5 should render correctly 1`] = ` testID="onboarding-wizard-back-button" > @@ -191,7 +191,7 @@ exports[`Step5 should render correctly 1`] = ` "padding": 15, }, { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", }, [ { @@ -227,7 +227,7 @@ exports[`Step5 should render correctly 1`] = ` "textAlign": "center", }, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, ], @@ -258,7 +258,7 @@ exports[`Step5 should render correctly 1`] = ` "borderRightColor": "transparent", "borderRightWidth": 15, "borderStyle": "solid", - "borderTopColor": "#0376C9", + "borderTopColor": "#0376c9", "borderTopWidth": 12, "height": 0, "position": "absolute", diff --git a/app/components/UI/OnboardingWizard/Step5/index.tsx b/app/components/UI/OnboardingWizard/Step5/index.tsx index c49ceabedc9..69fe4dcd685 100644 --- a/app/components/UI/OnboardingWizard/Step5/index.tsx +++ b/app/components/UI/OnboardingWizard/Step5/index.tsx @@ -29,6 +29,8 @@ const styles = StyleSheet.create({ }); interface Step5Props { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any coachmarkRef: any; onClose: () => Promise; } diff --git a/app/components/UI/OnboardingWizard/Step6/__snapshots__/index.test.tsx.snap b/app/components/UI/OnboardingWizard/Step6/__snapshots__/index.test.tsx.snap index d0fe7d541bd..7429c78a58e 100644 --- a/app/components/UI/OnboardingWizard/Step6/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/OnboardingWizard/Step6/__snapshots__/index.test.tsx.snap @@ -32,7 +32,7 @@ exports[`Step6 should render correctly 1`] = ` style={ [ { - "backgroundColor": "#0376C9", + "backgroundColor": "#0376c9", "borderRadius": 8, "padding": 20, }, @@ -69,7 +69,7 @@ exports[`Step6 should render correctly 1`] = ` testID="onboarding-wizard-back-button" > @@ -190,7 +190,7 @@ exports[`Step6 should render correctly 1`] = ` "padding": 15, }, { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", }, [ { @@ -226,7 +226,7 @@ exports[`Step6 should render correctly 1`] = ` "textAlign": "center", }, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, ], @@ -258,7 +258,7 @@ exports[`Step6 should render correctly 1`] = ` "borderRightColor": "transparent", "borderRightWidth": 15, "borderStyle": "solid", - "borderTopColor": "#0376C9", + "borderTopColor": "#0376c9", "borderTopWidth": 12, "height": 0, "position": "absolute", diff --git a/app/components/UI/OnboardingWizard/Step6/index.tsx b/app/components/UI/OnboardingWizard/Step6/index.tsx index 2513707521f..e337556fe2c 100644 --- a/app/components/UI/OnboardingWizard/Step6/index.tsx +++ b/app/components/UI/OnboardingWizard/Step6/index.tsx @@ -32,6 +32,8 @@ const styles = StyleSheet.create({ }); interface Step6Props { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any navigation: any; onClose: () => Promise; } diff --git a/app/components/UI/OnboardingWizard/Step7/__snapshots__/index.test.tsx.snap b/app/components/UI/OnboardingWizard/Step7/__snapshots__/index.test.tsx.snap index 240bf4570ea..c703d6ad1f8 100644 --- a/app/components/UI/OnboardingWizard/Step7/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/OnboardingWizard/Step7/__snapshots__/index.test.tsx.snap @@ -44,7 +44,7 @@ exports[`Step7 should render correctly 1`] = ` style={ { "backgroundColor": "transparent", - "borderBottomColor": "#0376C9", + "borderBottomColor": "#0376c9", "borderBottomWidth": 12, "borderLeftColor": "transparent", "borderLeftWidth": 15, @@ -62,7 +62,7 @@ exports[`Step7 should render correctly 1`] = ` style={ [ { - "backgroundColor": "#0376C9", + "backgroundColor": "#0376c9", "borderRadius": 8, "padding": 20, }, @@ -99,7 +99,7 @@ exports[`Step7 should render correctly 1`] = ` testID="onboarding-wizard-back-button" > @@ -220,7 +220,7 @@ exports[`Step7 should render correctly 1`] = ` "padding": 15, }, { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", }, [ { @@ -256,7 +256,7 @@ exports[`Step7 should render correctly 1`] = ` "textAlign": "center", }, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, ], diff --git a/app/components/UI/OnboardingWizard/Step7/index.tsx b/app/components/UI/OnboardingWizard/Step7/index.tsx index 6cc32b76db0..e4c47958133 100644 --- a/app/components/UI/OnboardingWizard/Step7/index.tsx +++ b/app/components/UI/OnboardingWizard/Step7/index.tsx @@ -31,6 +31,8 @@ const styles = StyleSheet.create({ }); interface Step7Props { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any navigation: any; onClose: (arg0: boolean) => void; } diff --git a/app/components/UI/OnboardingWizard/index.tsx b/app/components/UI/OnboardingWizard/index.tsx index 48fecaec0ca..d771dbf9a96 100644 --- a/app/components/UI/OnboardingWizard/index.tsx +++ b/app/components/UI/OnboardingWizard/index.tsx @@ -71,7 +71,11 @@ const createStyles = ({ colors, typography }: Theme) => }); interface OnboardingWizardProps { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any navigation: any; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any coachmarkRef: React.RefObject | null; } @@ -86,9 +90,13 @@ const OnboardingWizard = ({ const styles = createStyles(theme); const isAutomaticSecurityChecksModalOpen = useSelector( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (state: any) => state.security.isAutomaticSecurityChecksModalOpen, ); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const { step } = useSelector((state: any) => state.wizard); /** diff --git a/app/components/UI/OnboardingWizard/styles.ts b/app/components/UI/OnboardingWizard/styles.ts index 3d504c5f7e1..df52b846a32 100644 --- a/app/components/UI/OnboardingWizard/styles.ts +++ b/app/components/UI/OnboardingWizard/styles.ts @@ -4,6 +4,8 @@ import Device from '../../../util/device'; const SMALL_DEVICE = Device.isSmallDevice(); +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any export default (colors: any) => StyleSheet.create({ container: { diff --git a/app/components/UI/OnboardingWizard/useHandleLayout.tsx b/app/components/UI/OnboardingWizard/useHandleLayout.tsx index 44aa367e3e9..688c0f5d7a1 100644 --- a/app/components/UI/OnboardingWizard/useHandleLayout.tsx +++ b/app/components/UI/OnboardingWizard/useHandleLayout.tsx @@ -1,5 +1,7 @@ import { useCallback, useEffect, useState } from 'react'; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const useHandleLayout = (coachmarkRef: any) => { const [coachmarkTop, setCoachmarkTop] = useState(0); diff --git a/app/components/UI/OptinMetrics/__snapshots__/index.test.tsx.snap b/app/components/UI/OptinMetrics/__snapshots__/index.test.tsx.snap index bc5e33dec04..004f5ec03d8 100644 --- a/app/components/UI/OptinMetrics/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/OptinMetrics/__snapshots__/index.test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`OptinMetrics should render correctly 1`] = ` +exports[`OptinMetrics render matches snapshot 1`] = ` - MetaMask would like to gather usage data to better understand how our users interact with MetaMask. This data will be used to provide the service, which includes improving the service based on your use. + We’d like to gather basic usage data to improve MetaMask. Know that we never sell the data you provide here. - MetaMask will... + When we gather metrics, it will always be... - Always allow you to opt-out via Settings + > + Private: + + clicks and views on the app are stored, but other details (like your public address) are not. - Send anonymized click & pageview events + > + General: + + we temporarily use your IP address to detect a general location (like your country or region), but it's never stored. -  +  - Never + Optional: - collect information we don’t need to provide the service (such as keys, addresses, transaction hashes, or balances) + you decide if you want to share or delete your usage data via settings any time. - - -  - - - - Never - - collect your full IP address* - - - - -  - + /> + - - Never - - sell data. Ever! + We'll use this data to learn how you interact with our marketing communications. We may share relavent news (like product features). - + - This data is aggregated and is therefore anonymous for the purposes of General Data Protection Regulation (EU) 2016/679. - - - - - *When you use Infura as your default RPC provider in MetaMask, Infura will collect your IP address and your Ethereum wallet address when you send a transaction. We don’t store this information in a way that allows our systems to associate those two pieces of data. You can configure your RPC provider - - - here - + We’ll let you know if we decide to use this data for other purposes. You can review our - before proceeding. -For more information on how MetaMask and Infura interact from a data collection perspective, see our update - here + Privacy Policy - . For more information on our privacy practices in general, see our Privacy Policy - - - here - + + for more information. Remember, you can go to settings and opt out at any time. - . @@ -888,7 +764,7 @@ For more information on how MetaMask and Infura interact from a data collection "alignItems": "center", "alignSelf": "flex-start", "backgroundColor": "transparent", - "borderColor": "#0376C9", + "borderColor": "#0376c9", "borderRadius": 24, "borderWidth": 1, "flex": 1, @@ -905,7 +781,7 @@ For more information on how MetaMask and Infura interact from a data collection accessibilityRole="text" style={ { - "color": "#0376C9", + "color": "#0376c9", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -936,7 +812,7 @@ For more information on how MetaMask and Infura interact from a data collection { "alignItems": "center", "alignSelf": "flex-start", - "backgroundColor": "#0376C9", + "backgroundColor": "#0376c9", "borderRadius": 24, "flex": 1, "flexDirection": "row", @@ -952,7 +828,7 @@ For more information on how MetaMask and Infura interact from a data collection accessibilityRole="text" style={ { - "color": "#FFFFFF", + "color": "#ffffff", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", diff --git a/app/components/UI/OptinMetrics/index.js b/app/components/UI/OptinMetrics/index.js index 9f563df8d15..ef195031657 100644 --- a/app/components/UI/OptinMetrics/index.js +++ b/app/components/UI/OptinMetrics/index.js @@ -8,6 +8,7 @@ import { BackHandler, Alert, InteractionManager, + TouchableOpacity, } from 'react-native'; import PropTypes from 'prop-types'; import { baseStyles, fontStyles } from '../../../styles/common'; @@ -317,8 +318,17 @@ class OptinMetrics extends PureComponent { await metrics.enable(); InteractionManager.runAfterInteractions(async () => { // add traits to user for identification + + // trait indicating if user opts in for data collection for marketing + let dataCollectionForMarketingTraits; + if (this.props.isDataCollectionForMarketingEnabled) { + dataCollectionForMarketingTraits = { has_marketing_consent: true }; + } + // consolidate device and user settings traits const consolidatedTraits = { + ...dataCollectionForMarketingTraits, + is_metrics_opted_in: true, ...generateDeviceAnalyticsMetaData(), ...generateUserSettingsAnalyticsMetaData(), }; @@ -345,24 +355,11 @@ class OptinMetrics extends PureComponent { this.props.clearOnboardingEvents(); - if (this.props.isDataCollectionForMarketingEnabled) { - const traits = { - is_metrics_opted_in: true, - has_marketing_consent: Boolean( - this.props.setDataCollectionForMarketing, - ), - }; - - metrics.addTraitsToUser(traits); - metrics.trackEvent(MetaMetricsEvents.ANALYTICS_PREFERENCE_SELECTED, { - ...traits, - location: 'onboarding_metametrics', - }); - } - - // track event for user opting in + // track event for user opting in on metrics and data collection for marketing metrics.trackEvent(MetaMetricsEvents.ANALYTICS_PREFERENCE_SELECTED, { - analytics_option_selected: 'Metrics Opt In', + ...dataCollectionForMarketingTraits, + is_metrics_opted_in: true, + location: 'onboarding_metametrics', updated_after_onboarding: false, }); }); @@ -598,7 +595,15 @@ class OptinMetrics extends PureComponent { : this.renderLegacyAction(action, i), )} {isPastPrivacyPolicyDate ? ( - + + setDataCollectionForMarketing( + !isDataCollectionForMarketingEnabled, + ) + } + activeOpacity={1} + > {strings('privacy_policy.checkbox')} - + ) : null} {this.renderPrivacyPolicy()} diff --git a/app/components/UI/OptinMetrics/index.test.tsx b/app/components/UI/OptinMetrics/index.test.tsx index f5c69b1116d..5ed7961c75d 100644 --- a/app/components/UI/OptinMetrics/index.test.tsx +++ b/app/components/UI/OptinMetrics/index.test.tsx @@ -1,8 +1,47 @@ import OptinMetrics from './'; import { renderScreen } from '../../../util/test/renderWithProvider'; +import { MetaMetrics, MetaMetricsEvents } from '../../../core/Analytics'; +import { fireEvent, screen, waitFor } from '@testing-library/react-native'; +import { strings } from '../../../../locales/i18n'; + +const { InteractionManager } = jest.requireActual('react-native'); + +InteractionManager.runAfterInteractions = jest.fn(async (callback) => + callback(), +); + +jest.mock('../../../core/Analytics/MetaMetrics'); + +const mockMetrics = { + trackEvent: jest.fn().mockImplementation(() => Promise.resolve()), + trackAnonymousEvent: jest.fn(), + enable: jest.fn(() => Promise.resolve()), + addTraitsToUser: jest.fn(() => Promise.resolve()), + isEnabled: jest.fn(() => true), +}; + +(MetaMetrics.getInstance as jest.Mock).mockReturnValue(mockMetrics); + +jest.mock( + '../../../util/metrics/UserSettingsAnalyticsMetaData/generateUserProfileAnalyticsMetaData', + () => jest.fn().mockReturnValue({ userProp: 'User value' }), +); + +jest.mock( + '../../../util/metrics/DeviceAnalyticsMetaData/generateDeviceAnalyticsMetaData', + () => jest.fn().mockReturnValue({ deviceProp: 'Device value' }), +); + +jest.mock('../../../reducers/legalNotices', () => ({ + isPastPrivacyPolicyDate: jest.fn().mockReturnValue(true), +})); describe('OptinMetrics', () => { - it('should render correctly', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('render matches snapshot', () => { const { toJSON } = renderScreen( OptinMetrics, { name: 'OptinMetrics' }, @@ -10,4 +49,74 @@ describe('OptinMetrics', () => { ); expect(toJSON()).toMatchSnapshot(); }); + + describe('sets traits and sends metric event on confirm', () => { + it('without marketing consent', async () => { + renderScreen(OptinMetrics, { name: 'OptinMetrics' }, { state: {} }); + fireEvent.press( + screen.getByRole('button', { + name: strings('privacy_policy.cta_i_agree'), + }), + ); + await waitFor(() => { + expect(mockMetrics.trackEvent).toHaveBeenNthCalledWith( + 1, + MetaMetricsEvents.ANALYTICS_PREFERENCE_SELECTED, + { + is_metrics_opted_in: true, + location: 'onboarding_metametrics', + updated_after_onboarding: false, + }, + true, + ); + expect(mockMetrics.addTraitsToUser).toHaveBeenNthCalledWith(1, { + deviceProp: 'Device value', + userProp: 'User value', + is_metrics_opted_in: true, + }); + }); + }); + + it('with marketing consent', async () => { + renderScreen(OptinMetrics, { name: 'OptinMetrics' }, { state: {} }); + fireEvent.press(screen.getByText(strings('privacy_policy.checkbox'))); + fireEvent.press( + screen.getByRole('button', { + name: strings('privacy_policy.cta_i_agree'), + }), + ); + await waitFor(() => { + expect(mockMetrics.trackEvent).toHaveBeenNthCalledWith( + 1, + MetaMetricsEvents.ANALYTICS_PREFERENCE_SELECTED, + { + has_marketing_consent: true, + is_metrics_opted_in: true, + location: 'onboarding_metametrics', + updated_after_onboarding: false, + }, + true, + ); + expect(mockMetrics.addTraitsToUser).toHaveBeenNthCalledWith(1, { + deviceProp: 'Device value', + userProp: 'User value', + is_metrics_opted_in: true, + has_marketing_consent: true, + }); + }); + }); + }); + + it('does not call metrics on cancel', async () => { + renderScreen(OptinMetrics, { name: 'OptinMetrics' }, { state: {} }); + fireEvent.press( + screen.getByRole('button', { + name: strings('privacy_policy.cta_no_thanks'), + }), + ); + await waitFor(() => { + expect(mockMetrics.trackEvent).not.toHaveBeenCalled(); + expect(mockMetrics.addTraitsToUser).not.toHaveBeenCalled(); + }); + }); }); diff --git a/app/components/UI/PaymentRequest/AssetList/index.tsx b/app/components/UI/PaymentRequest/AssetList/index.tsx index 9b44834118f..d3e5975e2a3 100644 --- a/app/components/UI/PaymentRequest/AssetList/index.tsx +++ b/app/components/UI/PaymentRequest/AssetList/index.tsx @@ -10,6 +10,8 @@ import { toChecksumAddress } from 'ethereumjs-util'; import { useTheme } from '../../../../util/theme'; import { selectTokenList } from '../../../../selectors/tokenListController'; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const createStyles = (colors: any) => StyleSheet.create({ item: { @@ -25,6 +27,8 @@ const createStyles = (colors: any) => alignItems: 'flex-start', }, text: { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any ...(fontStyles.normal as any), color: colors.text.default, }, @@ -33,6 +37,8 @@ const createStyles = (colors: any) => paddingBottom: 4, fontSize: 16, color: colors.text.default, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any, assetInfo: { flex: 1, @@ -55,10 +61,14 @@ interface Props { /** * Array of assets objects returned from the search */ + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any searchResults: any; /** * Callback triggered when a token is selected */ + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any handleSelectAsset: any; /** * Message string to display when searchResults is empty @@ -81,6 +91,8 @@ const AssetList = ({ * @param {object} asset - Asset to generate the logo to render */ const renderLogo = useCallback( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (asset: any) => { const { address, isETH } = asset; if (isETH) { @@ -100,27 +112,31 @@ const AssetList = ({ return ( - {searchResults.map((_: any, i: number) => { - const { symbol, name } = searchResults[i] || {}; - return ( - handleSelectAsset(searchResults[i])} // eslint-disable-line - key={i} - > - - - {renderLogo(searchResults[i])} + { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any + searchResults.map((_: any, i: number) => { + const { symbol, name } = searchResults[i] || {}; + return ( + handleSelectAsset(searchResults[i])} // eslint-disable-line + key={i} + > + + + {renderLogo(searchResults[i])} + + + {symbol} + {!!name && {name}} + - - {symbol} - {!!name && {name}} - - - - ); - })} + + ); + }) + } {searchResults.length === 0 && ( {emptyMessage} )} diff --git a/app/components/UI/PaymentRequest/index.js b/app/components/UI/PaymentRequest/index.js index 7eeecdeece4..35cb474d41c 100644 --- a/app/components/UI/PaymentRequest/index.js +++ b/app/components/UI/PaymentRequest/index.js @@ -58,7 +58,7 @@ import { import { selectTokenListArray } from '../../../selectors/tokenListController'; import { selectTokens } from '../../../selectors/tokensController'; import { selectContractExchangeRates } from '../../../selectors/tokenRatesController'; -import { selectSelectedAddress } from '../../../selectors/preferencesController'; +import { selectSelectedInternalAccountChecksummedAddress } from '../../../selectors/accountsController'; import { RequestPaymentViewSelectors } from '../../../../e2e/selectors/RequestPaymentView.selectors'; @@ -893,7 +893,7 @@ const mapStateToProps = (state) => ({ contractExchangeRates: selectContractExchangeRates(state), searchEngine: state.settings.searchEngine, tokens: selectTokens(state), - selectedAddress: selectSelectedAddress(state), + selectedAddress: selectSelectedInternalAccountChecksummedAddress(state), primaryCurrency: state.settings.primaryCurrency, ticker: selectTicker(state), chainId: selectChainId(state), diff --git a/app/components/UI/PaymentRequestSuccess/index.js b/app/components/UI/PaymentRequestSuccess/index.js index 137906ee49b..1310dd135d8 100644 --- a/app/components/UI/PaymentRequestSuccess/index.js +++ b/app/components/UI/PaymentRequestSuccess/index.js @@ -154,7 +154,7 @@ const createStyles = (theme) => qrCodeWrapper: { marginVertical: 8, padding: 8, - backgroundColor: theme.brandColors.white000, + backgroundColor: theme.brandColors.white, }, }); diff --git a/app/components/UI/PhishingModal/__snapshots__/index.test.tsx.snap b/app/components/UI/PhishingModal/__snapshots__/index.test.tsx.snap index c680d2aa7ee..1122a8c0913 100644 --- a/app/components/UI/PhishingModal/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/PhishingModal/__snapshots__/index.test.tsx.snap @@ -31,7 +31,7 @@ exports[`PhishingModal should render correctly 1`] = ` wrapper: { width: 300, height: 300, - backgroundColor: theme.brandColors.white000, + backgroundColor: theme.brandColors.white, alignItems: 'center', justifyContent: 'center', }, diff --git a/app/components/UI/QRHardware/AnimatedQRScanner.tsx b/app/components/UI/QRHardware/AnimatedQRScanner.tsx index cb2047d2a6d..48df3c6509d 100644 --- a/app/components/UI/QRHardware/AnimatedQRScanner.tsx +++ b/app/components/UI/QRHardware/AnimatedQRScanner.tsx @@ -32,7 +32,7 @@ const createStyles = (theme: Theme) => container: { width: '100%', height: '100%', - backgroundColor: theme.brandColors.black000, + backgroundColor: theme.brandColors.black, }, preview: { flex: 1, @@ -57,7 +57,7 @@ const createStyles = (theme: Theme) => text: { flex: 1, fontSize: 17, - color: theme.brandColors.white000, + color: theme.brandColors.white, textAlign: 'center', justifyContent: 'center', marginTop: 100, @@ -72,7 +72,7 @@ const createStyles = (theme: Theme) => hintText: { width: 240, maxWidth: '80%', - color: theme.brandColors.black000, + color: theme.brandColors.black, textAlign: 'center', fontSize: 16, ...fontStyles.normal, diff --git a/app/components/UI/QRHardware/QRSigningDetails.tsx b/app/components/UI/QRHardware/QRSigningDetails.tsx index 2567e571de9..5d2aff96853 100644 --- a/app/components/UI/QRHardware/QRSigningDetails.tsx +++ b/app/components/UI/QRHardware/QRSigningDetails.tsx @@ -49,6 +49,8 @@ interface IQRSigningDetails { fromAddress: string; } +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const createStyles = (colors: any) => StyleSheet.create({ wrapper: { @@ -132,6 +134,8 @@ const QRSigningDetails = ({ const styles = createStyles(colors); const navigation = useNavigation(); const KeyringController = useMemo(() => { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const { KeyringController: keyring } = Engine.context as any; return keyring; }, []); diff --git a/app/components/UI/QRHardware/QRSigningModal/index.tsx b/app/components/UI/QRHardware/QRSigningModal/index.tsx index 6e41c9cd539..1da13f77268 100644 --- a/app/components/UI/QRHardware/QRSigningModal/index.tsx +++ b/app/components/UI/QRHardware/QRSigningModal/index.tsx @@ -16,6 +16,8 @@ interface IQRSigningModalProps { onFailure?: (error: string) => void; } +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const createStyles = (colors: any) => StyleSheet.create({ modal: { diff --git a/app/components/UI/QRHardware/withQRHardwareAwareness.tsx b/app/components/UI/QRHardware/withQRHardwareAwareness.tsx index c02af74ea6b..607c521c875 100644 --- a/app/components/UI/QRHardware/withQRHardwareAwareness.tsx +++ b/app/components/UI/QRHardware/withQRHardwareAwareness.tsx @@ -9,6 +9,8 @@ const withQRHardwareAwareness = ( isSyncingQRHardware?: boolean; }>, ) => { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const QRHardwareAwareness = (props: any) => { const [QRState, SetQRState] = useState({ sync: { @@ -17,6 +19,8 @@ const withQRHardwareAwareness = ( sign: {}, }); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const subscribeKeyringState = (value: any) => { SetQRState(value); }; diff --git a/app/components/UI/Ramp/Views/BuildQuote/BuildQuote.test.tsx b/app/components/UI/Ramp/Views/BuildQuote/BuildQuote.test.tsx index 51d0c86a35b..c9d0dc77f24 100644 --- a/app/components/UI/Ramp/Views/BuildQuote/BuildQuote.test.tsx +++ b/app/components/UI/Ramp/Views/BuildQuote/BuildQuote.test.tsx @@ -24,6 +24,7 @@ import useBalance from '../../hooks/useBalance'; import { toTokenMinimalUnit } from '../../../../../util/number'; import { RampType } from '../../../../../reducers/fiatOrders/types'; import { NATIVE_ADDRESS } from '../../../../../constants/on-ramp'; +import { MOCK_ACCOUNTS_CONTROLLER_STATE } from '../../../../../util/test/accountsControllerTestUtils'; const getByRoleButton = (name?: string | RegExp) => screen.getByRole('button', { name }); @@ -37,7 +38,10 @@ function render(Component: React.ComponentType) { { state: { engine: { - backgroundState: initialBackgroundState, + backgroundState: { + ...initialBackgroundState, + AccountsController: MOCK_ACCOUNTS_CONTROLLER_STATE, + }, }, }, }, diff --git a/app/components/UI/Ramp/Views/BuildQuote/BuildQuote.tsx b/app/components/UI/Ramp/Views/BuildQuote/BuildQuote.tsx index 67961137cf3..0db2fdf620c 100644 --- a/app/components/UI/Ramp/Views/BuildQuote/BuildQuote.tsx +++ b/app/components/UI/Ramp/Views/BuildQuote/BuildQuote.tsx @@ -73,7 +73,11 @@ import { import useGasPriceEstimation from '../../hooks/useGasPriceEstimation'; // TODO: Convert into typescript and correctly type +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const ListItem = BaseListItem as any; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const SelectorButton = BaseSelectorButton as any; const TRANSFER_GAS_LIMIT = 21000; @@ -186,16 +190,19 @@ const BuildQuote = () => { estimateRange: 'high', }); - const assetForBalance = - selectedAsset && selectedAsset.address !== NATIVE_ADDRESS - ? { - address: selectedAsset.address, - symbol: selectedAsset.symbol, - decimals: selectedAsset.decimals, - } - : { - isETH: true, - }; + const assetForBalance = useMemo( + () => + selectedAsset && selectedAsset.address !== NATIVE_ADDRESS + ? { + address: selectedAsset.address, + symbol: selectedAsset.symbol, + decimals: selectedAsset.decimals, + } + : { + isETH: true, + }, + [selectedAsset], + ); const { addressBalance } = useAddressBalance( assetForBalance as Asset, diff --git a/app/components/UI/Ramp/Views/BuildQuote/__snapshots__/BuildQuote.test.tsx.snap b/app/components/UI/Ramp/Views/BuildQuote/__snapshots__/BuildQuote.test.tsx.snap index 42908245ba4..296f15104a3 100644 --- a/app/components/UI/Ramp/Views/BuildQuote/__snapshots__/BuildQuote.test.tsx.snap +++ b/app/components/UI/Ramp/Views/BuildQuote/__snapshots__/BuildQuote.test.tsx.snap @@ -54,7 +54,7 @@ exports[`BuildQuote View Crypto Currency Data renders a special error page if cr collapsable={false} style={ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderBottomColor": "rgb(216, 216, 216)", "elevation": 0, "flex": 1, @@ -130,7 +130,7 @@ exports[`BuildQuote View Crypto Currency Data renders a special error page if cr + + + + + + + Account 2 ( + > + 0xC496...a756 + ) + + + + + + + Account 2 ( + > + 0xC496...a756 + ) } > @@ -478,7 +478,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -562,7 +562,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 12, "height": 24, "justifyContent": "center", @@ -593,7 +593,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -644,7 +644,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -670,7 +670,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing undefined, undefined, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, undefined, @@ -716,7 +716,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 12, "height": 24, "justifyContent": "center", @@ -747,7 +747,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -798,7 +798,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -824,7 +824,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing undefined, undefined, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, undefined, @@ -939,7 +939,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing } > @@ -2234,7 +2234,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -2318,7 +2318,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 12, "height": 24, "justifyContent": "center", @@ -2349,7 +2349,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -2400,7 +2400,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -2426,7 +2426,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing undefined, undefined, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, undefined, @@ -2472,7 +2472,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 12, "height": 24, "justifyContent": "center", @@ -2503,7 +2503,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -2554,7 +2554,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -2580,7 +2580,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing undefined, undefined, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, undefined, @@ -2626,7 +2626,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 12, "height": 24, "justifyContent": "center", @@ -2657,7 +2657,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -2708,7 +2708,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -2734,7 +2734,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing undefined, undefined, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, undefined, @@ -2780,7 +2780,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 12, "height": 24, "justifyContent": "center", @@ -2813,7 +2813,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -2864,7 +2864,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -2890,7 +2890,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing undefined, undefined, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, undefined, @@ -2975,7 +2975,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = ` collapsable={false} style={ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderBottomColor": "rgb(216, 216, 216)", "elevation": 0, "flex": 1, @@ -3065,7 +3065,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = ` numberOfLines={1} style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -3095,7 +3095,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = ` }, { "backgroundColor": "transparent", - "borderColor": "#BBC0C5", + "borderColor": "#bbc0c5", "borderWidth": 1, }, ] @@ -3106,7 +3106,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = ` numberOfLines={1} style={ { - "color": "#535A61", + "color": "#6a737d", "fontFamily": "EuclidCircularB-Regular", "fontSize": 11, "fontWeight": "400", @@ -3149,7 +3149,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = ` } > @@ -3399,7 +3399,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -3483,7 +3483,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 12, "height": 24, "justifyContent": "center", @@ -3514,7 +3514,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -3565,7 +3565,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -3591,7 +3591,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = ` undefined, undefined, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, undefined, @@ -3637,7 +3637,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 12, "height": 24, "justifyContent": "center", @@ -3668,7 +3668,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -3719,7 +3719,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -3745,7 +3745,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = ` undefined, undefined, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, undefined, @@ -3791,7 +3791,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 12, "height": 24, "justifyContent": "center", @@ -3822,7 +3822,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -3873,7 +3873,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -3899,7 +3899,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = ` undefined, undefined, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, undefined, @@ -3945,7 +3945,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 12, "height": 24, "justifyContent": "center", @@ -3978,7 +3978,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -4029,7 +4029,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -4055,7 +4055,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = ` undefined, undefined, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, undefined, @@ -4140,7 +4140,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = ` collapsable={false} style={ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderBottomColor": "rgb(216, 216, 216)", "elevation": 0, "flex": 1, @@ -4230,7 +4230,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = ` numberOfLines={1} style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -4260,7 +4260,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = ` }, { "backgroundColor": "transparent", - "borderColor": "#BBC0C5", + "borderColor": "#bbc0c5", "borderWidth": 1, }, ] @@ -4271,7 +4271,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = ` numberOfLines={1} style={ { - "color": "#535A61", + "color": "#6a737d", "fontFamily": "EuclidCircularB-Regular", "fontSize": 11, "fontWeight": "400", @@ -4314,7 +4314,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = ` } > @@ -4564,7 +4564,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -4648,7 +4648,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = ` style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 12, "height": 24, "justifyContent": "center", @@ -4679,7 +4679,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -4730,7 +4730,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -4756,7 +4756,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = ` undefined, undefined, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, undefined, @@ -4802,7 +4802,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = ` style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 12, "height": 24, "justifyContent": "center", @@ -4833,7 +4833,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -4884,7 +4884,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -4910,7 +4910,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = ` undefined, undefined, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, undefined, @@ -4956,7 +4956,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = ` style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 12, "height": 24, "justifyContent": "center", @@ -4987,7 +4987,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -5038,7 +5038,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -5064,7 +5064,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = ` undefined, undefined, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, undefined, @@ -5110,7 +5110,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = ` style={ { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 12, "height": 24, "justifyContent": "center", @@ -5143,7 +5143,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -5194,7 +5194,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -5220,7 +5220,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = ` undefined, undefined, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, undefined, @@ -5305,7 +5305,7 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = ` collapsable={false} style={ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderBottomColor": "rgb(216, 216, 216)", "elevation": 0, "flex": 1, @@ -5395,7 +5395,7 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = ` numberOfLines={1} style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -5425,7 +5425,7 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = ` }, { "backgroundColor": "transparent", - "borderColor": "#BBC0C5", + "borderColor": "#bbc0c5", "borderWidth": 1, }, ] @@ -5436,7 +5436,7 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = ` numberOfLines={1} style={ { - "color": "#535A61", + "color": "#6a737d", "fontFamily": "EuclidCircularB-Regular", "fontSize": 11, "fontWeight": "400", @@ -5479,7 +5479,7 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = ` } > @@ -5729,7 +5729,7 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -5819,7 +5819,7 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -5858,7 +5858,7 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -5921,7 +5921,7 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -5960,7 +5960,7 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -6023,7 +6023,7 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -6062,7 +6062,7 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -6125,7 +6125,7 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -6164,7 +6164,7 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -6227,7 +6227,7 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -6266,7 +6266,7 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -6329,7 +6329,7 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -6368,7 +6368,7 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -6431,7 +6431,7 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -6470,7 +6470,7 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -6568,7 +6568,7 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = ` collapsable={false} style={ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderBottomColor": "rgb(216, 216, 216)", "elevation": 0, "flex": 1, @@ -6658,7 +6658,7 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = ` numberOfLines={1} style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -6688,7 +6688,7 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = ` }, { "backgroundColor": "transparent", - "borderColor": "#BBC0C5", + "borderColor": "#bbc0c5", "borderWidth": 1, }, ] @@ -6699,7 +6699,7 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = ` numberOfLines={1} style={ { - "color": "#535A61", + "color": "#6a737d", "fontFamily": "EuclidCircularB-Regular", "fontSize": 11, "fontWeight": "400", @@ -6742,7 +6742,7 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = ` } > @@ -6992,7 +6992,7 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -7082,7 +7082,7 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -7121,7 +7121,7 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -7184,7 +7184,7 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -7223,7 +7223,7 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -7286,7 +7286,7 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -7325,7 +7325,7 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -7388,7 +7388,7 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -7427,7 +7427,7 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -7490,7 +7490,7 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -7529,7 +7529,7 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -7592,7 +7592,7 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -7631,7 +7631,7 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -7694,7 +7694,7 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -7733,7 +7733,7 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = ` style={ [ { - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 30, "padding": 14, }, @@ -7831,7 +7831,7 @@ exports[`NetworkSwitcher View renders correctly with errors 1`] = ` collapsable={false} style={ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderBottomColor": "rgb(216, 216, 216)", "elevation": 0, "flex": 1, @@ -7921,7 +7921,7 @@ exports[`NetworkSwitcher View renders correctly with errors 1`] = ` numberOfLines={1} style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -7951,7 +7951,7 @@ exports[`NetworkSwitcher View renders correctly with errors 1`] = ` }, { "backgroundColor": "transparent", - "borderColor": "#BBC0C5", + "borderColor": "#bbc0c5", "borderWidth": 1, }, ] @@ -7962,7 +7962,7 @@ exports[`NetworkSwitcher View renders correctly with errors 1`] = ` numberOfLines={1} style={ { - "color": "#535A61", + "color": "#6a737d", "fontFamily": "EuclidCircularB-Regular", "fontSize": 11, "fontWeight": "400", @@ -8005,7 +8005,7 @@ exports[`NetworkSwitcher View renders correctly with errors 1`] = ` = { const mockOrder: DeepPartial = { id: 'test-order-1', - account: '0x0', + account: MOCK_ADDRESS_1, network: '1', cryptoAmount: '0.01231324', orderType: OrderOrderTypeEnum.Buy, @@ -136,7 +140,10 @@ function render(Component: React.ComponentType, orders = [mockOrder]) { { state: { engine: { - backgroundState: initialBackgroundState, + backgroundState: { + ...initialBackgroundState, + AccountsController: MOCK_ACCOUNTS_CONTROLLER_STATE, + }, }, fiatOrders: { orders: orders as FiatOrder[], diff --git a/app/components/UI/Ramp/Views/OrderDetails/__snapshots__/OrderDetails.test.tsx.snap b/app/components/UI/Ramp/Views/OrderDetails/__snapshots__/OrderDetails.test.tsx.snap index d26a8cc2998..dd227168f98 100644 --- a/app/components/UI/Ramp/Views/OrderDetails/__snapshots__/OrderDetails.test.tsx.snap +++ b/app/components/UI/Ramp/Views/OrderDetails/__snapshots__/OrderDetails.test.tsx.snap @@ -54,7 +54,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` collapsable={false} style={ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderBottomColor": "rgb(216, 216, 216)", "elevation": 0, "flex": 1, @@ -130,7 +130,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` } > @@ -507,7 +507,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -529,7 +529,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -555,7 +555,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -570,7 +570,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` undefined, undefined, { - "color": "#535A61", + "color": "#6a737d", }, undefined, undefined, @@ -609,7 +609,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -631,7 +631,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -659,7 +659,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -674,7 +674,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` undefined, undefined, { - "color": "#535A61", + "color": "#6a737d", }, undefined, undefined, @@ -718,7 +718,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` style={ [ { - "borderColor": "#BBC0C5", + "borderColor": "#bbc0c5", "borderRadius": 8, "borderWidth": 1.5, "padding": 16, @@ -743,7 +743,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` [ { "alignItems": "center", - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 100, "flexDirection": "row", "flexShrink": 1, @@ -762,7 +762,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` - 0x0 + 0xC495...D272 ) @@ -908,7 +908,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -919,14 +919,14 @@ exports[`OrderDetails renders a cancelled order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -968,7 +968,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -990,7 +990,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -1045,7 +1045,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1056,14 +1056,14 @@ exports[`OrderDetails renders a cancelled order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -1102,7 +1102,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1122,7 +1122,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -1151,7 +1151,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1166,7 +1166,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` undefined, undefined, { - "color": "#535A61", + "color": "#6a737d", }, undefined, undefined, @@ -1224,7 +1224,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1235,14 +1235,14 @@ exports[`OrderDetails renders a cancelled order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -1281,7 +1281,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1301,7 +1301,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -1367,7 +1367,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1378,14 +1378,14 @@ exports[`OrderDetails renders a cancelled order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -1426,7 +1426,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1496,7 +1496,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1507,14 +1507,14 @@ exports[`OrderDetails renders a cancelled order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -1555,7 +1555,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1626,7 +1626,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1637,14 +1637,14 @@ exports[`OrderDetails renders a cancelled order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -1683,7 +1683,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1724,7 +1724,7 @@ exports[`OrderDetails renders a cancelled order 1`] = ` } > @@ -2437,7 +2437,7 @@ exports[`OrderDetails renders a completed order 1`] = ` style={ [ { - "color": "#1C8234", + "color": "#1c8234", "fontSize": 32, }, undefined, @@ -2463,7 +2463,7 @@ exports[`OrderDetails renders a completed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -2485,7 +2485,7 @@ exports[`OrderDetails renders a completed order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -2511,7 +2511,7 @@ exports[`OrderDetails renders a completed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -2526,7 +2526,7 @@ exports[`OrderDetails renders a completed order 1`] = ` undefined, undefined, { - "color": "#535A61", + "color": "#6a737d", }, undefined, undefined, @@ -2565,7 +2565,7 @@ exports[`OrderDetails renders a completed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -2587,7 +2587,7 @@ exports[`OrderDetails renders a completed order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -2615,7 +2615,7 @@ exports[`OrderDetails renders a completed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -2630,7 +2630,7 @@ exports[`OrderDetails renders a completed order 1`] = ` undefined, undefined, { - "color": "#535A61", + "color": "#6a737d", }, undefined, undefined, @@ -2674,7 +2674,7 @@ exports[`OrderDetails renders a completed order 1`] = ` style={ [ { - "borderColor": "#BBC0C5", + "borderColor": "#bbc0c5", "borderRadius": 8, "borderWidth": 1.5, "padding": 16, @@ -2699,7 +2699,7 @@ exports[`OrderDetails renders a completed order 1`] = ` [ { "alignItems": "center", - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 100, "flexDirection": "row", "flexShrink": 1, @@ -2718,7 +2718,7 @@ exports[`OrderDetails renders a completed order 1`] = ` - 0x0 + 0xC495...D272 ) @@ -2864,7 +2864,7 @@ exports[`OrderDetails renders a completed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -2875,14 +2875,14 @@ exports[`OrderDetails renders a completed order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -2924,7 +2924,7 @@ exports[`OrderDetails renders a completed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -2946,7 +2946,7 @@ exports[`OrderDetails renders a completed order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -3001,7 +3001,7 @@ exports[`OrderDetails renders a completed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -3012,14 +3012,14 @@ exports[`OrderDetails renders a completed order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -3058,7 +3058,7 @@ exports[`OrderDetails renders a completed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -3078,7 +3078,7 @@ exports[`OrderDetails renders a completed order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -3107,7 +3107,7 @@ exports[`OrderDetails renders a completed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -3122,7 +3122,7 @@ exports[`OrderDetails renders a completed order 1`] = ` undefined, undefined, { - "color": "#535A61", + "color": "#6a737d", }, undefined, undefined, @@ -3180,7 +3180,7 @@ exports[`OrderDetails renders a completed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -3191,14 +3191,14 @@ exports[`OrderDetails renders a completed order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -3237,7 +3237,7 @@ exports[`OrderDetails renders a completed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -3257,7 +3257,7 @@ exports[`OrderDetails renders a completed order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -3323,7 +3323,7 @@ exports[`OrderDetails renders a completed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -3334,14 +3334,14 @@ exports[`OrderDetails renders a completed order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -3382,7 +3382,7 @@ exports[`OrderDetails renders a completed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -3452,7 +3452,7 @@ exports[`OrderDetails renders a completed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -3463,14 +3463,14 @@ exports[`OrderDetails renders a completed order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -3511,7 +3511,7 @@ exports[`OrderDetails renders a completed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -3582,7 +3582,7 @@ exports[`OrderDetails renders a completed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -3593,14 +3593,14 @@ exports[`OrderDetails renders a completed order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -3639,7 +3639,7 @@ exports[`OrderDetails renders a completed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -3680,7 +3680,7 @@ exports[`OrderDetails renders a completed order 1`] = ` } > @@ -4391,7 +4391,7 @@ exports[`OrderDetails renders a created order 1`] = ` - 0x0 + 0xC495...D272 ) @@ -4805,7 +4805,7 @@ exports[`OrderDetails renders a created order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -4816,14 +4816,14 @@ exports[`OrderDetails renders a created order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -4865,7 +4865,7 @@ exports[`OrderDetails renders a created order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -4887,7 +4887,7 @@ exports[`OrderDetails renders a created order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -4942,7 +4942,7 @@ exports[`OrderDetails renders a created order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -4953,14 +4953,14 @@ exports[`OrderDetails renders a created order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -4999,7 +4999,7 @@ exports[`OrderDetails renders a created order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -5019,7 +5019,7 @@ exports[`OrderDetails renders a created order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -5048,7 +5048,7 @@ exports[`OrderDetails renders a created order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -5063,7 +5063,7 @@ exports[`OrderDetails renders a created order 1`] = ` undefined, undefined, { - "color": "#535A61", + "color": "#6a737d", }, undefined, undefined, @@ -5121,7 +5121,7 @@ exports[`OrderDetails renders a created order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -5132,14 +5132,14 @@ exports[`OrderDetails renders a created order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -5178,7 +5178,7 @@ exports[`OrderDetails renders a created order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -5198,7 +5198,7 @@ exports[`OrderDetails renders a created order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -5264,7 +5264,7 @@ exports[`OrderDetails renders a created order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -5275,14 +5275,14 @@ exports[`OrderDetails renders a created order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -5323,7 +5323,7 @@ exports[`OrderDetails renders a created order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -5393,7 +5393,7 @@ exports[`OrderDetails renders a created order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -5404,14 +5404,14 @@ exports[`OrderDetails renders a created order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -5452,7 +5452,7 @@ exports[`OrderDetails renders a created order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -5523,7 +5523,7 @@ exports[`OrderDetails renders a created order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -5534,14 +5534,14 @@ exports[`OrderDetails renders a created order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -5580,7 +5580,7 @@ exports[`OrderDetails renders a created order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -5621,7 +5621,7 @@ exports[`OrderDetails renders a created order 1`] = ` } > @@ -6296,7 +6296,7 @@ exports[`OrderDetails renders a failed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -6318,7 +6318,7 @@ exports[`OrderDetails renders a failed order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -6344,7 +6344,7 @@ exports[`OrderDetails renders a failed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -6359,7 +6359,7 @@ exports[`OrderDetails renders a failed order 1`] = ` undefined, undefined, { - "color": "#535A61", + "color": "#6a737d", }, undefined, undefined, @@ -6398,7 +6398,7 @@ exports[`OrderDetails renders a failed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -6420,7 +6420,7 @@ exports[`OrderDetails renders a failed order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -6448,7 +6448,7 @@ exports[`OrderDetails renders a failed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -6463,7 +6463,7 @@ exports[`OrderDetails renders a failed order 1`] = ` undefined, undefined, { - "color": "#535A61", + "color": "#6a737d", }, undefined, undefined, @@ -6507,7 +6507,7 @@ exports[`OrderDetails renders a failed order 1`] = ` style={ [ { - "borderColor": "#BBC0C5", + "borderColor": "#bbc0c5", "borderRadius": 8, "borderWidth": 1.5, "padding": 16, @@ -6532,7 +6532,7 @@ exports[`OrderDetails renders a failed order 1`] = ` [ { "alignItems": "center", - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 100, "flexDirection": "row", "flexShrink": 1, @@ -6551,7 +6551,7 @@ exports[`OrderDetails renders a failed order 1`] = ` - 0x0 + 0xC495...D272 ) @@ -6697,7 +6697,7 @@ exports[`OrderDetails renders a failed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -6708,14 +6708,14 @@ exports[`OrderDetails renders a failed order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -6757,7 +6757,7 @@ exports[`OrderDetails renders a failed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -6779,7 +6779,7 @@ exports[`OrderDetails renders a failed order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -6834,7 +6834,7 @@ exports[`OrderDetails renders a failed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -6845,14 +6845,14 @@ exports[`OrderDetails renders a failed order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -6891,7 +6891,7 @@ exports[`OrderDetails renders a failed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -6911,7 +6911,7 @@ exports[`OrderDetails renders a failed order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -6940,7 +6940,7 @@ exports[`OrderDetails renders a failed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -6955,7 +6955,7 @@ exports[`OrderDetails renders a failed order 1`] = ` undefined, undefined, { - "color": "#535A61", + "color": "#6a737d", }, undefined, undefined, @@ -7013,7 +7013,7 @@ exports[`OrderDetails renders a failed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -7024,14 +7024,14 @@ exports[`OrderDetails renders a failed order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -7070,7 +7070,7 @@ exports[`OrderDetails renders a failed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -7090,7 +7090,7 @@ exports[`OrderDetails renders a failed order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -7156,7 +7156,7 @@ exports[`OrderDetails renders a failed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -7167,14 +7167,14 @@ exports[`OrderDetails renders a failed order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -7215,7 +7215,7 @@ exports[`OrderDetails renders a failed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -7285,7 +7285,7 @@ exports[`OrderDetails renders a failed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -7296,14 +7296,14 @@ exports[`OrderDetails renders a failed order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -7344,7 +7344,7 @@ exports[`OrderDetails renders a failed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -7415,7 +7415,7 @@ exports[`OrderDetails renders a failed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -7426,14 +7426,14 @@ exports[`OrderDetails renders a failed order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -7472,7 +7472,7 @@ exports[`OrderDetails renders a failed order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -7513,7 +7513,7 @@ exports[`OrderDetails renders a failed order 1`] = ` } > @@ -8224,7 +8224,7 @@ exports[`OrderDetails renders a pending order 1`] = ` - 0x0 + 0xC495...D272 ) @@ -8638,7 +8638,7 @@ exports[`OrderDetails renders a pending order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -8649,14 +8649,14 @@ exports[`OrderDetails renders a pending order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -8698,7 +8698,7 @@ exports[`OrderDetails renders a pending order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -8720,7 +8720,7 @@ exports[`OrderDetails renders a pending order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -8775,7 +8775,7 @@ exports[`OrderDetails renders a pending order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -8786,14 +8786,14 @@ exports[`OrderDetails renders a pending order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -8832,7 +8832,7 @@ exports[`OrderDetails renders a pending order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -8852,7 +8852,7 @@ exports[`OrderDetails renders a pending order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -8881,7 +8881,7 @@ exports[`OrderDetails renders a pending order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -8896,7 +8896,7 @@ exports[`OrderDetails renders a pending order 1`] = ` undefined, undefined, { - "color": "#535A61", + "color": "#6a737d", }, undefined, undefined, @@ -8954,7 +8954,7 @@ exports[`OrderDetails renders a pending order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -8965,14 +8965,14 @@ exports[`OrderDetails renders a pending order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -9011,7 +9011,7 @@ exports[`OrderDetails renders a pending order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -9031,7 +9031,7 @@ exports[`OrderDetails renders a pending order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -9097,7 +9097,7 @@ exports[`OrderDetails renders a pending order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -9108,14 +9108,14 @@ exports[`OrderDetails renders a pending order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -9156,7 +9156,7 @@ exports[`OrderDetails renders a pending order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -9226,7 +9226,7 @@ exports[`OrderDetails renders a pending order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -9237,14 +9237,14 @@ exports[`OrderDetails renders a pending order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -9285,7 +9285,7 @@ exports[`OrderDetails renders a pending order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -9356,7 +9356,7 @@ exports[`OrderDetails renders a pending order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -9367,14 +9367,14 @@ exports[`OrderDetails renders a pending order 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -9413,7 +9413,7 @@ exports[`OrderDetails renders a pending order 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -9454,7 +9454,7 @@ exports[`OrderDetails renders a pending order 1`] = ` } > @@ -11243,7 +11243,7 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` - 0x0 + 0xC495...D272 ) @@ -11702,7 +11702,7 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -11713,14 +11713,14 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -11762,7 +11762,7 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -11784,7 +11784,7 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -11839,7 +11839,7 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -11850,14 +11850,14 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -11896,7 +11896,7 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -11916,7 +11916,7 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -11945,7 +11945,7 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -11960,7 +11960,7 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` undefined, undefined, { - "color": "#535A61", + "color": "#6a737d", }, undefined, undefined, @@ -12018,7 +12018,7 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -12029,14 +12029,14 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -12075,7 +12075,7 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -12095,7 +12095,7 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -12161,7 +12161,7 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -12172,14 +12172,14 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -12220,7 +12220,7 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -12290,7 +12290,7 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -12301,14 +12301,14 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -12349,7 +12349,7 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -12420,7 +12420,7 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -12431,14 +12431,14 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -12477,7 +12477,7 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -12518,7 +12518,7 @@ exports[`OrderDetails renders non-transacted orders 1`] = ` } > @@ -13244,7 +13244,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` style={ [ { - "color": "#1C8234", + "color": "#1c8234", "fontSize": 32, }, undefined, @@ -13270,7 +13270,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -13292,7 +13292,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -13318,7 +13318,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -13333,7 +13333,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` undefined, undefined, { - "color": "#535A61", + "color": "#6a737d", }, undefined, undefined, @@ -13372,7 +13372,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -13394,7 +13394,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -13422,7 +13422,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -13437,7 +13437,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` undefined, undefined, { - "color": "#535A61", + "color": "#6a737d", }, undefined, undefined, @@ -13479,7 +13479,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -13509,7 +13509,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` undefined, undefined, { - "color": "#0376C9", + "color": "#0376c9", }, undefined, undefined, @@ -13538,7 +13538,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` style={ [ { - "borderColor": "#BBC0C5", + "borderColor": "#bbc0c5", "borderRadius": 8, "borderWidth": 1.5, "padding": 16, @@ -13563,7 +13563,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` [ { "alignItems": "center", - "backgroundColor": "#F2F4F6", + "backgroundColor": "#f2f4f6", "borderRadius": 100, "flexDirection": "row", "flexShrink": 1, @@ -13582,7 +13582,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` - 0x0 + 0xC495...D272 ) @@ -13728,7 +13728,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -13739,14 +13739,14 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -13788,7 +13788,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -13810,7 +13810,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -13865,7 +13865,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -13876,14 +13876,14 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -13922,7 +13922,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -13942,7 +13942,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -13971,7 +13971,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -13986,7 +13986,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` undefined, undefined, { - "color": "#535A61", + "color": "#6a737d", }, undefined, undefined, @@ -14019,7 +14019,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -14034,7 +14034,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` undefined, undefined, { - "color": "#535A61", + "color": "#6a737d", }, undefined, undefined, @@ -14095,7 +14095,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -14106,14 +14106,14 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -14152,7 +14152,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -14172,7 +14172,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -14238,7 +14238,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -14249,14 +14249,14 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -14297,7 +14297,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -14367,7 +14367,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -14378,14 +14378,14 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -14426,7 +14426,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -14497,7 +14497,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -14508,14 +14508,14 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -14554,7 +14554,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -14595,7 +14595,7 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = ` } > @@ -15306,7 +15306,7 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription - 0x0 + 0xC495...D272 ) @@ -15720,7 +15720,7 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -15731,14 +15731,14 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -15780,7 +15780,7 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -15802,7 +15802,7 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -15857,7 +15857,7 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -15868,14 +15868,14 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -15914,7 +15914,7 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -15934,7 +15934,7 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -15963,7 +15963,7 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -15978,7 +15978,7 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription undefined, undefined, { - "color": "#535A61", + "color": "#6a737d", }, undefined, undefined, @@ -16036,7 +16036,7 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -16047,14 +16047,14 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -16093,7 +16093,7 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -16113,7 +16113,7 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -16179,7 +16179,7 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -16190,14 +16190,14 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -16238,7 +16238,7 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -16308,7 +16308,7 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -16319,14 +16319,14 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -16367,7 +16367,7 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -16438,7 +16438,7 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -16449,14 +16449,14 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -16495,7 +16495,7 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -16536,7 +16536,7 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription } > @@ -17194,7 +17194,7 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending - 0x0 + 0xC495...D272 ) @@ -17653,7 +17653,7 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -17664,14 +17664,14 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -17713,7 +17713,7 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -17735,7 +17735,7 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -17790,7 +17790,7 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -17801,14 +17801,14 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -17847,7 +17847,7 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -17867,7 +17867,7 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -17896,7 +17896,7 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -17911,7 +17911,7 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending undefined, undefined, { - "color": "#535A61", + "color": "#6a737d", }, undefined, undefined, @@ -17969,7 +17969,7 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -17980,14 +17980,14 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -18026,7 +18026,7 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -18046,7 +18046,7 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -18112,7 +18112,7 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -18123,14 +18123,14 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -18171,7 +18171,7 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -18241,7 +18241,7 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -18252,14 +18252,14 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -18300,7 +18300,7 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -18371,7 +18371,7 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -18382,14 +18382,14 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, undefined, undefined, { - "color": "#24272A", + "color": "#141618", }, undefined, undefined, @@ -18428,7 +18428,7 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -18469,7 +18469,7 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending = { [key in keyof BaseType]?: DeepPartial; }; +const MOCK_ADDRESS = '0xe64dD0AB5ad7e8C5F2bf6Ce75C34e187af8b920A'; + const testOrders: DeepPartial[] = [ { id: 'test-order-1', - account: '0x0', + account: MOCK_ADDRESS, network: '1', cryptoAmount: '0.01231324', orderType: 'BUY', @@ -39,7 +42,7 @@ const testOrders: DeepPartial[] = [ }, { id: 'test-order-2', - account: '0x0', + account: MOCK_ADDRESS, network: '1', cryptoAmount: '0.01231324', orderType: 'SELL', @@ -62,7 +65,7 @@ const testOrders: DeepPartial[] = [ }, { id: 'test-order-3', - account: '0x0', + account: MOCK_ADDRESS, network: '1', cryptoAmount: '0.01231324', orderType: 'BUY', @@ -85,7 +88,7 @@ const testOrders: DeepPartial[] = [ }, { id: 'test-order-4', - account: '0x0', + account: MOCK_ADDRESS, network: '1', orderType: 'BUY', state: FIAT_ORDER_STATES.PENDING, @@ -105,6 +108,10 @@ const testOrders: DeepPartial[] = [ }, ]; +const MOCK_ACCOUNTS_CONTROLLER_STATE = createMockAccountsControllerState([ + MOCK_ADDRESS, +]); + function render(Component: React.ReactElement, orders = testOrders) { return renderWithProvider(Component, { state: { @@ -112,10 +119,10 @@ function render(Component: React.ReactElement, orders = testOrders) { backgroundState: { ...initialBackgroundState, PreferencesController: { - selectedAddress: '0x0', + selectedAddress: MOCK_ADDRESS, identities: { - '0x0': { - address: '0x0', + [MOCK_ADDRESS]: { + address: MOCK_ADDRESS, name: 'Account 1', }, }, @@ -128,6 +135,7 @@ function render(Component: React.ReactElement, orders = testOrders) { chainId: '0x1', }, }, + AccountsController: MOCK_ACCOUNTS_CONTROLLER_STATE, }, }, fiatOrders: { diff --git a/app/components/UI/Ramp/Views/OrdersList/__snapshots__/OrdersList.test.tsx.snap b/app/components/UI/Ramp/Views/OrdersList/__snapshots__/OrdersList.test.tsx.snap index d8e5c80f43a..77a0531d497 100644 --- a/app/components/UI/Ramp/Views/OrdersList/__snapshots__/OrdersList.test.tsx.snap +++ b/app/components/UI/Ramp/Views/OrdersList/__snapshots__/OrdersList.test.tsx.snap @@ -53,7 +53,7 @@ exports[`OrdersList renders buy only correctly when pressing buy filter 1`] = ` data={ [ { - "account": "0x0", + "account": "0xe64dD0AB5ad7e8C5F2bf6Ce75C34e187af8b920A", "amount": "34.23", "createdAt": 1697242033399, "cryptoAmount": "0.01231324", @@ -76,7 +76,7 @@ exports[`OrdersList renders buy only correctly when pressing buy filter 1`] = ` "state": "COMPLETED", }, { - "account": "0x0", + "account": "0xe64dD0AB5ad7e8C5F2bf6Ce75C34e187af8b920A", "amount": "34.23", "createdAt": 1697242033399, "cryptoAmount": "0.01231324", @@ -99,7 +99,7 @@ exports[`OrdersList renders buy only correctly when pressing buy filter 1`] = ` "state": "PENDING", }, { - "account": "0x0", + "account": "0xe64dD0AB5ad7e8C5F2bf6Ce75C34e187af8b920A", "cryptocurrency": "ETH", "currency": "USD", "data": { @@ -177,7 +177,7 @@ exports[`OrdersList renders buy only correctly when pressing buy filter 1`] = ` "alignItems": "center", "alignSelf": "flex-start", "backgroundColor": "transparent", - "borderColor": "#0376C9", + "borderColor": "#0376c9", "borderRadius": 16, "borderWidth": 1, "flexDirection": "row", @@ -192,7 +192,7 @@ exports[`OrdersList renders buy only correctly when pressing buy filter 1`] = ` accessibilityRole="text" style={ { - "color": "#0376C9", + "color": "#0376c9", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -215,8 +215,8 @@ exports[`OrdersList renders buy only correctly when pressing buy filter 1`] = ` { "alignItems": "center", "alignSelf": "flex-start", - "backgroundColor": "#0376C9", - "borderColor": "#0376C9", + "backgroundColor": "#0376c9", + "borderColor": "#0376c9", "borderRadius": 16, "borderWidth": 1, "flexDirection": "row", @@ -231,7 +231,7 @@ exports[`OrdersList renders buy only correctly when pressing buy filter 1`] = ` accessibilityRole="text" style={ { - "color": "#FFFFFF", + "color": "#ffffff", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -255,7 +255,7 @@ exports[`OrdersList renders buy only correctly when pressing buy filter 1`] = ` "alignItems": "center", "alignSelf": "flex-start", "backgroundColor": "transparent", - "borderColor": "#0376C9", + "borderColor": "#0376c9", "borderRadius": 16, "borderWidth": 1, "flexDirection": "row", @@ -270,7 +270,7 @@ exports[`OrdersList renders buy only correctly when pressing buy filter 1`] = ` accessibilityRole="text" style={ { - "color": "#0376C9", + "color": "#0376c9", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -299,10 +299,10 @@ exports[`OrdersList renders buy only correctly when pressing buy filter 1`] = ` style={ { "borderBottomWidth": 0.5, - "borderColor": "#D6D9DC", + "borderColor": "#bbc0c566", } } - underlayColor="#F2F4F6" + underlayColor="#f2f4f6" > @@ -142,10 +145,9 @@ function ActivationKeys() { - handleEditPress( @@ -155,35 +157,22 @@ function ActivationKeys() { ) } hitSlop={{ top: 20, bottom: 20, left: 20, right: 20 }} - > - - + iconName={IconName.Edit} + iconColor={IconColor.Primary} + size={ButtonIconSizes.Lg} + /> - removeActivationKey(activationKey.key)} hitSlop={{ top: 20, bottom: 20, left: 20, right: 20 }} - > - - + iconName={IconName.Trash} + iconColor={IconColor.Error} + size={ButtonIconSizes.Lg} + /> ))} diff --git a/app/components/UI/Ramp/Views/Settings/Settings.tsx b/app/components/UI/Ramp/Views/Settings/Settings.tsx index 2737df99c8f..50dd45b78de 100644 --- a/app/components/UI/Ramp/Views/Settings/Settings.tsx +++ b/app/components/UI/Ramp/Views/Settings/Settings.tsx @@ -28,6 +28,8 @@ import ActivationKeys from './ActivationKeys'; import styles from './Settings.styles'; // TODO: Convert into typescript and correctly type optionals +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const ListItem = BaseListItem as any; function Settings() { diff --git a/app/components/UI/Ramp/Views/Settings/__snapshots__/ActivationKeyForm.test.tsx.snap b/app/components/UI/Ramp/Views/Settings/__snapshots__/ActivationKeyForm.test.tsx.snap index 54c34626b44..6dfcce23038 100644 --- a/app/components/UI/Ramp/Views/Settings/__snapshots__/ActivationKeyForm.test.tsx.snap +++ b/app/components/UI/Ramp/Views/Settings/__snapshots__/ActivationKeyForm.test.tsx.snap @@ -54,7 +54,7 @@ exports[`AddActivationKey renders correctly 1`] = ` collapsable={false} style={ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderBottomColor": "rgb(216, 216, 216)", "elevation": 0, "flex": 1, @@ -137,7 +137,7 @@ exports[`AddActivationKey renders correctly 1`] = ` testID="back-arrow-button" > @@ -719,7 +719,7 @@ exports[`Settings Activation Keys renders correctly when is loading 1`] = ` selectable={true} style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -735,7 +735,7 @@ exports[`Settings Activation Keys renders correctly when is loading 1`] = ` selectable={true} style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -768,6 +768,7 @@ exports[`Settings Activation Keys renders correctly when is loading 1`] = ` accessibilityLabel="Edit Activation Key" accessibilityRole="button" accessible={true} + activeOpacity={1} disabled={true} hitSlop={ { @@ -778,9 +779,21 @@ exports[`Settings Activation Keys renders correctly when is loading 1`] = ` } } onPress={[Function]} + onPressIn={[Function]} + onPressOut={[Function]} + style={ + { + "alignItems": "center", + "borderRadius": 8, + "height": 32, + "justifyContent": "center", + "opacity": 1, + "width": 32, + } + } > @@ -905,7 +931,7 @@ exports[`Settings Activation Keys renders correctly when is loading 1`] = ` selectable={true} style={ { - "color": "#BBC0C5", + "color": "#9fa6ae", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -921,7 +947,7 @@ exports[`Settings Activation Keys renders correctly when is loading 1`] = ` selectable={true} style={ { - "color": "#BBC0C5", + "color": "#9fa6ae", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -954,6 +980,7 @@ exports[`Settings Activation Keys renders correctly when is loading 1`] = ` accessibilityLabel="Edit Activation Key" accessibilityRole="button" accessible={true} + activeOpacity={1} disabled={true} hitSlop={ { @@ -964,9 +991,21 @@ exports[`Settings Activation Keys renders correctly when is loading 1`] = ` } } onPress={[Function]} + onPressIn={[Function]} + onPressOut={[Function]} + style={ + { + "alignItems": "center", + "borderRadius": 8, + "height": 32, + "justifyContent": "center", + "opacity": 1, + "width": 32, + } + } > @@ -4254,7 +4306,7 @@ exports[`Settings renders correctly for internal builds 1`] = ` selectable={true} style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -4270,7 +4322,7 @@ exports[`Settings renders correctly for internal builds 1`] = ` selectable={true} style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -4303,6 +4355,7 @@ exports[`Settings renders correctly for internal builds 1`] = ` accessibilityLabel="Edit Activation Key" accessibilityRole="button" accessible={true} + activeOpacity={1} disabled={false} hitSlop={ { @@ -4313,9 +4366,21 @@ exports[`Settings renders correctly for internal builds 1`] = ` } } onPress={[Function]} + onPressIn={[Function]} + onPressOut={[Function]} + style={ + { + "alignItems": "center", + "borderRadius": 8, + "height": 32, + "justifyContent": "center", + "opacity": 1, + "width": 32, + } + } > @@ -4440,7 +4518,7 @@ exports[`Settings renders correctly for internal builds 1`] = ` selectable={true} style={ { - "color": "#BBC0C5", + "color": "#9fa6ae", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -4456,7 +4534,7 @@ exports[`Settings renders correctly for internal builds 1`] = ` selectable={true} style={ { - "color": "#BBC0C5", + "color": "#9fa6ae", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -4489,6 +4567,7 @@ exports[`Settings renders correctly for internal builds 1`] = ` accessibilityLabel="Edit Activation Key" accessibilityRole="button" accessible={true} + activeOpacity={1} disabled={false} hitSlop={ { @@ -4499,9 +4578,21 @@ exports[`Settings renders correctly for internal builds 1`] = ` } } onPress={[Function]} + onPressIn={[Function]} + onPressOut={[Function]} + style={ + { + "alignItems": "center", + "borderRadius": 8, + "height": 32, + "justifyContent": "center", + "opacity": 1, + "width": 32, + } + } > @@ -48,7 +48,9 @@ const Account = ({ }) => { const { colors } = useTheme(); const styles = createStyles(colors); - const selectedAddress = useSelector(selectSelectedAddress); + const selectedAddress = useSelector( + selectSelectedInternalAccountChecksummedAddress, + ); const identities = useSelector(selectIdentities); return ( { const navigation = useNavigation(); - const selectedAddress = useSelector(selectSelectedAddress); - - const identities = useSelector(selectIdentities); + const selectedInternalAccount = useSelector(selectSelectedInternalAccount); const openAccountSelector = () => navigation.navigate(...createAccountSelectorNavDetails()); return ( - - - {identities[selectedAddress]?.name.length > 13 - ? `${identities[selectedAddress]?.name.substr(0, 13)}...` - : identities[selectedAddress]?.name}{' '} - ( - ) - + {selectedInternalAccount ? ( + <> + + + {selectedInternalAccount.metadata.name.length > 13 + ? `${selectedInternalAccount.metadata.name.substr(0, 13)}...` + : selectedInternalAccount.metadata.name}{' '} + ( + + ) + + + ) : ( + Account is loading... + )} ); }; diff --git a/app/components/UI/Ramp/components/AmountInput.tsx b/app/components/UI/Ramp/components/AmountInput.tsx index e3a372295db..32fe02c03d6 100644 --- a/app/components/UI/Ramp/components/AmountInput.tsx +++ b/app/components/UI/Ramp/components/AmountInput.tsx @@ -6,6 +6,8 @@ import Text from '../../../Base/Text'; import CurrencyChevron from './CurrencyChevron'; // TODO: Convert into typescript and correctly type optionals +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const ListItem = BaseListItem as any; const styles = StyleSheet.create({ @@ -25,7 +27,11 @@ interface Props { currencyCode?: string; highlighted?: boolean; highlightedError?: boolean; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any onPress?: () => any; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any onCurrencyPress?: () => any; } diff --git a/app/components/UI/Ramp/components/ApplePayButton.tsx b/app/components/UI/Ramp/components/ApplePayButton.tsx index 5ddeaa3b00a..8c1a83862b6 100644 --- a/app/components/UI/Ramp/components/ApplePayButton.tsx +++ b/app/components/UI/Ramp/components/ApplePayButton.tsx @@ -51,6 +51,8 @@ const ApplePayButton = ({ label, onPress, }: { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any onPress: () => any; label: string; }) => { diff --git a/app/components/UI/Ramp/components/AssetSelectorButton.tsx b/app/components/UI/Ramp/components/AssetSelectorButton.tsx index e028609dbf6..c28f0d6f3eb 100644 --- a/app/components/UI/Ramp/components/AssetSelectorButton.tsx +++ b/app/components/UI/Ramp/components/AssetSelectorButton.tsx @@ -8,6 +8,8 @@ import Text from '../../../Base/Text'; import CurrencyChevron from './CurrencyChevron'; // TODO: Convert into typescript and correctly type optionals +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const ListItem = BaseListItem as any; const styles = StyleSheet.create({ @@ -26,6 +28,8 @@ interface Props { icon?: ReactNode; assetName: string; highlighted?: boolean; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any onPress?: () => any; } diff --git a/app/components/UI/Ramp/components/Box.tsx b/app/components/UI/Ramp/components/Box.tsx index fb5b4c99cd3..5a89fa25604 100644 --- a/app/components/UI/Ramp/components/Box.tsx +++ b/app/components/UI/Ramp/components/Box.tsx @@ -35,6 +35,8 @@ interface Props { style?: StyleProp; thin?: boolean; activeOpacity?: number; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any onPress?: () => any; accessible?: boolean; accessibilityLabel?: string; diff --git a/app/components/UI/Ramp/components/CustomActionButton.tsx b/app/components/UI/Ramp/components/CustomActionButton.tsx index 42a4a1736fa..01a10d739bd 100644 --- a/app/components/UI/Ramp/components/CustomActionButton.tsx +++ b/app/components/UI/Ramp/components/CustomActionButton.tsx @@ -9,6 +9,8 @@ import StyledButton from '../../StyledButton'; import RemoteImage from '../../../Base/RemoteImage'; import Text from '../../../Base/Text'; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const RemoteImageComponent = RemoteImage as any; interface Props { customActionButton: PaymentCustomActionButton; diff --git a/app/components/UI/Ramp/components/ErrorView.tsx b/app/components/UI/Ramp/components/ErrorView.tsx index ec72aa48db7..33ad8566a6d 100644 --- a/app/components/UI/Ramp/components/ErrorView.tsx +++ b/app/components/UI/Ramp/components/ErrorView.tsx @@ -54,6 +54,8 @@ interface Props { description: string; // The error description (Required) title?: string; // The error title, default will be "Error" if not provided (Optional) ctaLabel?: string; // The CTA button label, default will be "Try again" (Optional) + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any ctaOnPress?: () => any; // The optional callback to be invoked when pressing the CTA button (Optional) icon?: IconType; asScreen?: boolean; // Whether this component should be rendered as a screen or not (Optional) diff --git a/app/components/UI/Ramp/components/InfoAlert.tsx b/app/components/UI/Ramp/components/InfoAlert.tsx index fa3a7626f6b..d2f5025997d 100644 --- a/app/components/UI/Ramp/components/InfoAlert.tsx +++ b/app/components/UI/Ramp/components/InfoAlert.tsx @@ -53,6 +53,8 @@ interface Props { providerPrivacyPolicy?: string; providerTermsOfService?: string; providerSupport?: string; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any dismiss?: () => any; } diff --git a/app/components/UI/Ramp/components/LoadingAnimation/index.tsx b/app/components/UI/Ramp/components/LoadingAnimation/index.tsx index e717b4a0e80..a4f683d73e7 100644 --- a/app/components/UI/Ramp/components/LoadingAnimation/index.tsx +++ b/app/components/UI/Ramp/components/LoadingAnimation/index.tsx @@ -16,7 +16,11 @@ import { useTheme } from '../../../../../util/theme'; import { Colors } from '../../../../../util/theme/models'; // TODO: Convert into typescript and correctly type +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const Title = BaseTitle as any; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const Fox = FoxComponent as any; const ANIM_MULTIPLIER = 0.67; @@ -94,6 +98,8 @@ const customStyle = (colors: Colors) => ` interface Props { title: string; finish: boolean; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any onAnimationEnd?: () => any; asScreen?: boolean; } diff --git a/app/components/UI/Ramp/components/OrderDetails.tsx b/app/components/UI/Ramp/components/OrderDetails.tsx index 53dd7cec030..82916ce26b0 100644 --- a/app/components/UI/Ramp/components/OrderDetails.tsx +++ b/app/components/UI/Ramp/components/OrderDetails.tsx @@ -38,8 +38,12 @@ import { const failedIcon = require('./images/TransactionIcon_Failed.png'); // TODO: Convert into typescript and correctly type optionals +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const ListItem = BaseListItem as any; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const createStyles = (colors: any) => StyleSheet.create({ stage: { diff --git a/app/components/UI/Ramp/components/OrderListItem/OrderListItem.tsx b/app/components/UI/Ramp/components/OrderListItem/OrderListItem.tsx index 112bb604ed5..e31a6c3e9a0 100644 --- a/app/components/UI/Ramp/components/OrderListItem/OrderListItem.tsx +++ b/app/components/UI/Ramp/components/OrderListItem/OrderListItem.tsx @@ -15,6 +15,8 @@ import Text, { } from '../../../../../component-library/components/Texts/Text'; // TODO: Convert into typescript and correctly type optionals +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const ListItem = BaseListItem as any; /* eslint-disable import/no-commonjs, @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports */ diff --git a/app/components/UI/Ramp/components/OrderListItem/__snapshots__/OrderListItem.test.tsx.snap b/app/components/UI/Ramp/components/OrderListItem/__snapshots__/OrderListItem.test.tsx.snap index 04ed6021ded..69b1e7b5b69 100644 --- a/app/components/UI/Ramp/components/OrderListItem/__snapshots__/OrderListItem.test.tsx.snap +++ b/app/components/UI/Ramp/components/OrderListItem/__snapshots__/OrderListItem.test.tsx.snap @@ -15,7 +15,7 @@ exports[`OrderListItem should render correctly 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -46,7 +46,7 @@ exports[`OrderListItem should render correctly 1`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 12, "fontWeight": "400", @@ -113,7 +113,7 @@ exports[`OrderListItem should render correctly 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -144,7 +144,7 @@ exports[`OrderListItem should render correctly 1`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontSize": 15, }, undefined, @@ -161,7 +161,7 @@ exports[`OrderListItem should render correctly 1`] = ` accessibilityRole="text" style={ { - "color": "#1C8234", + "color": "#1c8234", "fontFamily": "Euclid Circular B", "fontSize": 12, "fontWeight": "700", @@ -188,7 +188,7 @@ exports[`OrderListItem should render correctly 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -219,7 +219,7 @@ exports[`OrderListItem should render correctly 1`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontSize": 15, }, undefined, @@ -235,7 +235,7 @@ exports[`OrderListItem should render correctly 1`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -266,7 +266,7 @@ exports[`OrderListItem should render correctly 1`] = ` undefined, [ { - "color": "#535A61", + "color": "#6a737d", "fontSize": 12, "textTransform": "uppercase", }, @@ -297,7 +297,7 @@ exports[`OrderListItem should render correctly 2`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -328,7 +328,7 @@ exports[`OrderListItem should render correctly 2`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 12, "fontWeight": "400", @@ -395,7 +395,7 @@ exports[`OrderListItem should render correctly 2`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -426,7 +426,7 @@ exports[`OrderListItem should render correctly 2`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontSize": 15, }, undefined, @@ -443,7 +443,7 @@ exports[`OrderListItem should render correctly 2`] = ` accessibilityRole="text" style={ { - "color": "#D73847", + "color": "#d73847", "fontFamily": "Euclid Circular B", "fontSize": 12, "fontWeight": "700", @@ -470,7 +470,7 @@ exports[`OrderListItem should render correctly 2`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -501,7 +501,7 @@ exports[`OrderListItem should render correctly 2`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontSize": 15, }, undefined, @@ -517,7 +517,7 @@ exports[`OrderListItem should render correctly 2`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -548,7 +548,7 @@ exports[`OrderListItem should render correctly 2`] = ` undefined, [ { - "color": "#535A61", + "color": "#6a737d", "fontSize": 12, "textTransform": "uppercase", }, @@ -579,7 +579,7 @@ exports[`OrderListItem should render correctly 3`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -610,7 +610,7 @@ exports[`OrderListItem should render correctly 3`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 12, "fontWeight": "400", @@ -677,7 +677,7 @@ exports[`OrderListItem should render correctly 3`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -708,7 +708,7 @@ exports[`OrderListItem should render correctly 3`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontSize": 15, }, undefined, @@ -725,7 +725,7 @@ exports[`OrderListItem should render correctly 3`] = ` accessibilityRole="text" style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "Euclid Circular B", "fontSize": 12, "fontWeight": "700", @@ -752,7 +752,7 @@ exports[`OrderListItem should render correctly 3`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -783,7 +783,7 @@ exports[`OrderListItem should render correctly 3`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontSize": 15, }, undefined, @@ -799,7 +799,7 @@ exports[`OrderListItem should render correctly 3`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -830,7 +830,7 @@ exports[`OrderListItem should render correctly 3`] = ` undefined, [ { - "color": "#535A61", + "color": "#6a737d", "fontSize": 12, "textTransform": "uppercase", }, @@ -861,7 +861,7 @@ exports[`OrderListItem should render correctly 4`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -892,7 +892,7 @@ exports[`OrderListItem should render correctly 4`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 12, "fontWeight": "400", @@ -959,7 +959,7 @@ exports[`OrderListItem should render correctly 4`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -990,7 +990,7 @@ exports[`OrderListItem should render correctly 4`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontSize": 15, }, undefined, @@ -1007,7 +1007,7 @@ exports[`OrderListItem should render correctly 4`] = ` accessibilityRole="text" style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "Euclid Circular B", "fontSize": 12, "fontWeight": "700", @@ -1034,7 +1034,7 @@ exports[`OrderListItem should render correctly 4`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1065,7 +1065,7 @@ exports[`OrderListItem should render correctly 4`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontSize": 15, }, undefined, @@ -1081,7 +1081,7 @@ exports[`OrderListItem should render correctly 4`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1112,7 +1112,7 @@ exports[`OrderListItem should render correctly 4`] = ` undefined, [ { - "color": "#535A61", + "color": "#6a737d", "fontSize": 12, "textTransform": "uppercase", }, @@ -1143,7 +1143,7 @@ exports[`OrderListItem should render correctly 5`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1174,7 +1174,7 @@ exports[`OrderListItem should render correctly 5`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 12, "fontWeight": "400", @@ -1241,7 +1241,7 @@ exports[`OrderListItem should render correctly 5`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1272,7 +1272,7 @@ exports[`OrderListItem should render correctly 5`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontSize": 15, }, undefined, @@ -1289,7 +1289,7 @@ exports[`OrderListItem should render correctly 5`] = ` accessibilityRole="text" style={ { - "color": "#D73847", + "color": "#d73847", "fontFamily": "Euclid Circular B", "fontSize": 12, "fontWeight": "700", @@ -1316,7 +1316,7 @@ exports[`OrderListItem should render correctly 5`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1347,7 +1347,7 @@ exports[`OrderListItem should render correctly 5`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontSize": 15, }, undefined, @@ -1363,7 +1363,7 @@ exports[`OrderListItem should render correctly 5`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1394,7 +1394,7 @@ exports[`OrderListItem should render correctly 5`] = ` undefined, [ { - "color": "#535A61", + "color": "#6a737d", "fontSize": 12, "textTransform": "uppercase", }, @@ -1425,7 +1425,7 @@ exports[`OrderListItem should render correctly 6`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1456,7 +1456,7 @@ exports[`OrderListItem should render correctly 6`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 12, "fontWeight": "400", @@ -1523,7 +1523,7 @@ exports[`OrderListItem should render correctly 6`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1554,7 +1554,7 @@ exports[`OrderListItem should render correctly 6`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontSize": 15, }, undefined, @@ -1571,7 +1571,7 @@ exports[`OrderListItem should render correctly 6`] = ` accessibilityRole="text" style={ { - "color": "#0376C9", + "color": "#0376c9", "fontFamily": "Euclid Circular B", "fontSize": 12, "fontWeight": "700", @@ -1598,7 +1598,7 @@ exports[`OrderListItem should render correctly 6`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1629,7 +1629,7 @@ exports[`OrderListItem should render correctly 6`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontSize": 15, }, undefined, @@ -1645,7 +1645,7 @@ exports[`OrderListItem should render correctly 6`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1676,7 +1676,7 @@ exports[`OrderListItem should render correctly 6`] = ` undefined, [ { - "color": "#535A61", + "color": "#6a737d", "fontSize": 12, "textTransform": "uppercase", }, @@ -1707,7 +1707,7 @@ exports[`OrderListItem should render correctly 7`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1738,7 +1738,7 @@ exports[`OrderListItem should render correctly 7`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 12, "fontWeight": "400", @@ -1805,7 +1805,7 @@ exports[`OrderListItem should render correctly 7`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1836,7 +1836,7 @@ exports[`OrderListItem should render correctly 7`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontSize": 15, }, undefined, @@ -1853,7 +1853,7 @@ exports[`OrderListItem should render correctly 7`] = ` accessibilityRole="text" style={ { - "color": "#0376C9", + "color": "#0376c9", "fontFamily": "Euclid Circular B", "fontSize": 12, "fontWeight": "700", @@ -1880,7 +1880,7 @@ exports[`OrderListItem should render correctly 7`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1911,7 +1911,7 @@ exports[`OrderListItem should render correctly 7`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontSize": 15, }, undefined, @@ -1927,7 +1927,7 @@ exports[`OrderListItem should render correctly 7`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -1958,7 +1958,7 @@ exports[`OrderListItem should render correctly 7`] = ` undefined, [ { - "color": "#535A61", + "color": "#6a737d", "fontSize": 12, "textTransform": "uppercase", }, @@ -2039,7 +2039,7 @@ exports[`OrderListItem should render correctly 8`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -2070,7 +2070,7 @@ exports[`OrderListItem should render correctly 8`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontSize": 15, }, undefined, @@ -2087,7 +2087,7 @@ exports[`OrderListItem should render correctly 8`] = ` accessibilityRole="text" style={ { - "color": "#0376C9", + "color": "#0376c9", "fontFamily": "Euclid Circular B", "fontSize": 12, "fontWeight": "700", @@ -2114,7 +2114,7 @@ exports[`OrderListItem should render correctly 8`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -2145,7 +2145,7 @@ exports[`OrderListItem should render correctly 8`] = ` undefined, [ { - "color": "#24272A", + "color": "#141618", "fontSize": 15, }, undefined, @@ -2161,7 +2161,7 @@ exports[`OrderListItem should render correctly 8`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 30, "fontWeight": "400", @@ -2192,7 +2192,7 @@ exports[`OrderListItem should render correctly 8`] = ` undefined, [ { - "color": "#535A61", + "color": "#6a737d", "fontSize": 12, "textTransform": "uppercase", }, diff --git a/app/components/UI/Ramp/components/PaymentMethod.tsx b/app/components/UI/Ramp/components/PaymentMethod.tsx index 10322dfebc1..a469303afdc 100644 --- a/app/components/UI/Ramp/components/PaymentMethod.tsx +++ b/app/components/UI/Ramp/components/PaymentMethod.tsx @@ -12,6 +12,8 @@ import PaymentMethodBadges from './PaymentMethodBadges'; import { Payment } from '@consensys/on-ramp-sdk'; import PaymentMethodIcon from './PaymentMethodIcon'; // TODO: Convert into typescript and correctly type optionals +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const ListItem = BaseListItem as any; interface Props { diff --git a/app/components/UI/Ramp/components/PaymentMethodSelector.tsx b/app/components/UI/Ramp/components/PaymentMethodSelector.tsx index db8221addf6..21172b7c54c 100644 --- a/app/components/UI/Ramp/components/PaymentMethodSelector.tsx +++ b/app/components/UI/Ramp/components/PaymentMethodSelector.tsx @@ -9,6 +9,8 @@ import Text from '../../../Base/Text'; import { Colors } from '../../../../util/theme/models'; // TODO: Convert into typescript and correctly type +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const ListItem = ListItemBase as any; const createStyles = (colors: Colors) => @@ -24,6 +26,8 @@ interface IProps { label?: string; icon?: ReactNode; highlighted?: boolean; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any onPress?: () => any; } diff --git a/app/components/UI/Ramp/components/QuickAmounts.tsx b/app/components/UI/Ramp/components/QuickAmounts.tsx index 29402a511bd..763f5885852 100644 --- a/app/components/UI/Ramp/components/QuickAmounts.tsx +++ b/app/components/UI/Ramp/components/QuickAmounts.tsx @@ -31,6 +31,8 @@ const createStyles = (colors: Colors) => interface AmountProps { amount: QuickAmount; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any onPress: (amount: QuickAmount) => any; isBuy: boolean; disabled?: boolean; @@ -74,6 +76,8 @@ interface Props { amounts: QuickAmount[]; isBuy: boolean; disabled?: boolean; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any onAmountPress: (amount: QuickAmount) => any; } diff --git a/app/components/UI/Ramp/components/Quote/Quote.tsx b/app/components/UI/Ramp/components/Quote/Quote.tsx index b909f0cb98f..d5f76cb61c8 100644 --- a/app/components/UI/Ramp/components/Quote/Quote.tsx +++ b/app/components/UI/Ramp/components/Quote/Quote.tsx @@ -37,6 +37,8 @@ import { useStyles } from '../../../../../component-library/hooks'; import { isBuyQuote } from '../../utils'; import { RampType } from '../../types'; // TODO: Convert into typescript and correctly type optionals +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const ListItem = BaseListItem as any; interface Props { diff --git a/app/components/UI/Ramp/components/RegionAlert.tsx b/app/components/UI/Ramp/components/RegionAlert.tsx index 44799b2e5d7..03d69c3fbf6 100644 --- a/app/components/UI/Ramp/components/RegionAlert.tsx +++ b/app/components/UI/Ramp/components/RegionAlert.tsx @@ -37,11 +37,13 @@ interface Props { footer?: string; dismissButtonText?: string; link?: string; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any dismiss?: () => any; } const SUPPORT_URL = - 'https://metamask.zendesk.com/hc/en-us/articles/4863623238683-My-country-region-isn-t-supported-for-MetaMask-on-ramps'; + 'https://support.metamask.io/metamask-portfolio/buy/my-country-region-isnt-supported-for-buying-crypto/'; const RegionAlert: React.FC = ({ isVisible, diff --git a/app/components/UI/Ramp/components/RegionModal.tsx b/app/components/UI/Ramp/components/RegionModal.tsx index 896d3362ed1..e759045ecc5 100644 --- a/app/components/UI/Ramp/components/RegionModal.tsx +++ b/app/components/UI/Ramp/components/RegionModal.tsx @@ -26,6 +26,8 @@ import useAnalytics from '../hooks/useAnalytics'; import createModalStyles from './modals/Modal.styles'; // TODO: Convert into typescript and correctly type +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const ListItem = BaseListItem as any; const MAX_REGION_RESULTS = 20; @@ -72,9 +74,13 @@ interface Props { isVisible?: boolean; title?: string; description?: string; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any dismiss?: () => any; data?: Region[] | null; selectedRegion?: Region | null; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any onRegionPress: (region: Region) => any; location?: ScreenLocation; rampType?: RampType; diff --git a/app/components/UI/Ramp/components/SkeletonPaymentMethod/SkeletonPaymentMethod.tsx b/app/components/UI/Ramp/components/SkeletonPaymentMethod/SkeletonPaymentMethod.tsx index d13770f4f7f..be3bdabaa0f 100644 --- a/app/components/UI/Ramp/components/SkeletonPaymentMethod/SkeletonPaymentMethod.tsx +++ b/app/components/UI/Ramp/components/SkeletonPaymentMethod/SkeletonPaymentMethod.tsx @@ -6,7 +6,11 @@ import Row from '../Row'; import SkeletonBox from '../SkeletonBox'; import SkeletonText from '../SkeletonText'; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const ListItem = BaseListItem as any; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const Text = BaseText as any; const SkeletonPaymentMethod = () => ( diff --git a/app/components/UI/Ramp/components/SkeletonQuote/SkeletonQuote.tsx b/app/components/UI/Ramp/components/SkeletonQuote/SkeletonQuote.tsx index 082b0285f46..78125eb5bee 100644 --- a/app/components/UI/Ramp/components/SkeletonQuote/SkeletonQuote.tsx +++ b/app/components/UI/Ramp/components/SkeletonQuote/SkeletonQuote.tsx @@ -5,6 +5,8 @@ import Box from '../Box'; import SkeletonText from '../SkeletonText'; // TODO: Convert into typescript and correctly type +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const ListItem = BaseListItem as any; const SkeletonQuote = ({ diff --git a/app/components/UI/Ramp/components/TokenSelectModal.tsx b/app/components/UI/Ramp/components/TokenSelectModal.tsx index 289aa20d9e2..76e3d75471a 100644 --- a/app/components/UI/Ramp/components/TokenSelectModal.tsx +++ b/app/components/UI/Ramp/components/TokenSelectModal.tsx @@ -24,6 +24,8 @@ import { Colors } from '../../../../util/theme/models'; import createModalStyles from './modals/Modal.styles'; // TODO: Convert into typescript and correctly type optionals +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const ListItem = BaseListItem as any; const createStyles = (colors: Colors) => diff --git a/app/components/UI/Ramp/components/modals/FiatSelectModal.tsx b/app/components/UI/Ramp/components/modals/FiatSelectModal.tsx index 955cfb6f5ca..1aaf8c585dd 100644 --- a/app/components/UI/Ramp/components/modals/FiatSelectModal.tsx +++ b/app/components/UI/Ramp/components/modals/FiatSelectModal.tsx @@ -23,6 +23,8 @@ import createModalStyles from './Modal.styles'; const MAX_TOKENS_RESULTS = 20; // TODO: Convert into typescript and correctly type +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const ListItem = BaseListItem as any; const Separator = () => { @@ -37,6 +39,8 @@ interface Props { title?: string; description?: string; currencies?: FiatCurrency[] | null; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any onItemPress: (currency: any) => void; excludeIds?: FiatCurrency['id'][]; } diff --git a/app/components/UI/Ramp/containers/ApplePayButton.tsx b/app/components/UI/Ramp/containers/ApplePayButton.tsx index ea9018f2821..e58fdb9df00 100644 --- a/app/components/UI/Ramp/containers/ApplePayButton.tsx +++ b/app/components/UI/Ramp/containers/ApplePayButton.tsx @@ -35,6 +35,8 @@ const ApplePayButton = ({ const dispatch = useDispatch(); const [pay] = useApplePay(quote); const handleSuccessfulOrder = useHandleSuccessfulOrder(); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const lockTime = useSelector((state: any) => state.settings.lockTime); const handlePress = useCallback(async () => { @@ -59,6 +61,8 @@ const ApplePayButton = ({ handleSuccessfulOrder(fiatOrder, { isApplePay: true }); } } + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (error: any) { NotificationManager.showSimpleNotification({ duration: 5000, diff --git a/app/components/UI/Ramp/hooks/useBalance.ts b/app/components/UI/Ramp/hooks/useBalance.ts index 66a341c9f08..f7d2dbca9c9 100644 --- a/app/components/UI/Ramp/hooks/useBalance.ts +++ b/app/components/UI/Ramp/hooks/useBalance.ts @@ -6,7 +6,7 @@ import { selectConversionRate, selectCurrentCurrency, } from '../../../../selectors/currencyRateController'; -import { selectSelectedAddress } from '../../../../selectors/preferencesController'; +import { selectSelectedInternalAccountChecksummedAddress } from '../../../../selectors/accountsController'; import { selectContractBalances } from '../../../../selectors/tokenBalancesController'; import { selectContractExchangeRates } from '../../../../selectors/tokenRatesController'; import { selectChainId } from '../../../../selectors/networkController'; @@ -28,7 +28,9 @@ export default function useBalance(asset?: Asset) { const assetAddress = safeToChecksumAddress(asset?.address); const accountsByChainId = useSelector(selectAccountsByChainId); const chainId = useSelector(selectChainId); - const selectedAddress = useSelector(selectSelectedAddress); + const selectedAddress = useSelector( + selectSelectedInternalAccountChecksummedAddress, + ); const conversionRate = useSelector(selectConversionRate); const currentCurrency = useSelector(selectCurrentCurrency); const tokenExchangeRates = useSelector(selectContractExchangeRates); diff --git a/app/components/UI/Ramp/hooks/useHandleSuccessfulOrder.ts b/app/components/UI/Ramp/hooks/useHandleSuccessfulOrder.ts index 5731889f55c..eceb453a5cb 100644 --- a/app/components/UI/Ramp/hooks/useHandleSuccessfulOrder.ts +++ b/app/components/UI/Ramp/hooks/useHandleSuccessfulOrder.ts @@ -43,6 +43,8 @@ function useHandleSuccessfulOrder() { const { TokensController } = Engine.context; if ( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any !TokensController.state.tokens.includes((t: any) => toLowerCaseEquals(t.address, address), ) @@ -64,6 +66,8 @@ function useHandleSuccessfulOrder() { isApplePay?: boolean; }, ) => { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any await addTokenToTokensController((order as any)?.data?.cryptoCurrency); handleDispatchUserWalletProtection(); // @ts-expect-error navigation prop mismatch @@ -116,6 +120,8 @@ function useHandleSuccessfulOrder() { accountsByChainId[toHexadecimal(chainIdFromProvider)][ selectedAddress ].balance, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any ) as any )?.isZero?.() : undefined, diff --git a/app/components/UI/Ramp/hooks/useInAppBrowser.ts b/app/components/UI/Ramp/hooks/useInAppBrowser.ts index 3024545e496..8650b6b57fb 100644 --- a/app/components/UI/Ramp/hooks/useInAppBrowser.ts +++ b/app/components/UI/Ramp/hooks/useInAppBrowser.ts @@ -30,6 +30,8 @@ export default function useInAppBrowser() { const dispatch = useDispatch(); const trackEvent = useAnalytics(); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const lockTime = useSelector((state: any) => state.settings.lockTime); const handleSuccessfulOrder = useHandleSuccessfulOrder(); diff --git a/app/components/UI/Ramp/hooks/useSDKMethod.ts b/app/components/UI/Ramp/hooks/useSDKMethod.ts index 6198e31b5c8..b480825f587 100644 --- a/app/components/UI/Ramp/hooks/useSDKMethod.ts +++ b/app/components/UI/Ramp/hooks/useSDKMethod.ts @@ -4,6 +4,8 @@ import { useRampSDK, SDK } from '../sdk'; import Logger from '../../../../util/Logger'; type NullifyOrPartial = { [P in keyof T]?: T[P] | null }; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any type PartialParameters = T extends (...args: infer P) => any ? NullifyOrPartial

: never; @@ -83,7 +85,9 @@ export default function useSDKMethod( }, ( ...customParams: PartialParameters | [] - ) => Promise | ReturnType, + ) => // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any + Promise | ReturnType, ] { const method = typeof config === 'string' ? config : config.method; const onMount = typeof config === 'string' ? true : config.onMount ?? true; diff --git a/app/components/UI/Ramp/index.tsx b/app/components/UI/Ramp/index.tsx index d3ee337d6b7..91a26fec925 100644 --- a/app/components/UI/Ramp/index.tsx +++ b/app/components/UI/Ramp/index.tsx @@ -220,8 +220,14 @@ function FiatOrders() { const dispatch = useDispatch(); const dispatchThunk = useThunkDispatch(); const navigation = useNavigation(); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const pendingOrders = useSelector(getPendingOrders); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const customOrderIds = useSelector(getCustomOrderIds); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const authenticationUrls = useSelector(getAuthenticationUrls); const dispatchAddFiatOrder = useCallback( diff --git a/app/components/UI/Ramp/orderProcessor/customOrderId.test.ts b/app/components/UI/Ramp/orderProcessor/customOrderId.test.ts index 71600ff6970..f7eef66a56b 100644 --- a/app/components/UI/Ramp/orderProcessor/customOrderId.test.ts +++ b/app/components/UI/Ramp/orderProcessor/customOrderId.test.ts @@ -85,6 +85,8 @@ describe('CustomOrderId processor', () => { status: OrderStatusEnum.Precreated, lastTimeFetched: 1000 + 1, }), + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any), ); @@ -121,6 +123,8 @@ describe('CustomOrderId processor', () => { getOrder: jest.fn().mockResolvedValue({ status: OrderStatusEnum.Precreated, }), + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any), ); @@ -137,6 +141,8 @@ describe('CustomOrderId processor', () => { getOrder: jest .fn() .mockResolvedValue({ status: OrderStatusEnum.Pending }), + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any), ); @@ -165,6 +171,8 @@ describe('CustomOrderId processor', () => { getOrder: jest .fn() .mockResolvedValue({ status: OrderStatusEnum.Precreated }), + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any), ); @@ -193,6 +201,8 @@ describe('CustomOrderId processor', () => { getOrder: jest.fn().mockImplementation(() => { throw new Error('Request error'); }), + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any), ); @@ -221,6 +231,8 @@ describe('CustomOrderId processor', () => { getOrder: jest.fn().mockResolvedValue({ status: OrderStatusEnum.Precreated, }), + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any), ); @@ -254,6 +266,8 @@ describe('CustomOrderId processor', () => { getSellOrder: jest.fn().mockResolvedValue({ status: OrderStatusEnum.Precreated, }), + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any), ); @@ -287,6 +301,8 @@ describe('CustomOrderId processor', () => { getOrder: jest.fn().mockResolvedValue({ status: OrderStatusEnum.Unknown, }), + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any), ); @@ -322,6 +338,8 @@ describe('CustomOrderId processor', () => { getSellOrder: jest.fn().mockResolvedValue({ status: OrderStatusEnum.Unknown, }), + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any), ); @@ -357,6 +375,8 @@ describe('CustomOrderId processor', () => { getOrder: jest.fn().mockResolvedValue({ status: OrderStatusEnum.IdExpired, }), + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any), ); @@ -390,6 +410,8 @@ describe('CustomOrderId processor', () => { getSellOrder: jest.fn().mockResolvedValue({ status: OrderStatusEnum.IdExpired, }), + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any), ); @@ -423,6 +445,8 @@ describe('CustomOrderId processor', () => { getOrder: jest.fn().mockResolvedValue({ status: OrderStatusEnum.Unknown, }), + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any), ); @@ -457,6 +481,8 @@ describe('CustomOrderId processor', () => { getSellOrder: jest.fn().mockResolvedValue({ status: OrderStatusEnum.Unknown, }), + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any), ); diff --git a/app/components/UI/Ramp/orderProcessor/customOrderId.ts b/app/components/UI/Ramp/orderProcessor/customOrderId.ts index f0a45540841..4eefba8be28 100644 --- a/app/components/UI/Ramp/orderProcessor/customOrderId.ts +++ b/app/components/UI/Ramp/orderProcessor/customOrderId.ts @@ -84,6 +84,8 @@ export default async function processCustomOrderIdData( { ...customOrderIdData, lastTimeFetched: Date.now(), errorCount: 0 }, null, ]; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (error: any) { return [customOrderIdData, null]; } diff --git a/app/components/UI/Ramp/sdk/index.tsx b/app/components/UI/Ramp/sdk/index.tsx index 3317d6c5cc0..7de245ee06a 100644 --- a/app/components/UI/Ramp/sdk/index.tsx +++ b/app/components/UI/Ramp/sdk/index.tsx @@ -300,6 +300,8 @@ export const useRampSDK = () => { return contextValue as RampSDK; }; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any export const withRampSDK = (Component: React.FC) => (props: any) => ( diff --git a/app/components/UI/Ramp/utils/index.test.ts b/app/components/UI/Ramp/utils/index.test.ts index 976035a4e68..7eeafdedb63 100644 --- a/app/components/UI/Ramp/utils/index.test.ts +++ b/app/components/UI/Ramp/utils/index.test.ts @@ -61,6 +61,8 @@ describe('formatAmount', () => { () => ({ format: jest.fn().mockImplementation(() => '123,123'), + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any), ); expect(formatAmount(123123)).toBe('123,123'); @@ -74,6 +76,8 @@ describe('formatAmount', () => { format: jest.fn().mockImplementation(() => { throw Error(); }), + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any), ); expect(formatAmount(123123)).toBe('123123'); @@ -520,6 +524,8 @@ describe('getOrderAmount', () => { cryptoAmount: 0.012361263, data: { ...mockOrder.data, + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any cryptoCurrency: undefined as any, }, }), diff --git a/app/components/UI/ReceiveRequest/index.js b/app/components/UI/ReceiveRequest/index.js index 94c0c01d916..c3494a32349 100644 --- a/app/components/UI/ReceiveRequest/index.js +++ b/app/components/UI/ReceiveRequest/index.js @@ -40,7 +40,7 @@ import { selectTicker, } from '../../../selectors/networkController'; import { isNetworkRampSupported } from '../Ramp/utils'; -import { selectSelectedAddress } from '../../../selectors/preferencesController'; +import { selectSelectedInternalAccountChecksummedAddress } from '../../../selectors/accountsController'; import { getRampNetworks } from '../../../reducers/fiatOrders'; import { RequestPaymentModalSelectorsIDs } from '../../../../e2e/selectors/Modals/RequestPaymentModal.selectors'; import { getDecimalChainId } from '../../../util/networks'; @@ -60,7 +60,7 @@ const createStyles = (theme) => qrWrapper: { margin: 8, padding: 8, - backgroundColor: theme.brandColors.white000, + backgroundColor: theme.brandColors.white, }, addressWrapper: { flexDirection: 'row', @@ -364,7 +364,7 @@ ReceiveRequest.contextType = ThemeContext; const mapStateToProps = (state) => ({ chainId: selectChainId(state), ticker: selectTicker(state), - selectedAddress: selectSelectedAddress(state), + selectedAddress: selectSelectedInternalAccountChecksummedAddress(state), receiveAsset: state.modals.receiveAsset, seedphraseBackedUp: state.user.seedphraseBackedUp, isNetworkBuySupported: isNetworkRampSupported( diff --git a/app/components/UI/ReceiveRequest/index.test.tsx b/app/components/UI/ReceiveRequest/index.test.tsx index 70c3c8872c3..1b95e369856 100644 --- a/app/components/UI/ReceiveRequest/index.test.tsx +++ b/app/components/UI/ReceiveRequest/index.test.tsx @@ -4,11 +4,15 @@ import ReceiveRequest from './'; import configureMockStore from 'redux-mock-store'; import { Provider } from 'react-redux'; import initialBackgroundState from '../../../util/test/initial-background-state.json'; +import { MOCK_ACCOUNTS_CONTROLLER_STATE } from '../../../util/test/accountsControllerTestUtils'; const mockStore = configureMockStore(); const initialState = { engine: { - backgroundState: initialBackgroundState, + backgroundState: { + ...initialBackgroundState, + AccountsController: MOCK_ACCOUNTS_CONTROLLER_STATE, + }, }, modals: { receiveAsset: {}, diff --git a/app/components/UI/ReviewModal/styles.ts b/app/components/UI/ReviewModal/styles.ts index 23e74fdfae0..77bca68ad7b 100644 --- a/app/components/UI/ReviewModal/styles.ts +++ b/app/components/UI/ReviewModal/styles.ts @@ -1,6 +1,8 @@ /* eslint-disable import/prefer-default-export */ import { StyleSheet } from 'react-native'; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any export const createStyles = (colors: any) => StyleSheet.create({ screen: { justifyContent: 'center', paddingHorizontal: 24 }, diff --git a/app/components/UI/SearchTokenAutocomplete/__snapshots__/index.test.tsx.snap b/app/components/UI/SearchTokenAutocomplete/__snapshots__/index.test.tsx.snap index 75ac831f1c2..652b09a00df 100644 --- a/app/components/UI/SearchTokenAutocomplete/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/SearchTokenAutocomplete/__snapshots__/index.test.tsx.snap @@ -329,10 +329,10 @@ exports[`SearchTokenAutocomplete should render correctly 1`] = ` [ { "alignItems": "center", - "borderColor": "#BBC0C5", + "borderColor": "#bbc0c5", "borderRadius": 8, "borderWidth": 1, - "color": "#24272A", + "color": "#141618", "flex": 1, "flexDirection": "row", "justifyContent": "center", @@ -346,13 +346,13 @@ exports[`SearchTokenAutocomplete should render correctly 1`] = ` StyleSheet.create({ wrapper: { @@ -66,6 +68,8 @@ interface Props { /** /* navigation object required to push new views */ + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any navigation: any; } @@ -76,6 +80,8 @@ const SearchTokenAutocomplete = ({ navigation }: Props) => { const { trackEvent } = useMetrics(); const [searchResults, setSearchResults] = useState([]); const [searchQuery, setSearchQuery] = useState(''); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const [selectedAsset, setSelectedAsset] = useState([]); const [isSearchFocused, setIsSearchFocused] = useState(false); @@ -108,6 +114,8 @@ const SearchTokenAutocomplete = ({ navigation }: Props) => { }, [selectedAsset, chainId]); const handleSearch = useCallback( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (opts: any) => { setSearchResults(opts.results); setSearchQuery(opts.searchQuery); @@ -142,6 +150,8 @@ const SearchTokenAutocomplete = ({ navigation }: Props) => { const addToken = useCallback( async ({ address, symbol, decimals, iconUrl, name }) => { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const { TokensController } = Engine.context as any; await TokensController.addToken({ address, diff --git a/app/components/UI/SecurityOptionToggle/SecurityOptionToggle.tsx b/app/components/UI/SecurityOptionToggle/SecurityOptionToggle.tsx index b86ecb8b581..245a8b98d5d 100644 --- a/app/components/UI/SecurityOptionToggle/SecurityOptionToggle.tsx +++ b/app/components/UI/SecurityOptionToggle/SecurityOptionToggle.tsx @@ -53,7 +53,7 @@ const SecurityOptionToggle = ({ true: colors.primary.default, false: colors.border.muted, }} - thumbColor={theme.brandColors.white000} + thumbColor={theme.brandColors.white} style={styles.switch} ios_backgroundColor={colors.border.muted} disabled={disabled} diff --git a/app/components/UI/SeedphraseModal/__snapshots__/index.test.tsx.snap b/app/components/UI/SeedphraseModal/__snapshots__/index.test.tsx.snap index dc31304315d..f8054f51968 100644 --- a/app/components/UI/SeedphraseModal/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/SeedphraseModal/__snapshots__/index.test.tsx.snap @@ -169,7 +169,7 @@ exports[`SeedphraseModal should render correctly 1`] = ` style={ [ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderRadius": 10, "width": "100%", }, @@ -217,7 +217,7 @@ exports[`SeedphraseModal should render correctly 1`] = ` { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const network: any = Object.values(NetworkList).find( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (nw: any) => nw.chainId === chainId, ); return network?.imageSource || null; diff --git a/app/components/UI/SimulationDetails/FiatDisplay/FiatDisplay.test.tsx b/app/components/UI/SimulationDetails/FiatDisplay/FiatDisplay.test.tsx index b4981211377..c5c3a1f4a78 100644 --- a/app/components/UI/SimulationDetails/FiatDisplay/FiatDisplay.test.tsx +++ b/app/components/UI/SimulationDetails/FiatDisplay/FiatDisplay.test.tsx @@ -1,14 +1,13 @@ import React from 'react'; -import useFiatFormatter from './useFiatFormatter'; - +import { merge } from 'lodash'; import renderWithProvider from '../../../../util/test/renderWithProvider'; import initialBackgroundState from '../../../../util/test/initial-background-state.json'; - -import { IndividualFiatDisplay, TotalFiatDisplay } from './FiatDisplay'; import { FIAT_UNAVAILABLE } from '../types'; +import { IndividualFiatDisplay, TotalFiatDisplay } from './FiatDisplay'; +import useFiatFormatter from './useFiatFormatter'; +import { NETWORKS_CHAIN_ID } from '../../../../constants/network'; jest.mock('./useFiatFormatter'); -(useFiatFormatter as jest.Mock).mockReturnValue((value: number) => `$${value}`); const mockInitialState = { engine: { @@ -16,31 +15,88 @@ const mockInitialState = { }, }; -describe('IndividualFiatDisplay', () => { - it.each([ - [FIAT_UNAVAILABLE, 'Not Available'], - [100, '$100'], - [-100, '$100'], - ])('when fiatAmount is %s it renders %s', (fiatAmount, expected) => { - const { getByText } = renderWithProvider( - , - { state: mockInitialState }, - ); - expect(getByText(expected)).toBeDefined(); - }); +const mockStateWithTestnet = merge({}, mockInitialState, { + engine: { + backgroundState: { + NetworkController: { + providerConfig: { + chainId: NETWORKS_CHAIN_ID.SEPOLIA, + }, + }, + }, + }, +}); + +const mockStateWithShowingFiatOnTestnets = merge({}, mockStateWithTestnet, { + engine: { + backgroundState: { + PreferencesController: { + showFiatInTestnets: true, + }, + }, + }, +}); + +const mockStateWithHidingFiatOnTestnets = merge({}, mockStateWithTestnet, { + engine: { + backgroundState: { + PreferencesController: { + showFiatInTestnets: false, + }, + }, + }, }); -describe('TotalFiatDisplay', () => { - it.each([ - [[FIAT_UNAVAILABLE, FIAT_UNAVAILABLE], 'Not Available'], - [[], 'Not Available'], - [[100, 200, FIAT_UNAVAILABLE, 300], 'Total = $600'], - [[-100, -200, FIAT_UNAVAILABLE, -300], 'Total = $600'], - ])('when fiatAmounts is %s it renders %s', (fiatAmounts, expected) => { - const { getByText } = renderWithProvider( - , - { state: mockInitialState }, - ); - expect(getByText(expected)).toBeDefined(); +describe('FiatDisplay', () => { + const mockUseFiatFormatter = jest.mocked(useFiatFormatter); + + beforeEach(() => { + jest.resetAllMocks(); + mockUseFiatFormatter.mockReturnValue((value: number) => `$${value}`); + }); + + describe('IndividualFiatDisplay', () => { + it.each([ + [FIAT_UNAVAILABLE, 'Not Available'], + [100, '$100'], + [-100, '$100'], + ])('when fiatAmount is %s it renders %s', (fiatAmount, expected) => { + const { queryByText } = renderWithProvider( + , + { state: mockStateWithShowingFiatOnTestnets }, + ); + expect(queryByText(expected)).toBeDefined(); + }); + + it('does not render anything if hideFiatForTestnet is true', () => { + const { queryByText } = renderWithProvider( + , + { state: mockStateWithHidingFiatOnTestnets }, + ); + expect(queryByText('100')).toBe(null); + }); + }); + + describe('TotalFiatDisplay', () => { + it.each([ + [[FIAT_UNAVAILABLE, FIAT_UNAVAILABLE], 'Not Available'], + [[], 'Not Available'], + [[100, 200, FIAT_UNAVAILABLE, 300], 'Total = $600'], + [[-100, -200, FIAT_UNAVAILABLE, -300], 'Total = $600'], + ])('when fiatAmounts is %s it renders %s', (fiatAmounts, expected) => { + const { queryByText } = renderWithProvider( + , + { state: mockStateWithShowingFiatOnTestnets }, + ); + expect(queryByText(expected)).toBeDefined(); + }); + + it('does not render anything if hideFiatForTestnet is true', () => { + const { queryByText } = renderWithProvider( + , + { state: mockStateWithHidingFiatOnTestnets }, + ); + expect(queryByText('600')).toBe(null); + }); }); }); diff --git a/app/components/UI/SimulationDetails/FiatDisplay/FiatDisplay.tsx b/app/components/UI/SimulationDetails/FiatDisplay/FiatDisplay.tsx index b7619a1d1e3..58d65d86171 100644 --- a/app/components/UI/SimulationDetails/FiatDisplay/FiatDisplay.tsx +++ b/app/components/UI/SimulationDetails/FiatDisplay/FiatDisplay.tsx @@ -9,6 +9,7 @@ import Text, { import { strings } from '../../../../../locales/i18n'; import useFiatFormatter from './useFiatFormatter'; import { FIAT_UNAVAILABLE, FiatAmount } from '../types'; +import useHideFiatForTestnet from '../../../hooks/useHideFiatForTestnet'; const styleSheet = () => StyleSheet.create({ @@ -48,9 +49,14 @@ export function calculateTotalFiat(fiatAmounts: FiatAmount[]): number { export const IndividualFiatDisplay: React.FC<{ fiatAmount: FiatAmount }> = ({ fiatAmount, }) => { + const hideFiatForTestnet = useHideFiatForTestnet(); const { styles } = useStyles(styleSheet, {}); const fiatFormatter = useFiatFormatter(); + if (hideFiatForTestnet) { + return null; + } + if (fiatAmount === FIAT_UNAVAILABLE) { return ; } @@ -72,10 +78,15 @@ export const IndividualFiatDisplay: React.FC<{ fiatAmount: FiatAmount }> = ({ export const TotalFiatDisplay: React.FC<{ fiatAmounts: FiatAmount[]; }> = ({ fiatAmounts }) => { + const hideFiatForTestnet = useHideFiatForTestnet(); const { styles } = useStyles(styleSheet, {}); const fiatFormatter = useFiatFormatter(); const totalFiat = calculateTotalFiat(fiatAmounts); + if (hideFiatForTestnet) { + return null; + } + return totalFiat === 0 ? ( ) : ( diff --git a/app/components/UI/SimulationDetails/SimulationDetails.stories.tsx b/app/components/UI/SimulationDetails/SimulationDetails.stories.tsx index e2f031a1674..ba4c600fc44 100644 --- a/app/components/UI/SimulationDetails/SimulationDetails.stories.tsx +++ b/app/components/UI/SimulationDetails/SimulationDetails.stories.tsx @@ -27,11 +27,12 @@ const DUMMY_BALANCE_CHANGE = { const CHAIN_ID_MOCK = '0x1'; const ERC20_TOKEN_1_MOCK = '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599'; // WBTC const ERC20_TOKEN_2_MOCK = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'; // USDC +const ERC20_TOKEN_3_MOCK = '0xabcd6991c6218b36c1d19d4a2e9eb0ce36056789'; // UNKOWN const ERC721_TOKEN_MOCK = '0x06012c8cf97bead5deae237070f9587f8e7a266d'; // CryptoKitties const ERC1155_TOKEN_MOCK = '0x60e4d786628fea6478f785a6d7e704777c86a7c6'; // MAYC const preloadedEngineState = { - settings: { useBlockieIcon: false }, + settings: { useBlockieIcon: false, showFiatInTestnets: true }, engine: { backgroundState: { PreferencesController: { @@ -156,7 +157,7 @@ export const MultipleTokens: Story = { { ...DUMMY_BALANCE_CHANGE, address: ERC20_TOKEN_1_MOCK, - difference: '0x123456', + difference: '0x1323232333232320', isDecrease: false, standard: SimulationTokenStandard.erc20, }, @@ -183,6 +184,13 @@ export const MultipleTokens: Story = { id: '0x1155', standard: SimulationTokenStandard.erc1155, }, + { + ...DUMMY_BALANCE_CHANGE, + address: ERC20_TOKEN_3_MOCK, + difference: '0x123456901', + isDecrease: false, + standard: SimulationTokenStandard.erc20, + }, ], }, }, diff --git a/app/components/UI/SimulationDetails/useBalanceChanges.test.ts b/app/components/UI/SimulationDetails/useBalanceChanges.test.ts index 9bd1109cef9..720c09c5397 100644 --- a/app/components/UI/SimulationDetails/useBalanceChanges.test.ts +++ b/app/components/UI/SimulationDetails/useBalanceChanges.test.ts @@ -35,6 +35,8 @@ jest.mock('@metamask/assets-controllers', () => ({ fetchTokenContractExchangeRates: jest.fn(), })); +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const mockSelectConversionRate = selectConversionRate as any; const mockGetTokenDetails = getTokenDetails as jest.Mock; const mockFetchTokenContractExchangeRates = diff --git a/app/components/UI/SimulationDetails/useBalanceChanges.ts b/app/components/UI/SimulationDetails/useBalanceChanges.ts index 0052773bb6b..9dfbbb91943 100644 --- a/app/components/UI/SimulationDetails/useBalanceChanges.ts +++ b/app/components/UI/SimulationDetails/useBalanceChanges.ts @@ -184,7 +184,11 @@ export default function useBalanceChanges( simulationData ?? {}; const erc20TokenAddresses = tokenBalanceChanges + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any .filter((tbc: any) => tbc.standard === SimulationTokenStandard.erc20) + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any .map((tbc: any) => tbc.address); const erc20Decimals = useAsyncResultOrThrow( diff --git a/app/components/UI/SkipAccountSecurityModal/__snapshots__/index.test.tsx.snap b/app/components/UI/SkipAccountSecurityModal/__snapshots__/index.test.tsx.snap index fbce16f317e..72963d409d4 100644 --- a/app/components/UI/SkipAccountSecurityModal/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/SkipAccountSecurityModal/__snapshots__/index.test.tsx.snap @@ -52,7 +52,7 @@ exports[`HintModal should render correctly 1`] = ` size={12} style={ { - "color": "#24272A", + "color": "#141618", "fontSize": 16, } } @@ -65,7 +65,7 @@ exports[`HintModal should render correctly 1`] = ` style={ { "alignSelf": "center", - "color": "#D73847", + "color": "#d73847", } } testID="skip-backup-warning" @@ -73,7 +73,7 @@ exports[`HintModal should render correctly 1`] = ` StyleSheet.create({ @@ -85,8 +79,8 @@ const SkipAccountSecurityModal = ({ return ( {strings('account_backup_step_1.skip_check')} diff --git a/app/components/UI/SliderButton/__snapshots__/index.test.tsx.snap b/app/components/UI/SliderButton/__snapshots__/index.test.tsx.snap index 7db97506d5b..113c8979836 100644 --- a/app/components/UI/SliderButton/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/SliderButton/__snapshots__/index.test.tsx.snap @@ -7,7 +7,7 @@ exports[`SliderButton should render correctly 1`] = ` [ { "elevation": 0, - "shadowColor": "#0376C933", + "shadowColor": "#0376c933", "shadowOffset": { "height": 2, "width": 0, @@ -24,7 +24,7 @@ exports[`SliderButton should render correctly 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "#0260A4", + "backgroundColor": "#0260a4", "borderRadius": 60, "height": 60, "justifyContent": "center", @@ -91,7 +91,7 @@ exports[`SliderButton should render correctly 1`] = ` StyleSheet.create({ container: { ...shadows.size.sm, - shadowColor: colors.primary.shadow, + shadowColor: colors.shadow.primary, elevation: 0, // shadow colors not supported on Android. nothing > gray shadow }, disabledContainer: { diff --git a/app/components/UI/SlippageSlider/__snapshots__/index.test.tsx.snap b/app/components/UI/SlippageSlider/__snapshots__/index.test.tsx.snap index 2ee43a72c02..60d33af2f76 100644 --- a/app/components/UI/SlippageSlider/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/SlippageSlider/__snapshots__/index.test.tsx.snap @@ -33,8 +33,8 @@ exports[`SlippageSlider should render correctly 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "#0376C919", - "borderColor": "#0376C919", + "backgroundColor": "#0376c91a", + "borderColor": "#0376c91a", "borderRadius": 9, "borderWidth": 2, "flexDirection": "row", @@ -47,7 +47,7 @@ exports[`SlippageSlider should render correctly 1`] = ` key="0" style={ { - "backgroundColor": "#0376C9", + "backgroundColor": "#0376c9", "borderRadius": 5, "height": 5, "opacity": 0.5, @@ -59,7 +59,7 @@ exports[`SlippageSlider should render correctly 1`] = ` key="1" style={ { - "backgroundColor": "#0376C9", + "backgroundColor": "#0376c9", "borderRadius": 5, "height": 5, "opacity": 0.5, @@ -71,7 +71,7 @@ exports[`SlippageSlider should render correctly 1`] = ` key="2" style={ { - "backgroundColor": "#0376C9", + "backgroundColor": "#0376c9", "borderRadius": 5, "height": 5, "opacity": 0.5, @@ -83,7 +83,7 @@ exports[`SlippageSlider should render correctly 1`] = ` key="3" style={ { - "backgroundColor": "#0376C9", + "backgroundColor": "#0376c9", "borderRadius": 5, "height": 5, "opacity": 0.5, @@ -95,7 +95,7 @@ exports[`SlippageSlider should render correctly 1`] = ` key="4" style={ { - "backgroundColor": "#0376C9", + "backgroundColor": "#0376c9", "borderRadius": 5, "height": 5, "opacity": 0.5, @@ -163,14 +163,14 @@ exports[`SlippageSlider should render correctly 1`] = ` > ({ chainId: selectChainId(state), ticker: selectTicker(state), balances: selectContractBalances(state), - selectedAddress: selectSelectedAddress(state), + selectedAddress: selectSelectedInternalAccountChecksummedAddress(state), conversionRate: selectConversionRate(state), currentCurrency: selectCurrentCurrency(state), isInPolling: state.engine.backgroundState.SwapsController.isInPolling, diff --git a/app/components/UI/Swaps/SwapsLiveness.ts b/app/components/UI/Swaps/SwapsLiveness.ts index c95922d1f94..60aa6c6211c 100644 --- a/app/components/UI/Swaps/SwapsLiveness.ts +++ b/app/components/UI/Swaps/SwapsLiveness.ts @@ -34,6 +34,8 @@ function SwapLiveness() { setLiveness(chainId, featureFlags); } catch (error) { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any Logger.error(error as any, 'Swaps: error while fetching swaps liveness'); setLiveness(chainId, null); } diff --git a/app/components/UI/Swaps/components/TokenIcon.js b/app/components/UI/Swaps/components/TokenIcon.js index da256dde30c..2e201eaa107 100644 --- a/app/components/UI/Swaps/components/TokenIcon.js +++ b/app/components/UI/Swaps/components/TokenIcon.js @@ -87,9 +87,10 @@ EmptyIcon.propTypes = { big: PropTypes.bool, biggest: PropTypes.bool, style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), + testID: PropTypes.string, }; -function TokenIcon({ symbol, icon, medium, big, biggest, style }) { +function TokenIcon({ symbol, icon, medium, big, biggest, style, testID }) { const [showFallback, setShowFallback] = useState(false); const { colors } = useTheme(); const styles = createStyles(colors); @@ -114,6 +115,7 @@ function TokenIcon({ symbol, icon, medium, big, biggest, style }) { if (source && !showFallback) { return ( setShowFallback(true)} @@ -130,7 +132,13 @@ function TokenIcon({ symbol, icon, medium, big, biggest, style }) { if (symbol) { return ( - + ({ accounts: selectAccounts(state), conversionRate: selectConversionRate(state), currentCurrency: selectCurrentCurrency(state), - selectedAddress: selectSelectedAddress(state), + selectedAddress: selectSelectedInternalAccountChecksummedAddress(state), tokenExchangeRates: selectContractExchangeRates(state), balances: selectContractBalances(state), chainId: selectChainId(state), diff --git a/app/components/UI/Swaps/components/__snapshots__/TokenIcon.test.js.snap b/app/components/UI/Swaps/components/__snapshots__/TokenIcon.test.js.snap index ce5826565a6..7d76d1bfc00 100644 --- a/app/components/UI/Swaps/components/__snapshots__/TokenIcon.test.js.snap +++ b/app/components/UI/Swaps/components/__snapshots__/TokenIcon.test.js.snap @@ -35,7 +35,7 @@ exports[`TokenIcon component should Render correctly 3`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontSize": 16, "textAlign": "center", "textAlignVertical": "center", @@ -121,13 +121,13 @@ exports[`TokenIcon component should Render correctly 7`] = ` style={ [ { - "color": "#24272A", + "color": "#141618", "fontSize": 16, "textAlign": "center", "textAlignVertical": "center", }, { - "color": "#24272A", + "color": "#141618", "fontSize": 22, }, undefined, diff --git a/app/components/UI/Swaps/index.js b/app/components/UI/Swaps/index.js index 665bfdcfe09..e7a2ef448fa 100644 --- a/app/components/UI/Swaps/index.js +++ b/app/components/UI/Swaps/index.js @@ -80,7 +80,7 @@ import { import { selectContractExchangeRates } from '../../../selectors/tokenRatesController'; import { selectAccounts } from '../../../selectors/accountTrackerController'; import { selectContractBalances } from '../../../selectors/tokenBalancesController'; -import { selectSelectedAddress } from '../../../selectors/preferencesController'; +import { selectSelectedInternalAccountChecksummedAddress } from '../../../selectors/accountsController'; import AccountSelector from '../Ramp/components/AccountSelector'; import { SWAP_SOURCE_TOKEN, @@ -1009,7 +1009,7 @@ const mapStateToProps = (state) => ({ swapsControllerTokens: swapsControllerTokens(state), accounts: selectAccounts(state), balances: selectContractBalances(state), - selectedAddress: selectSelectedAddress(state), + selectedAddress: selectSelectedInternalAccountChecksummedAddress(state), conversionRate: selectConversionRate(state), currentCurrency: selectCurrentCurrency(state), tokenExchangeRates: selectContractExchangeRates(state), diff --git a/app/components/UI/SwitchCustomNetwork/__snapshots__/index.test.tsx.snap b/app/components/UI/SwitchCustomNetwork/__snapshots__/index.test.tsx.snap index 013d39ed8c6..35bd474aa89 100644 --- a/app/components/UI/SwitchCustomNetwork/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/SwitchCustomNetwork/__snapshots__/index.test.tsx.snap @@ -4,7 +4,7 @@ exports[`SwitchCustomNetwork should render correctly 1`] = ` { const component = section?.element; if (!component && !isValidElementName(component)) { diff --git a/app/components/UI/Tokens/__snapshots__/index.test.tsx.snap b/app/components/UI/Tokens/__snapshots__/index.test.tsx.snap index d68d832dd85..4aaccc2fc58 100644 --- a/app/components/UI/Tokens/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/Tokens/__snapshots__/index.test.tsx.snap @@ -307,7 +307,7 @@ exports[`Tokens should hide zero balance tokens when setting is on 1`] = ` } removeClippedSubviews={false} @@ -425,7 +425,7 @@ exports[`Tokens should hide zero balance tokens when setting is on 1`] = ` accessibilityRole="text" style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 32, "fontWeight": "500", @@ -449,7 +449,7 @@ exports[`Tokens should hide zero balance tokens when setting is on 1`] = ` "alignItems": "center", "alignSelf": "stretch", "backgroundColor": "transparent", - "borderColor": "#0376C9", + "borderColor": "#0376c9", "borderRadius": 20, "borderWidth": 1, "flexDirection": "row", @@ -466,7 +466,7 @@ exports[`Tokens should hide zero balance tokens when setting is on 1`] = ` accessibilityRole="text" style={ { - "color": "#0376C9", + "color": "#0376c9", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -478,7 +478,7 @@ exports[`Tokens should hide zero balance tokens when setting is on 1`] = ` Portfolio } removeClippedSubviews={false} @@ -1599,7 +1599,7 @@ exports[`Tokens should render correctly 1`] = ` accessibilityRole="text" style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 32, "fontWeight": "500", @@ -1623,7 +1623,7 @@ exports[`Tokens should render correctly 1`] = ` "alignItems": "center", "alignSelf": "stretch", "backgroundColor": "transparent", - "borderColor": "#0376C9", + "borderColor": "#0376c9", "borderRadius": 20, "borderWidth": 1, "flexDirection": "row", @@ -1640,7 +1640,7 @@ exports[`Tokens should render correctly 1`] = ` accessibilityRole="text" style={ { - "color": "#0376C9", + "color": "#0376c9", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -1652,7 +1652,7 @@ exports[`Tokens should render correctly 1`] = ` Portfolio } removeClippedSubviews={false} @@ -2781,7 +2781,7 @@ exports[`Tokens should show all balance tokens when hideZeroBalanceTokens settin accessibilityRole="text" style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "EuclidCircularB-Regular", "fontSize": 32, "fontWeight": "500", @@ -2805,7 +2805,7 @@ exports[`Tokens should show all balance tokens when hideZeroBalanceTokens settin "alignItems": "center", "alignSelf": "stretch", "backgroundColor": "transparent", - "borderColor": "#0376C9", + "borderColor": "#0376c9", "borderRadius": 20, "borderWidth": 1, "flexDirection": "row", @@ -2822,7 +2822,7 @@ exports[`Tokens should show all balance tokens when hideZeroBalanceTokens settin accessibilityRole="text" style={ { - "color": "#0376C9", + "color": "#0376c9", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -2834,7 +2834,7 @@ exports[`Tokens should show all balance tokens when hideZeroBalanceTokens settin Portfolio { }); const Stack = createStackNavigator(); +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const renderComponent = (state: any = {}) => renderWithProvider( diff --git a/app/components/UI/Tokens/index.tsx b/app/components/UI/Tokens/index.tsx index 69b830cfc35..ecdcf614ee3 100644 --- a/app/components/UI/Tokens/index.tsx +++ b/app/components/UI/Tokens/index.tsx @@ -109,6 +109,8 @@ const Tokens: React.FC = ({ tokens }) => { const { colors } = useTheme(); const { trackEvent } = useMetrics(); const styles = createStyles(colors); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const navigation = useNavigation>(); const [tokenToRemove, setTokenToRemove] = useState(); const [isAddTokenEnabled, setIsAddTokenEnabled] = useState(true); @@ -127,15 +129,21 @@ const Tokens: React.FC = ({ tokens }) => { const currentCurrency = useSelector(selectCurrentCurrency); const conversionRate = useSelector(selectConversionRate); const primaryCurrency = useSelector( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (state: any) => state.settings.primaryCurrency, ); const { data: tokenBalances } = useTokenBalancesController(); const tokenExchangeRates = useSelector(selectContractExchangeRates); const hideZeroBalanceTokens = useSelector( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (state: any) => state.settings.hideZeroBalanceTokens, ); const detectedTokens = useSelector(selectDetectedTokens); const isTokenDetectionEnabled = useSelector(selectUseTokenDetection); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const browserTabs = useSelector((state: any) => state.browser.tabs); const isOriginalNativeTokenSymbol = useIsOriginalNativeTokenSymbol( @@ -667,6 +675,8 @@ const Tokens: React.FC = ({ tokens }) => { }; const removeToken = async () => { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const { TokensController }: any = Engine.context; const tokenAddress = tokenToRemove?.address; const symbol = tokenToRemove?.symbol; diff --git a/app/components/UI/TransactionElement/TransactionDetails/index.js b/app/components/UI/TransactionElement/TransactionDetails/index.js index ded80f167bd..5a5eca528d1 100644 --- a/app/components/UI/TransactionElement/TransactionDetails/index.js +++ b/app/components/UI/TransactionElement/TransactionDetails/index.js @@ -38,7 +38,7 @@ import { } from '../../../../selectors/currencyRateController'; import { selectTokensByAddress } from '../../../../selectors/tokensController'; import { selectContractExchangeRates } from '../../../../selectors/tokenRatesController'; -import { selectSelectedAddress } from '../../../../selectors/preferencesController'; +import { selectSelectedInternalAccountChecksummedAddress } from '../../../../selectors/accountsController'; import { regex } from '../../../../../app/util/regex'; import { selectShouldUseSmartTransaction } from '../../../../selectors/smartTransactionsController'; @@ -423,7 +423,7 @@ const mapStateToProps = (state) => ({ providerConfig: selectProviderConfig(state), chainId: selectChainId(state), networkConfigurations: selectNetworkConfigurations(state), - selectedAddress: selectSelectedAddress(state), + selectedAddress: selectSelectedInternalAccountChecksummedAddress(state), transactions: state.engine.backgroundState.TransactionController.transactions, ticker: selectTicker(state), tokens: selectTokensByAddress(state), diff --git a/app/components/UI/TransactionElement/TransactionDetails/index.test.tsx b/app/components/UI/TransactionElement/TransactionDetails/index.test.tsx index c7e8ff3d639..0d5ea358db1 100644 --- a/app/components/UI/TransactionElement/TransactionDetails/index.test.tsx +++ b/app/components/UI/TransactionElement/TransactionDetails/index.test.tsx @@ -4,11 +4,15 @@ import configureMockStore from 'redux-mock-store'; import { shallow } from 'enzyme'; import { Provider } from 'react-redux'; import initialBackgroundState from '../../../../util/test/initial-background-state.json'; +import { MOCK_ACCOUNTS_CONTROLLER_STATE } from '../../../../util/test/accountsControllerTestUtils'; const mockStore = configureMockStore(); const initialState = { engine: { - backgroundState: initialBackgroundState, + backgroundState: { + ...initialBackgroundState, + AccountsController: MOCK_ACCOUNTS_CONTROLLER_STATE, + }, }, }; const store = mockStore(initialState); diff --git a/app/components/UI/TransactionElement/index.js b/app/components/UI/TransactionElement/index.js index a916b87399e..2801450fe07 100644 --- a/app/components/UI/TransactionElement/index.js +++ b/app/components/UI/TransactionElement/index.js @@ -33,10 +33,8 @@ import { selectChainId, selectTicker, } from '../../../selectors/networkController'; -import { - selectIdentities, - selectSelectedAddress, -} from '../../../selectors/preferencesController'; +import { selectIdentities } from '../../../selectors/preferencesController'; +import { selectSelectedInternalAccountChecksummedAddress } from '../../../selectors/accountsController'; const createStyles = (colors, typography) => StyleSheet.create({ @@ -297,6 +295,8 @@ class TransactionElement extends PureComponent { : transactionIconSwap; break; case TRANSACTION_TYPES.APPROVE: + case TRANSACTION_TYPES.INCREASE_ALLOWANCE: + case TRANSACTION_TYPES.SET_APPROVAL_FOR_ALL: icon = isFailedTransaction ? transactionIconApproveFailed : transactionIconApprove; @@ -607,7 +607,7 @@ const mapStateToProps = (state) => ({ chainId: selectChainId(state), identities: selectIdentities(state), primaryCurrency: state.settings.primaryCurrency, - selectedAddress: selectSelectedAddress(state), + selectedAddress: selectSelectedInternalAccountChecksummedAddress(state), swapsTransactions: state.engine.backgroundState.TransactionController.swapsTransactions || {}, swapsTokens: state.engine.backgroundState.SwapsController.tokens, diff --git a/app/components/UI/TransactionElement/index.test.tsx b/app/components/UI/TransactionElement/index.test.tsx index aaddb7bab75..c14056f2f03 100644 --- a/app/components/UI/TransactionElement/index.test.tsx +++ b/app/components/UI/TransactionElement/index.test.tsx @@ -4,11 +4,15 @@ import configureMockStore from 'redux-mock-store'; import { shallow } from 'enzyme'; import { Provider } from 'react-redux'; import initialBackgroundState from '../../../util/test/initial-background-state.json'; +import { MOCK_ACCOUNTS_CONTROLLER_STATE } from '../../../util/test/accountsControllerTestUtils'; const mockStore = configureMockStore(); const initialState = { engine: { - backgroundState: initialBackgroundState, + backgroundState: { + ...initialBackgroundState, + AccountsController: MOCK_ACCOUNTS_CONTROLLER_STATE, + }, }, settings: { primaryCurrency: 'ETH', diff --git a/app/components/UI/TransactionElement/utils.js b/app/components/UI/TransactionElement/utils.js index bc391969aa1..1f6f7ef9a45 100644 --- a/app/components/UI/TransactionElement/utils.js +++ b/app/components/UI/TransactionElement/utils.js @@ -605,6 +605,10 @@ function decodeConfirmTx(args) { let transactionType; if (actionKey === strings('transactions.approve')) transactionType = TRANSACTION_TYPES.APPROVE; + else if (actionKey === strings('transactions.increase_allowance')) + transactionType = TRANSACTION_TYPES.INCREASE_ALLOWANCE; + else if (actionKey === strings('transactions.set_approval_for_all')) + transactionType = TRANSACTION_TYPES.SET_APPROVAL_FOR_ALL; else if (actionKey === strings('transactions.swaps_transaction')) transactionType = TRANSACTION_TYPES.SWAPS_TRANSACTION; else if ( diff --git a/app/components/UI/TransactionElement/utils.test.js b/app/components/UI/TransactionElement/utils.test.js index d4a251629d3..5e85a9abdbb 100644 --- a/app/components/UI/TransactionElement/utils.test.js +++ b/app/components/UI/TransactionElement/utils.test.js @@ -1,108 +1,290 @@ -import { decodeIncomingTransfer } from './utils'; -describe('decodeIncomingTransfer', () => { - it('should decode an incoming transfer', () => { - // Arrange - const args = { - tx: { - txParams: { - to: '0x77648f1407986479fb1fa5cc3597084b5dbdb057', - from: '0x1440ec793ae50fa046b95bfeca5af475b6003f9e', - value: '52daf0', - }, - transferInformation: { - symbol: 'USDT', - decimals: 6, - contractAddress: '0xdac17f958d2ee523a2206206994597c13d831ec7', +import { + CONTRACT_CREATION_SIGNATURE, + TRANSACTION_TYPES, +} from '../../../util/transactions'; +import decodeTransaction, { decodeIncomingTransfer } from './utils'; + +jest.mock('../../../core/Engine', () => ({ + context: { + KeyringController: { + getQRKeyringState: async () => ({ subscribe: () => ({}) }), + }, + TokenListController: { + state: { + tokenList: { + '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f': { + address: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', + symbol: 'SNX', + decimals: 18, + name: 'Synthetix Network Token', + iconUrl: + 'https://static.cx.metamask.io/api/v1/tokenIcons/1/0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f.png', + type: 'erc20', + aggregators: [ + 'Aave', + 'Bancor', + 'CMC', + 'Crypto.com', + 'CoinGecko', + '1inch', + 'PMM', + 'Synthetix', + 'Zerion', + 'Lifi', + ], + occurrences: 10, + fees: { + '0x5fd79d46eba7f351fe49bff9e87cdea6c821ef9f': 0, + '0xda4ef8520b1a57d7d63f1e249606d1a459698876': 0, + }, + }, }, - hash: '0x942d7843454266b81bf631022aa5f3f944691731b62d67c4e80c4bb5740058bb', }, - currentCurrency: 'usd', - contractExchangeRates: {}, - totalGas: '0x64', - actionKey: 'key', - primaryCurrency: 'ETH', - selectedAddress: '0x77648f1407986479fb1fa5cc3597084b5dbdb057', - ticker: 'ETH', - }; + tokensChainsCache: {}, + preventPollingOnNetworkRestart: false, + }, + }, +})); + +describe('Utils', () => { + describe('decodeIncomingTransfer', () => { + it('should decode an incoming transfer', () => { + // Arrange + const args = { + tx: { + txParams: { + to: '0x77648f1407986479fb1fa5cc3597084b5dbdb057', + from: '0x1440ec793ae50fa046b95bfeca5af475b6003f9e', + value: '52daf0', + }, + transferInformation: { + symbol: 'USDT', + decimals: 6, + contractAddress: '0xdac17f958d2ee523a2206206994597c13d831ec7', + }, + hash: '0x942d7843454266b81bf631022aa5f3f944691731b62d67c4e80c4bb5740058bb', + }, + currentCurrency: 'usd', + contractExchangeRates: {}, + totalGas: '0x64', + actionKey: 'key', + primaryCurrency: 'ETH', + selectedAddress: '0x77648f1407986479fb1fa5cc3597084b5dbdb057', + ticker: 'ETH', + }; + + // Act + const [transactionElement, transactionDetails] = + decodeIncomingTransfer(args); - // Act - const [transactionElement, transactionDetails] = - decodeIncomingTransfer(args); - - // Assert - expect(transactionElement).toEqual({ - actionKey: 'key', - renderFrom: '0x1440ec793aE50fA046B95bFeCa5aF475b6003f9e', - renderTo: '0x77648F1407986479fb1fA5Cc3597084B5dbDB057', - value: '5.43 USDT', - fiatValue: undefined, - isIncomingTransfer: true, - transactionType: 'transaction_received_token', + // Assert + expect(transactionElement).toEqual({ + actionKey: 'key', + renderFrom: '0x1440ec793aE50fA046B95bFeCa5aF475b6003f9e', + renderTo: '0x77648F1407986479fb1fA5Cc3597084B5dbDB057', + value: '5.43 USDT', + fiatValue: undefined, + isIncomingTransfer: true, + transactionType: 'transaction_received_token', + }); + expect(transactionDetails).toEqual({ + renderTotalGas: '< 0.00001 ETH', + renderValue: '5.43 USDT', + renderFrom: '0x1440ec793aE50fA046B95bFeCa5aF475b6003f9e', + renderTo: '0x77648F1407986479fb1fA5Cc3597084B5dbDB057', + hash: '0x942d7843454266b81bf631022aa5f3f944691731b62d67c4e80c4bb5740058bb', + transactionType: 'transaction_received_token', + summaryAmount: '5.43 USDT', + summaryFee: '< 0.00001 ETH', + summaryTotalAmount: '5.43 USDT / < 0.00001 ETH', + summarySecondaryTotalAmount: undefined, + }); }); - expect(transactionDetails).toEqual({ - renderTotalGas: '< 0.00001 ETH', - renderValue: '5.43 USDT', - renderFrom: '0x1440ec793aE50fA046B95bFeCa5aF475b6003f9e', - renderTo: '0x77648F1407986479fb1fA5Cc3597084B5dbDB057', - hash: '0x942d7843454266b81bf631022aa5f3f944691731b62d67c4e80c4bb5740058bb', - transactionType: 'transaction_received_token', - summaryAmount: '5.43 USDT', - summaryFee: '< 0.00001 ETH', - summaryTotalAmount: '5.43 USDT / < 0.00001 ETH', - summarySecondaryTotalAmount: undefined, + + it('should decode an incoming transfer with big number with 10 digits', () => { + // Arrange + const args = { + tx: { + txParams: { + to: '0x77648f1407986479fb1fa5cc3597084b5dbdb057', + from: '0x1440ec793ae50fa046b95bfeca5af475b6003f9e', + value: '3B9ACA00', // 1000000000 in decimal + }, + transferInformation: { + symbol: 'USDT', + decimals: 6, + contractAddress: '0xdac17f958d2ee523a2206206994597c13d831ec7', + }, + hash: '0x942d7843454266b81bf631022aa5f3f944691731b62d67c4e80c4bb5740058bb', + }, + currentCurrency: 'usd', + contractExchangeRates: {}, + totalGas: '0x64', + actionKey: 'key', + primaryCurrency: 'ETH', + selectedAddress: '0x77648f1407986479fb1fa5cc3597084b5dbdb057', + ticker: 'ETH', + }; + + // Act + const [transactionElement, transactionDetails] = + decodeIncomingTransfer(args); + + // Assert + expect(transactionElement).toEqual({ + actionKey: 'key', + renderFrom: '0x1440ec793aE50fA046B95bFeCa5aF475b6003f9e', + renderTo: '0x77648F1407986479fb1fA5Cc3597084B5dbDB057', + value: '1000 USDT', + fiatValue: undefined, + isIncomingTransfer: true, + transactionType: 'transaction_received_token', + }); + expect(transactionDetails).toEqual({ + renderTotalGas: '< 0.00001 ETH', + renderValue: '1000 USDT', + renderFrom: '0x1440ec793aE50fA046B95bFeCa5aF475b6003f9e', + renderTo: '0x77648F1407986479fb1fA5Cc3597084B5dbDB057', + hash: '0x942d7843454266b81bf631022aa5f3f944691731b62d67c4e80c4bb5740058bb', + transactionType: 'transaction_received_token', + summaryAmount: '1000 USDT', + summaryFee: '< 0.00001 ETH', + summaryTotalAmount: '1000 USDT / < 0.00001 ETH', + summarySecondaryTotalAmount: undefined, + }); }); }); - it('should decode an incoming transfer with big number with 10 digits', () => { - // Arrange - const args = { - tx: { - txParams: { - to: '0x77648f1407986479fb1fa5cc3597084b5dbdb057', - from: '0x1440ec793ae50fa046b95bfeca5af475b6003f9e', - value: '3B9ACA00', // 1000000000 in decimal + describe('decodeTransaction', () => { + const expectedTransactionDetails = { + hash: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', + renderFrom: '0xABcdEFABcdEFabcdEfAbCdefabcdeFABcDEFabCD', + renderGas: '21000', + renderGasPrice: 1, + renderTo: '0x1234567890AbcdEF1234567890aBcdef12345678', + renderTotalGas: '0.00002 ETH', + renderValue: '0 ETH', + summaryAmount: '0 ETH', + summaryFee: '0.00002 ETH', + summarySecondaryTotalAmount: undefined, + summaryTotalAmount: '0.00002 ETH', + }; + + const txParamsMock = { + to: '0x1234567890abcdef1234567890abcdef12345678', + from: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcd', + value: '0', + data: '0xa22cb4650000000000000000000000000000000000000000000000000000000000000001', + gas: '0x5208', + gasPrice: '0x3b9aca00', + }; + + it('decodes a transaction with type set approval for all', async () => { + const args = { + tx: { + txParams: txParamsMock, + transactionType: TRANSACTION_TYPES.SET_APPROVAL_FOR_ALL, + hash: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', }, - transferInformation: { - symbol: 'USDT', - decimals: 6, - contractAddress: '0xdac17f958d2ee523a2206206994597c13d831ec7', + currentCurrency: 'usd', + contractExchangeRates: {}, + totalGas: '0x5208', + actionKey: 'transactions.set_approval_for_all', + primaryCurrency: 'ETH', + selectedAddress: '0x1234567890abcdef1234567890abcdef12345678', + ticker: 'ETH', + }; + + const result = await decodeTransaction(args); + + expect(result).toEqual([ + { + actionKey: 'Set Approval For All', + fiatValue: undefined, + renderFrom: '0xABcdEFABcdEFabcdEfAbCdefabcdeFABcDEFabCD', + renderTo: '0x1234567890AbcdEF1234567890aBcdef12345678', + transactionType: 'transaction_set_approval_for_all', + value: '0 ETH', }, - hash: '0x942d7843454266b81bf631022aa5f3f944691731b62d67c4e80c4bb5740058bb', - }, - currentCurrency: 'usd', - contractExchangeRates: {}, - totalGas: '0x64', - actionKey: 'key', - primaryCurrency: 'ETH', - selectedAddress: '0x77648f1407986479fb1fa5cc3597084b5dbdb057', - ticker: 'ETH', - }; + { + ...expectedTransactionDetails, + transactionType: 'transaction_set_approval_for_all', + }, + ]); + }); + + it('decodes a transaction with type increase allowance', async () => { + const args = { + tx: { + txParams: { + ...txParamsMock, + data: '0x39509351', + }, + transactionType: TRANSACTION_TYPES.INCREASE_ALLOWANCE, + hash: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', + }, + currentCurrency: 'usd', + contractExchangeRates: {}, + totalGas: '0x5208', + actionKey: 'transactions.increase_allowance', + primaryCurrency: 'ETH', + selectedAddress: '0x1234567890abcdef1234567890abcdef12345678', + ticker: 'ETH', + }; + + const result = await decodeTransaction(args); - // Act - const [transactionElement, transactionDetails] = - decodeIncomingTransfer(args); - - // Assert - expect(transactionElement).toEqual({ - actionKey: 'key', - renderFrom: '0x1440ec793aE50fA046B95bFeCa5aF475b6003f9e', - renderTo: '0x77648F1407986479fb1fA5Cc3597084B5dbDB057', - value: '1000 USDT', - fiatValue: undefined, - isIncomingTransfer: true, - transactionType: 'transaction_received_token', + expect(result).toEqual([ + { + actionKey: 'Increase Allowance', + fiatValue: undefined, + renderFrom: '0xABcdEFABcdEFabcdEfAbCdefabcdeFABcDEFabCD', + renderTo: '0x1234567890AbcdEF1234567890aBcdef12345678', + transactionType: 'transaction_increase_allowance', + value: '0 ETH', + }, + { + ...expectedTransactionDetails, + transactionType: 'transaction_increase_allowance', + }, + ]); }); - expect(transactionDetails).toEqual({ - renderTotalGas: '< 0.00001 ETH', - renderValue: '1000 USDT', - renderFrom: '0x1440ec793aE50fA046B95bFeCa5aF475b6003f9e', - renderTo: '0x77648F1407986479fb1fA5Cc3597084B5dbDB057', - hash: '0x942d7843454266b81bf631022aa5f3f944691731b62d67c4e80c4bb5740058bb', - transactionType: 'transaction_received_token', - summaryAmount: '1000 USDT', - summaryFee: '< 0.00001 ETH', - summaryTotalAmount: '1000 USDT / < 0.00001 ETH', - summarySecondaryTotalAmount: undefined, + + it('decodes a transaction with type contract interactions', async () => { + const args = { + tx: { + txParams: { + ...txParamsMock, + data: CONTRACT_CREATION_SIGNATURE, + }, + hash: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', + }, + currentCurrency: 'usd', + contractExchangeRates: {}, + totalGas: '0x5208', + actionKey: 'transactions.swaps_transaction', + primaryCurrency: 'ETH', + selectedAddress: '0x1234567890abcdef1234567890abcdef12345678', + ticker: 'ETH', + }; + + const result = await decodeTransaction(args); + + expect(result).toEqual([ + { + actionKey: 'Contract Deployment', + fiatValue: undefined, + contractDeployment: true, + renderFrom: '0xABcdEFABcdEFabcdEfAbCdefabcdeFABcDEFabCD', + renderTo: 'New Contract', + transactionType: 'transaction_site_interaction', + value: '0.00002 ETH', + }, + { + ...expectedTransactionDetails, + renderTo: 'New Contract', + }, + ]); }); }); }); diff --git a/app/components/UI/Transactions/RetryModal/index.tsx b/app/components/UI/Transactions/RetryModal/index.tsx index ef1224c5dd9..e91598a90ea 100644 --- a/app/components/UI/Transactions/RetryModal/index.tsx +++ b/app/components/UI/Transactions/RetryModal/index.tsx @@ -7,6 +7,8 @@ import { strings } from '../../../../../locales/i18n'; import { useTheme } from '../../../../util/theme'; import ActionModal from '../../ActionModal'; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any const createStyles = (colors: any) => StyleSheet.create({ modal: { diff --git a/app/components/UI/Transactions/index.js b/app/components/UI/Transactions/index.js index 23da44f1a27..312bd96b798 100644 --- a/app/components/UI/Transactions/index.js +++ b/app/components/UI/Transactions/index.js @@ -59,7 +59,7 @@ import { } from '../../../selectors/currencyRateController'; import { selectContractExchangeRates } from '../../../selectors/tokenRatesController'; import { selectAccounts } from '../../../selectors/accountTrackerController'; -import { selectSelectedAddress } from '../../../selectors/preferencesController'; +import { selectSelectedInternalAccountChecksummedAddress } from '../../../selectors/accountsController'; import { TransactionError, CancelTransactionError, @@ -866,7 +866,7 @@ const mapStateToProps = (state) => ({ contractExchangeRates: selectContractExchangeRates(state), conversionRate: selectConversionRate(state), currentCurrency: selectCurrentCurrency(state), - selectedAddress: selectSelectedAddress(state), + selectedAddress: selectSelectedInternalAccountChecksummedAddress(state), networkConfigurations: selectNetworkConfigurations(state), providerConfig: selectProviderConfig(state), gasFeeEstimates: selectGasFeeEstimates(state), diff --git a/app/components/UI/Transactions/index.test.tsx b/app/components/UI/Transactions/index.test.tsx index b0fb62bb481..4cd3c5a9985 100644 --- a/app/components/UI/Transactions/index.test.tsx +++ b/app/components/UI/Transactions/index.test.tsx @@ -4,11 +4,15 @@ import configureMockStore from 'redux-mock-store'; import { shallow } from 'enzyme'; import { Provider } from 'react-redux'; import initialBackgroundState from '../../../util/test/initial-background-state.json'; +import { MOCK_ACCOUNTS_CONTROLLER_STATE } from '../../../util/test/accountsControllerTestUtils'; const mockStore = configureMockStore(); const initialState = { engine: { - backgroundState: initialBackgroundState, + backgroundState: { + ...initialBackgroundState, + AccountsController: MOCK_ACCOUNTS_CONTROLLER_STATE, + }, }, settings: { primaryCurrency: 'USD', diff --git a/app/components/UI/TurnOffRememberMeModal/styles.ts b/app/components/UI/TurnOffRememberMeModal/styles.ts index ba461bc1a53..1204096c616 100644 --- a/app/components/UI/TurnOffRememberMeModal/styles.ts +++ b/app/components/UI/TurnOffRememberMeModal/styles.ts @@ -2,6 +2,8 @@ import { fontStyles } from '../../../styles/common'; import { StyleSheet } from 'react-native'; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any export const createStyles = (colors: any) => StyleSheet.create({ container: { diff --git a/app/components/UI/UpdateNeeded/__snapshots__/UpdateNeeded.test.tsx.snap b/app/components/UI/UpdateNeeded/__snapshots__/UpdateNeeded.test.tsx.snap index 0a0340ba3fa..b83aa3f5690 100644 --- a/app/components/UI/UpdateNeeded/__snapshots__/UpdateNeeded.test.tsx.snap +++ b/app/components/UI/UpdateNeeded/__snapshots__/UpdateNeeded.test.tsx.snap @@ -356,7 +356,7 @@ exports[`UpdateNeeded should render correctly 1`] = ` ], { "alignItems": "center", - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "flex": 1, "justifyContent": "space-between", "paddingHorizontal": 24, @@ -412,7 +412,7 @@ exports[`UpdateNeeded should render correctly 1`] = ` accessibilityRole="text" style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "Euclid Circular B", "fontSize": 32, "fontWeight": "700", @@ -429,7 +429,7 @@ exports[`UpdateNeeded should render correctly 1`] = ` accessibilityRole="text" style={ { - "color": "#24272A", + "color": "#141618", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -462,7 +462,7 @@ exports[`UpdateNeeded should render correctly 1`] = ` { "alignItems": "center", "alignSelf": "stretch", - "backgroundColor": "#0376C9", + "backgroundColor": "#0376c9", "borderRadius": 20, "flexDirection": "row", "height": undefined, @@ -478,7 +478,7 @@ exports[`UpdateNeeded should render correctly 1`] = ` accessibilityRole="text" style={ { - "color": "#FFFFFF", + "color": "#ffffff", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", @@ -515,7 +515,7 @@ exports[`UpdateNeeded should render correctly 1`] = ` accessibilityRole="text" style={ { - "color": "#0376C9", + "color": "#0376c9", "fontFamily": "Euclid Circular B", "fontSize": 14, "fontWeight": "400", diff --git a/app/components/UI/UpdateNeeded/styles.ts b/app/components/UI/UpdateNeeded/styles.ts index 5a1485f4f54..9a901dac982 100644 --- a/app/components/UI/UpdateNeeded/styles.ts +++ b/app/components/UI/UpdateNeeded/styles.ts @@ -1,6 +1,8 @@ /* eslint-disable import/prefer-default-export */ import { StyleSheet } from 'react-native'; +// TODO: Replace "any" with type +// eslint-disable-next-line @typescript-eslint/no-explicit-any export const createStyles = (colors: any) => StyleSheet.create({ screen: { diff --git a/app/components/UI/UrlAutocomplete/__snapshots__/index.test.js.snap b/app/components/UI/UrlAutocomplete/__snapshots__/index.test.js.snap index 0409eb9b901..3bc95571b8a 100644 --- a/app/components/UI/UrlAutocomplete/__snapshots__/index.test.js.snap +++ b/app/components/UI/UrlAutocomplete/__snapshots__/index.test.js.snap @@ -4,7 +4,7 @@ exports[`UrlAutocomplete should render correctly 1`] = ` ) => { const { styles } = useStyles(styleSheet, { style }); @@ -50,6 +52,8 @@ const WalletAccount = ({ style }: WalletAccountProps, ref: React.Ref) => { accountActionsRef, })); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const accountAvatarType = useSelector((state: any) => state.settings.useBlockieIcon ? AvatarAccountType.Blockies diff --git a/app/components/UI/WalletAccount/__snapshots__/WalletAccount.test.tsx.snap b/app/components/UI/WalletAccount/__snapshots__/WalletAccount.test.tsx.snap index 68d82fb5a86..510d1b649a1 100644 --- a/app/components/UI/WalletAccount/__snapshots__/WalletAccount.test.tsx.snap +++ b/app/components/UI/WalletAccount/__snapshots__/WalletAccount.test.tsx.snap @@ -4,7 +4,7 @@ exports[`WalletAccount renders correctly 1`] = ` + > + 0xC496...a756 + { const { colors } = useTheme(); @@ -30,6 +31,7 @@ const WalletAction = ({ void; containerStyle?: ViewStyle; iconStyle?: ImageStyle; + actionID?: string; } diff --git a/app/components/UI/WarningAlert/__snapshots__/WarningAlert.test.tsx.snap b/app/components/UI/WarningAlert/__snapshots__/WarningAlert.test.tsx.snap index c3f5871cdae..b32e14968a8 100644 --- a/app/components/UI/WarningAlert/__snapshots__/WarningAlert.test.tsx.snap +++ b/app/components/UI/WarningAlert/__snapshots__/WarningAlert.test.tsx.snap @@ -5,8 +5,8 @@ exports[`ButtonBase should render correctly 1`] = ` style={ [ { - "backgroundColor": "#FFFFFF", - "borderColor": "#BF5208", + "backgroundColor": "#ffffff", + "borderColor": "#bf5208", "borderRadius": 8, "bottom": 20, "left": 16, @@ -35,7 +35,7 @@ exports[`ButtonBase should render correctly 1`] = ` primary={true} style={ { - "color": "#24272A", + "color": "#141618", "lineHeight": 18, "paddingLeft": 4, } diff --git a/app/components/UI/WebsiteIcon/__snapshots__/index.test.tsx.snap b/app/components/UI/WebsiteIcon/__snapshots__/index.test.tsx.snap index 83f810a3c3f..bdfc9824112 100644 --- a/app/components/UI/WebsiteIcon/__snapshots__/index.test.tsx.snap +++ b/app/components/UI/WebsiteIcon/__snapshots__/index.test.tsx.snap @@ -5,7 +5,7 @@ exports[`WebsiteIcon should render correctly 1`] = ` { const navigation = useNavigation(); const callButton = useCallback( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (onPress: any) => { dismissModal(() => onPress({ navigation })); }, [navigation], ); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const renderSlideElement = (elementInfo: any) => { switch (elementInfo.type) { case 'title': @@ -185,16 +189,24 @@ const WhatsNewModal = () => { return null; }; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const renderSlide = (slideInfo: any, index: number) => { const key = `slide-info-${index}`; return ( - {slideInfo.map((elementInfo: any, elIndex: number) => { - const elKey = `${key}-${elIndex}`; - return {renderSlideElement(elementInfo)}; - })} + { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any + slideInfo.map((elementInfo: any, elIndex: number) => { + const elKey = `${key}-${elIndex}`; + return ( + {renderSlideElement(elementInfo)} + ); + }) + } diff --git a/app/components/UI/WhatsNewModal/types.ts b/app/components/UI/WhatsNewModal/types.ts index c10a16ac2e6..400cda01593 100644 --- a/app/components/UI/WhatsNewModal/types.ts +++ b/app/components/UI/WhatsNewModal/types.ts @@ -29,6 +29,8 @@ interface SlideButton { type: 'button'; buttonType: SlideButtonType; buttonText: string; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any onPress: (props: { navigation: any }) => void; } diff --git a/app/components/UI/WhatsNewModal/whatsNewList.ts b/app/components/UI/WhatsNewModal/whatsNewList.ts index d7fc56a2c5a..c546a30fdae 100644 --- a/app/components/UI/WhatsNewModal/whatsNewList.ts +++ b/app/components/UI/WhatsNewModal/whatsNewList.ts @@ -52,5 +52,23 @@ export const whatsNew: WhatsNew = { ], ] as WhatsNew['slides']) : []), + [ + { + type: 'image', + image: require('../../../images/whats_new_transaction_simulation.png'), + }, + { + type: 'title', + title: strings('whats_new.transaction_simulation.title'), + }, + { + type: 'description', + description: strings('whats_new.transaction_simulation.description_1'), + }, + { + type: 'description', + description: strings('whats_new.transaction_simulation.description_2'), + }, + ], ], }; diff --git a/app/components/Views/AccountActions/AccountActions.test.tsx b/app/components/Views/AccountActions/AccountActions.test.tsx index a25e5ccd3ec..07f6e5f04ef 100644 --- a/app/components/Views/AccountActions/AccountActions.test.tsx +++ b/app/components/Views/AccountActions/AccountActions.test.tsx @@ -15,6 +15,11 @@ import { VIEW_ETHERSCAN, } from './AccountActions.constants'; import initialBackgroundState from '../../../util/test/initial-background-state.json'; +import { + MOCK_ACCOUNTS_CONTROLLER_STATE, + MOCK_ADDRESS_2, +} from '../../../util/test/accountsControllerTestUtils'; +import { toChecksumHexAddress } from '@metamask/controller-utils'; const mockEngine = Engine; @@ -23,12 +28,7 @@ const initialState = { engine: { backgroundState: { ...initialBackgroundState, - PreferencesController: { - selectedAddress: '0xe7E125654064EEa56229f273dA586F10DF96B0a1', - identities: { - '0xe7E125654064EEa56229f273dA586F10DF96B0a1': { name: 'Account 1' }, - }, - }, + AccountsController: MOCK_ACCOUNTS_CONTROLLER_STATE, }, }, }; @@ -93,7 +93,7 @@ describe('AccountActions', () => { expect(mockNavigate).toHaveBeenCalledWith('Webview', { screen: 'SimpleWebview', params: { - url: 'https://etherscan.io/address/0xe7E125654064EEa56229f273dA586F10DF96B0a1', + url: 'https://etherscan.io/address/0xC4966c0D659D99699BFD7EB54D8fafEE40e4a756', title: 'etherscan.io', }, }); @@ -107,7 +107,7 @@ describe('AccountActions', () => { fireEvent.press(getByTestId(SHARE_ADDRESS)); expect(Share.open).toHaveBeenCalledWith({ - message: '0xe7E125654064EEa56229f273dA586F10DF96B0a1', + message: toChecksumHexAddress(MOCK_ADDRESS_2), }); }); diff --git a/app/components/Views/AccountActions/AccountActions.tsx b/app/components/Views/AccountActions/AccountActions.tsx index 6a083f36cac..a0d387b1fcc 100644 --- a/app/components/Views/AccountActions/AccountActions.tsx +++ b/app/components/Views/AccountActions/AccountActions.tsx @@ -26,7 +26,7 @@ import { selectNetworkConfigurations, selectProviderConfig, } from '../../../selectors/networkController'; -import { selectSelectedAddress } from '../../../selectors/preferencesController'; +import { selectSelectedInternalAccountChecksummedAddress } from '../../../selectors/accountsController'; import { strings } from '../../../../locales/i18n'; // Internal dependencies @@ -52,7 +52,9 @@ const AccountActions = () => { const providerConfig = useSelector(selectProviderConfig); - const selectedAddress = useSelector(selectSelectedAddress); + const selectedAddress = useSelector( + selectSelectedInternalAccountChecksummedAddress, + ); const networkConfigurations = useSelector(selectNetworkConfigurations); const blockExplorer = useMemo(() => { diff --git a/app/components/Views/AccountBackupStep1/__snapshots__/index.test.tsx.snap b/app/components/Views/AccountBackupStep1/__snapshots__/index.test.tsx.snap index 3dfa9e4cebf..1f92981eb93 100644 --- a/app/components/Views/AccountBackupStep1/__snapshots__/index.test.tsx.snap +++ b/app/components/Views/AccountBackupStep1/__snapshots__/index.test.tsx.snap @@ -54,7 +54,7 @@ exports[`AccountBackupStep1 should render correctly 1`] = ` collapsable={false} style={ { - "backgroundColor": "#FFFFFF", + "backgroundColor": "#ffffff", "borderBottomColor": "rgb(216, 216, 216)", "elevation": 0, "flex": 1, @@ -149,7 +149,7 @@ exports[`AccountBackupStep1 should render correctly 1`] = ` style={ { "height": 15, - "tintColor": "#24272A", + "tintColor": "#141618", "width": 122, } } @@ -353,7 +353,7 @@ exports[`AccountBackupStep1 should render correctly 1`] = ` @@ -879,7 +879,7 @@ exports[`AccountBackupStep1 should render correctly 1`] = ` @@ -829,7 +829,7 @@ exports[`AccountBackupStep1B should render correctly 1`] = ` style={ [ { - "color": "#0376C9", + "color": "#0376c9", "fontSize": 12, }, { @@ -850,7 +850,7 @@ exports[`AccountBackupStep1B should render correctly 1`] = ` { props.navigation.navigate('Webview', { screen: 'SimpleWebview', params: { - url: 'https://metamask.zendesk.com/hc/en-us/articles/360015489591-Basic-Safety-Tips', + url: 'https://support.metamask.io/privacy-and-security/basic-safety-and-security-tips-for-metamask/', title: strings('drawer.metamask_support'), }, }); diff --git a/app/components/Views/AccountConnect/AccountConnect.tsx b/app/components/Views/AccountConnect/AccountConnect.tsx index 7889c88029f..774e6b12fa2 100644 --- a/app/components/Views/AccountConnect/AccountConnect.tsx +++ b/app/components/Views/AccountConnect/AccountConnect.tsx @@ -27,10 +27,8 @@ import { USER_INTENT } from '../../../constants/permissions'; import { MetaMetricsEvents } from '../../../core/Analytics'; import UntypedEngine from '../../../core/Engine'; import { selectAccountsLength } from '../../../selectors/accountTrackerController'; -import { - selectIdentities, - selectSelectedAddress, -} from '../../../selectors/preferencesController'; +import { selectIdentities } from '../../../selectors/preferencesController'; +import { selectSelectedInternalAccountChecksummedAddress } from '../../../selectors/accountsController'; import { isDefaultAccountName } from '../../../util/ENSUtils'; import Logger from '../../../util/Logger'; import getAccountNameWithENS from '../../../util/accounts'; @@ -75,6 +73,8 @@ const createStyles = () => }); const AccountConnect = (props: AccountConnectProps) => { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const Engine = UntypedEngine as any; const { colors } = useTheme(); @@ -86,7 +86,9 @@ const AccountConnect = (props: AccountConnectProps) => { const [blockedUrl, setBlockedUrl] = useState(''); - const selectedWalletAddress = useSelector(selectSelectedAddress); + const selectedWalletAddress = useSelector( + selectSelectedInternalAccountChecksummedAddress, + ); const [selectedAddresses, setSelectedAddresses] = useState([ selectedWalletAddress, ]); @@ -103,6 +105,8 @@ const AccountConnect = (props: AccountConnectProps) => { const [userIntent, setUserIntent] = useState(USER_INTENT.None); const { toastRef } = useContext(ToastContext); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const accountAvatarType = useSelector((state: any) => state.settings.useBlockieIcon ? AvatarAccountType.Blockies @@ -336,6 +340,8 @@ const AccountConnect = (props: AccountConnectProps) => { accountAddress: activeAddress, accountAvatarType, }); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (e: any) { Logger.error(e, 'Error while trying to connect to a dApp.'); } finally { @@ -367,6 +373,8 @@ const AccountConnect = (props: AccountConnectProps) => { ) as string; !isMultiSelect && setSelectedAddresses([checksummedAddress]); trackEvent(MetaMetricsEvents.ACCOUNTS_ADDED_NEW_ACCOUNT); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (e: any) { Logger.error(e, 'error while trying to add a new account'); } finally { diff --git a/app/components/Views/AccountConnect/AccountConnectSingle/AccountConnectSingle.tsx b/app/components/Views/AccountConnect/AccountConnectSingle/AccountConnectSingle.tsx index 3fab788978e..64574d6fcac 100644 --- a/app/components/Views/AccountConnect/AccountConnectSingle/AccountConnectSingle.tsx +++ b/app/components/Views/AccountConnect/AccountConnectSingle/AccountConnectSingle.tsx @@ -50,6 +50,8 @@ const AccountConnectSingle = ({ connection, }: AccountConnectSingleProps) => { const { styles } = useStyles(styleSheet, {}); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const accountAvatarType = useSelector((state: any) => state.settings.useBlockieIcon ? AvatarAccountType.Blockies diff --git a/app/components/Views/AccountPermissions/AccountPermissions.tsx b/app/components/Views/AccountPermissions/AccountPermissions.tsx index e770d42a6af..c6a51d2a392 100755 --- a/app/components/Views/AccountPermissions/AccountPermissions.tsx +++ b/app/components/Views/AccountPermissions/AccountPermissions.tsx @@ -54,12 +54,16 @@ import { useMetrics } from '../../../components/hooks/useMetrics'; const AccountPermissions = (props: AccountPermissionsProps) => { const navigation = useNavigation(); const { trackEvent } = useMetrics(); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const Engine = UntypedEngine as any; const { hostInfo: { metadata: { origin: hostname }, }, } = props.route.params; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const accountAvatarType = useSelector((state: any) => state.settings.useBlockieIcon ? AvatarAccountType.Blockies @@ -69,6 +73,8 @@ const AccountPermissions = (props: AccountPermissionsProps) => { const accountsLength = useSelector(selectAccountsLength); const nonTestnetNetworks = useSelector( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (state: any) => Object.keys(selectNetworkConfigurations(state)).length + 1, ); @@ -89,6 +95,8 @@ const AccountPermissions = (props: AccountPermissionsProps) => { const { toastRef } = useContext(ToastContext); const [isLoading, setIsLoading] = useState(false); const permittedAccountsList = useSelector( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (state: any) => state.engine.backgroundState.PermissionController, ); const permittedAccountsByHostname = getPermittedAccountsByHostname( @@ -177,6 +185,8 @@ const AccountPermissions = (props: AccountPermissionsProps) => { source: metricsSource, number_of_accounts: accounts?.length, }); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (e: any) { Logger.error(e, 'Error while trying to add a new account.'); } finally { @@ -230,6 +240,8 @@ const AccountPermissions = (props: AccountPermissionsProps) => { number_of_accounts_connected: connectedAccounts, number_of_networks: nonTestnetNetworks, }); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (e: any) { Logger.error(e, 'Error while trying to connect to a dApp.'); } finally { diff --git a/app/components/Views/AccountPermissions/AccountPermissionsRevoke/AccountPermissionsRevoke.tsx b/app/components/Views/AccountPermissions/AccountPermissionsRevoke/AccountPermissionsRevoke.tsx index b6deec5c041..10ff892a81a 100644 --- a/app/components/Views/AccountPermissions/AccountPermissionsRevoke/AccountPermissionsRevoke.tsx +++ b/app/components/Views/AccountPermissions/AccountPermissionsRevoke/AccountPermissionsRevoke.tsx @@ -50,6 +50,8 @@ const AccountPermissionsRevoke = ({ secureIcon, accountAvatarType, }: AccountPermissionsRevokeProps) => { + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const Engine = UntypedEngine as any; const { styles } = useStyles(styleSheet, {}); const { trackEvent } = useMetrics(); @@ -59,6 +61,8 @@ const AccountPermissionsRevoke = ({ const accountsLength = useSelector(selectAccountsLength); const nonTestnetNetworks = useSelector( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (state: any) => Object.keys(selectNetworkConfigurations(state)).length + 1, ); diff --git a/app/components/Views/AccountSelector/AccountSelector.tsx b/app/components/Views/AccountSelector/AccountSelector.tsx index 9bab9847ee6..3054bf4cbcc 100644 --- a/app/components/Views/AccountSelector/AccountSelector.tsx +++ b/app/components/Views/AccountSelector/AccountSelector.tsx @@ -47,6 +47,8 @@ const AccountSelector = ({ route }: AccountSelectorProps) => { const { onSelectAccount, checkBalanceError } = route.params || {}; const { reloadAccounts } = useSelector((state: RootState) => state.accounts); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any const Engine = UntypedEngine as any; const sheetRef = useRef(null); const { accounts, ensByAccountAddress } = useAccounts({ diff --git a/app/components/Views/ActivityView/index.js b/app/components/Views/ActivityView/index.js index 777a69d6abe..9594308f3d1 100644 --- a/app/components/Views/ActivityView/index.js +++ b/app/components/Views/ActivityView/index.js @@ -14,7 +14,7 @@ import { useTheme } from '../../../util/theme'; import Routes from '../../../constants/navigation/Routes'; import { MetaMetricsEvents } from '../../../core/Analytics'; import { selectAccountsByChainId } from '../../../selectors/accountTrackerController'; -import { selectSelectedAddress } from '../../../selectors/preferencesController'; +import { selectSelectedInternalAccountChecksummedAddress } from '../../../selectors/accountsController'; import { useMetrics } from '../../../components/hooks/useMetrics'; const styles = StyleSheet.create({ @@ -27,7 +27,9 @@ const ActivityView = () => { const { colors } = useTheme(); const { trackEvent } = useMetrics(); const navigation = useNavigation(); - const selectedAddress = useSelector(selectSelectedAddress); + const selectedAddress = useSelector( + selectSelectedInternalAccountChecksummedAddress, + ); const hasOrders = useSelector((state) => getHasOrders(state) || false); const accountsByChainId = useSelector(selectAccountsByChainId); diff --git a/app/components/Views/AddAccountActions/AddAccountActions.tsx b/app/components/Views/AddAccountActions/AddAccountActions.tsx index 51dfea1b41e..bc94ae631c9 100644 --- a/app/components/Views/AddAccountActions/AddAccountActions.tsx +++ b/app/components/Views/AddAccountActions/AddAccountActions.tsx @@ -43,6 +43,8 @@ const AddAccountActions = ({ onBack }: AddAccountActionsProps) => { const addedAccountAddress = await KeyringController.addNewAccount(); Engine.setSelectedAddress(addedAccountAddress); trackEvent(MetaMetricsEvents.ACCOUNTS_ADDED_NEW_ACCOUNT, {}); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (e: any) { Logger.error(e, 'error while trying to add a new account'); } finally { diff --git a/app/components/Views/AddAsset/AddAsset.test.tsx b/app/components/Views/AddAsset/AddAsset.test.tsx index a81b1568ece..3a2241e15fe 100644 --- a/app/components/Views/AddAsset/AddAsset.test.tsx +++ b/app/components/Views/AddAsset/AddAsset.test.tsx @@ -3,6 +3,7 @@ import renderWithProvider from '../../../util/test/renderWithProvider'; import initialBackgroundState from '../../../util/test/initial-background-state.json'; import AddAsset from './AddAsset'; import { AddAssetViewSelectorsIDs } from '../../../../e2e/selectors/AddAssetView.selectors'; +import { MOCK_ACCOUNTS_CONTROLLER_STATE } from '../../../util/test/accountsControllerTestUtils'; const mockNavigate = jest.fn(); const mockSetOptions = jest.fn(); @@ -42,7 +43,10 @@ jest.mock('react-native-scrollable-tab-view', () => { const initialState = { engine: { - backgroundState: initialBackgroundState, + backgroundState: { + ...initialBackgroundState, + AccountsController: MOCK_ACCOUNTS_CONTROLLER_STATE, + }, }, }; diff --git a/app/components/Views/AddAsset/__snapshots__/AddAsset.test.tsx.snap b/app/components/Views/AddAsset/__snapshots__/AddAsset.test.tsx.snap index 847be6ab267..36f43f06e59 100644 --- a/app/components/Views/AddAsset/__snapshots__/AddAsset.test.tsx.snap +++ b/app/components/Views/AddAsset/__snapshots__/AddAsset.test.tsx.snap @@ -4,7 +4,7 @@ exports[`AddAsset component renders correctly 1`] = ` }, qrCode: { padding: 8, - backgroundColor: theme.brandColors.white000, + backgroundColor: theme.brandColors.white, }, addressWrapper: { alignItems: 'center', @@ -175,7 +175,7 @@ class AddressQRCode extends PureComponent { } const mapStateToProps = (state) => ({ - selectedAddress: selectSelectedAddress(state), + selectedAddress: selectSelectedInternalAccountChecksummedAddress(state), seedphraseBackedUp: state.user.seedphraseBackedUp, }); diff --git a/app/components/Views/AesCryptoTestForm/AesCryptoTestForm.test.tsx b/app/components/Views/AesCryptoTestForm/AesCryptoTestForm.test.tsx new file mode 100644 index 00000000000..162bb706cea --- /dev/null +++ b/app/components/Views/AesCryptoTestForm/AesCryptoTestForm.test.tsx @@ -0,0 +1,24 @@ +import React from 'react'; +import { render } from '@testing-library/react-native'; + +import AesCryptoTestForm from './AesCryptoTestForm'; + +jest.mock('@react-navigation/native', () => { + const actualReactNavigation = jest.requireActual('@react-navigation/native'); + return { + ...actualReactNavigation, + useNavigation: () => ({ + navigate: jest.fn(), + setOptions: jest.fn(), + goBack: jest.fn(), + }), + }; +}); + +describe('AesCryptoTestForm', () => { + it('renders correctly', () => { + const wrapper = render(); + + expect(wrapper).toMatchSnapshot(); + }); +}); diff --git a/app/components/Views/AesCryptoTestForm/AesCryptoTestForm.tsx b/app/components/Views/AesCryptoTestForm/AesCryptoTestForm.tsx new file mode 100644 index 00000000000..c2217f4e5a3 --- /dev/null +++ b/app/components/Views/AesCryptoTestForm/AesCryptoTestForm.tsx @@ -0,0 +1,242 @@ +import React, { useState, useEffect, useCallback } from 'react'; +import { SafeAreaView, ScrollView } from 'react-native'; +import { useNavigation } from '@react-navigation/native'; + +import { + Encryptor, + ENCRYPTION_LIBRARY, + DERIVATION_OPTIONS_DEFAULT_OWASP2023, +} from '../../../core/Encryptor'; +import { useTheme } from '../../../util/theme'; + +import { getNavigationOptionsTitle } from '../../UI/Navbar'; +import { strings } from '../../../../locales/i18n'; + +import TestForm from './Form'; +import createStyles from './styles'; +import { + aesCryptoFormInputs, + aesCryptoFormResponses, + aesCryptoFormButtons, + aesCryptoFormScrollIdentifier, +} from '../../../../e2e/selectors/AesCrypto.selectors'; + +const AesCryptoTestForm = () => { + const navigation = useNavigation(); + const theme = useTheme(); + const { colors } = theme; + const styles = createStyles(colors); + + const [encryptor, setEncryptor] = useState(); + + const [passwordEncryptedData, setPasswordEncryptedData] = + useState(''); + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const [keyEncryptedData, setKeyEncryptedData] = useState(); + + useEffect(() => { + const encryptorInstance = new Encryptor({ + keyDerivationOptions: DERIVATION_OPTIONS_DEFAULT_OWASP2023, + }); + setEncryptor(encryptorInstance); + }, []); + + useEffect(() => { + navigation.setOptions( + getNavigationOptionsTitle( + strings('app_settings.aes_crypto_test_form_title'), + navigation, + false, + colors, + null, + ), + ); + }, [colors, navigation]); + + const generateSalt = useCallback( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any + async (args: any[]) => await encryptor?.generateSalt(args[0]), + [encryptor], + ); + + const generateEncryptionKey = useCallback( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any + async (args: any[]) => { + const response = await encryptor?.keyFromPassword(args[0], args[1]); + return response?.key; + }, + [encryptor], + ); + + const encrypt = useCallback( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any + async (args: any[]) => { + const response = await encryptor?.encrypt(args[1], args[0]); + if (!response) { + throw new Error('Encryption failed'); + } + + setPasswordEncryptedData(response); + return JSON.parse(response).cipher; + }, + [encryptor], + ); + + const decrypt = useCallback( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any + async (args: any[]) => { + const response = await encryptor?.decrypt(args[0], passwordEncryptedData); + return response; + }, + [encryptor, passwordEncryptedData], + ); + + const encryptWithKey = useCallback( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any + async (args: any[]) => { + const response = await encryptor?.encryptWithKey( + { + key: args[0], + lib: ENCRYPTION_LIBRARY.original, + exportable: false, + keyMetadata: DERIVATION_OPTIONS_DEFAULT_OWASP2023, + }, + args[1], + ); + setKeyEncryptedData(response); + return response?.cipher; + }, + [encryptor], + ); + + const decryptWithKey = useCallback( + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any + async (args: any[]) => { + const response = await encryptor?.decryptWithKey( + { + key: args[0], + lib: ENCRYPTION_LIBRARY.original, + exportable: false, + keyMetadata: DERIVATION_OPTIONS_DEFAULT_OWASP2023, + }, + keyEncryptedData, + ); + return response; + }, + [encryptor, keyEncryptedData], + ); + + return ( + + + + + + + + + + + ); +}; + +export default AesCryptoTestForm; diff --git a/app/components/Views/AesCryptoTestForm/Clipboard.test.tsx b/app/components/Views/AesCryptoTestForm/Clipboard.test.tsx new file mode 100644 index 00000000000..19695b71a97 --- /dev/null +++ b/app/components/Views/AesCryptoTestForm/Clipboard.test.tsx @@ -0,0 +1,18 @@ +import React from 'react'; +import { render } from '@testing-library/react-native'; + +import ClipboardText from './Clipboard'; + +describe('ClipboardText', () => { + it('renders correctly', () => { + const wrapper = render( + , + ); + + expect(wrapper).toMatchSnapshot(); + }); +}); diff --git a/app/components/Views/AesCryptoTestForm/Clipboard.tsx b/app/components/Views/AesCryptoTestForm/Clipboard.tsx new file mode 100644 index 00000000000..09afd78ddd6 --- /dev/null +++ b/app/components/Views/AesCryptoTestForm/Clipboard.tsx @@ -0,0 +1,35 @@ +import React, { useCallback } from 'react'; +import { TouchableOpacity } from 'react-native'; + +import ClipboardManager from '../../../core/ClipboardManager'; +import Text, { + TextVariant, +} from '../../../component-library/components/Texts/Text'; + +const ClipboardText = ({ + text, + testID, + styles, +}: { + text: string; + testID: string; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any + styles: any; +}) => { + const copy = useCallback(async () => { + await ClipboardManager.setString(text); + }, [text]); + + return ( + + {text} + + ); +}; + +export default ClipboardText; diff --git a/app/components/Views/AesCryptoTestForm/Form.test.tsx b/app/components/Views/AesCryptoTestForm/Form.test.tsx new file mode 100644 index 00000000000..210a6b6a3b5 --- /dev/null +++ b/app/components/Views/AesCryptoTestForm/Form.test.tsx @@ -0,0 +1,31 @@ +import React from 'react'; +import { render } from '@testing-library/react-native'; + +import TestForm from './Form'; + +describe('TestForm', () => { + it('renders correctly', () => { + const wrapper = render( + jest.fn()} + callbackTestId={'random-callback-test-id'} + responseTestId={'random-response-test-id'} + styles={{ + container: {}, + title: {}, + textFieldsContainer: {}, + textField: {}, + button: {}, + response: {}, + }} + />, + ); + + expect(wrapper).toMatchSnapshot(); + }); +}); diff --git a/app/components/Views/AesCryptoTestForm/Form.tsx b/app/components/Views/AesCryptoTestForm/Form.tsx new file mode 100644 index 00000000000..0e77e597a36 --- /dev/null +++ b/app/components/Views/AesCryptoTestForm/Form.tsx @@ -0,0 +1,102 @@ +import React, { useState, useEffect, useCallback } from 'react'; +import { View, SafeAreaView, Keyboard, TextInput } from 'react-native'; + +import Text, { + TextVariant, +} from '../../../component-library/components/Texts/Text'; +import Button, { + ButtonSize, + ButtonVariants, +} from '../../../component-library/components/Buttons/Button'; +import ClipboardText from './Clipboard'; + +const TestForm = ({ + title, + textFields, + buttonLabel, + callback, + callbackTestId, + responseTestId, + styles, +}: { + title: string; + textFields: { + placeholder: string; + testId: string; + }[]; + buttonLabel: string; + callback: // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any + | ((...args: any[]) => Promise) + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any + | ((...args: any[]) => unknown); + callbackTestId: string; + responseTestId: string; + // TODO: Replace "any" with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any + styles: any; +}) => { + const [result, setResult] = useState(''); + const [args, setArgs] = useState([]); + + useEffect(() => { + setArgs(new Array(textFields.length).fill('')); + }, [textFields]); + + const handleInputChange = useCallback( + (index: number, value: string) => { + const newArgs = [...args]; + newArgs[index] = value; + setArgs(newArgs); + }, + [args], + ); + + const executeTest = useCallback(async () => { + const response = (await callback(args)) as string; + setResult(response); + Keyboard.dismiss(); + }, [callback, args]); + + return ( + + + {title} + + {textFields.map((textField, index) => ( + + handleInputChange(index, value)} + testID={textField.testId} + autoFocus={false} + style={styles.textInput} + /> + + ))} + {result && ( + <> + Response + + + )} +