Skip to content

Commit 304df29

Browse files
authored
Merge branch 'main' into feat/ramp-non-evm-balance
2 parents f3d3fba + 51728eb commit 304df29

File tree

73 files changed

+2435
-841
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2435
-841
lines changed

.github/CODEOWNERS

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ app/reducers/fiatOrders/ @MetaMask/ramp
3535

3636
# Confirmation Team
3737
app/components/Views/confirmations @MetaMask/confirmations
38+
app/core/Engine/controllers/transaction-controller @MetaMask/confirmations
3839
ppom @MetaMask/confirmations
3940

4041
# All below files are maintained by the SDK team because they contain SDK related code, WalletConnect integrations, or critical SDK flows.
@@ -87,6 +88,9 @@ app/core/Engine/controllers/TokenSearchDiscoveryController @MetaMask/portfolio
8788
**/snaps/** @MetaMask/snaps-devs
8889
**/Snaps/** @MetaMask/snaps-devs
8990

91+
# Co-owned by Confirmations team and Snaps team
92+
app/components/UI/TemplateRenderer @MetaMask/confirmations @MetaMask/snaps-devs
93+
9094
# Wallet API Platform Team
9195
app/core/RPCMethods/ @MetaMask/wallet-api-platform-engineers
9296

app/component-library/components-temp/Buttons/ButtonPill/ButtonPill.styles.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const styleSheet = (params: {
2626
}) => {
2727
const {
2828
theme: { colors },
29-
vars: { isDisabled, isPressed }
29+
vars: { isPressed }
3030
} = params;
3131

3232
return StyleSheet.create({
@@ -38,7 +38,6 @@ const styleSheet = (params: {
3838
paddingHorizontal: 8,
3939
paddingVertical: 4,
4040
borderRadius: 99,
41-
opacity: isDisabled ? 0.5 : 1,
4241
...(isPressed && {
4342
backgroundColor: colors.background.alternativePressed,
4443
}),

app/component-library/components-temp/Buttons/ButtonPill/__snapshots__/ButtonPill.test.tsx.snap

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ exports[`ButtonPill should render correctly 1`] = `
1515
"borderRadius": 99,
1616
"color": "#141618",
1717
"justifyContent": "center",
18-
"opacity": 1,
1918
"paddingHorizontal": 8,
2019
"paddingVertical": 4,
2120
}

app/components/Approvals/InstallSnapApproval/components/InstallSnapConnectionRequest/InstallSnapConnectionRequest.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
SNAP_INSTALL_CONNECTION_REQUEST,
2727
} from './InstallSnapConnectionRequest.constants';
2828
import { useFavicon } from '../../../../hooks/useFavicon';
29-
import { SnapAvatar } from '../../../../UI/Snaps/SnapAvatar/SnapAvatar';
29+
import { SnapAvatar } from '../../../../Snaps/SnapAvatar/SnapAvatar';
3030

3131
const InstallSnapConnectionRequest = ({
3232
approvalRequest,

app/components/Nav/Main/RootRPCMethodsUI.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ import { updateSwapsTransaction } from '../../../util/swaps/swaps-transactions';
7474
///: BEGIN:ONLY_INCLUDE_IF(preinstalled-snaps,external-snaps)
7575
import InstallSnapApproval from '../../Approvals/InstallSnapApproval';
7676
import { getGlobalEthQuery } from '../../../util/networks/global-network';
77-
import SnapDialogApproval from '../../Snaps/SnapDialogApproval/SnapsDialogApproval';
77+
import SnapDialogApproval from '../../Snaps/SnapDialogApproval/SnapDialogApproval';
7878
///: END:ONLY_INCLUDE_IF
7979
///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps)
8080
import SnapAccountCustomNameApproval from '../../Approvals/SnapAccountCustomNameApproval';

app/components/Nav/Main/index.js

+29-32
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ import {
8787
} from '../../../util/transaction-controller';
8888
import isNetworkUiRedesignEnabled from '../../../util/networks/isNetworkUiRedesignEnabled';
8989
import { useConnectionHandler } from '../../../util/navigation/useConnectionHandler';
90-
import { AssetPollingProvider } from '../../hooks/AssetPolling/AssetPollingProvider';
9190
import { getGlobalEthQuery } from '../../../util/networks/global-network';
9291
import { selectIsEvmNetworkSelected } from '../../../selectors/multichainNetworkController';
9392
import { isPortfolioViewEnabled } from '../../../util/networks';
@@ -415,37 +414,35 @@ const Main = (props) => {
415414

416415
return (
417416
<React.Fragment>
418-
<AssetPollingProvider>
419-
<View style={styles.flex}>
420-
{!forceReload ? (
421-
<MainNavigator navigation={props.navigation} />
422-
) : (
423-
renderLoader()
424-
)}
425-
<GlobalAlert />
426-
<FadeOutOverlay />
427-
<Notification navigation={props.navigation} />
428-
<RampOrders />
429-
<SwapsLiveness />
430-
<BackupAlert
431-
onDismiss={toggleRemindLater}
432-
navigation={props.navigation}
433-
/>
434-
{renderDeprecatedNetworkAlert(
435-
props.chainId,
436-
props.backUpSeedphraseVisible,
437-
)}
438-
<SkipAccountSecurityModal
439-
modalVisible={showRemindLaterModal}
440-
onCancel={skipAccountModalSecureNow}
441-
onConfirm={skipAccountModalSkip}
442-
skipCheckbox={skipCheckbox}
443-
toggleSkipCheckbox={toggleSkipCheckbox}
444-
/>
445-
<ProtectYourWalletModal navigation={props.navigation} />
446-
<RootRPCMethodsUI navigation={props.navigation} />
447-
</View>
448-
</AssetPollingProvider>
417+
<View style={styles.flex}>
418+
{!forceReload ? (
419+
<MainNavigator navigation={props.navigation} />
420+
) : (
421+
renderLoader()
422+
)}
423+
<GlobalAlert />
424+
<FadeOutOverlay />
425+
<Notification navigation={props.navigation} />
426+
<RampOrders />
427+
<SwapsLiveness />
428+
<BackupAlert
429+
onDismiss={toggleRemindLater}
430+
navigation={props.navigation}
431+
/>
432+
{renderDeprecatedNetworkAlert(
433+
props.chainId,
434+
props.backUpSeedphraseVisible,
435+
)}
436+
<SkipAccountSecurityModal
437+
modalVisible={showRemindLaterModal}
438+
onCancel={skipAccountModalSecureNow}
439+
onConfirm={skipAccountModalSkip}
440+
skipCheckbox={skipCheckbox}
441+
toggleSkipCheckbox={toggleSkipCheckbox}
442+
/>
443+
<ProtectYourWalletModal navigation={props.navigation} />
444+
<RootRPCMethodsUI navigation={props.navigation} />
445+
</View>
449446
</React.Fragment>
450447
);
451448
};

app/components/UI/Snaps/SnapAvatar/SnapAvatar.styles.ts app/components/Snaps/SnapAvatar/SnapAvatar.styles.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
///: BEGIN:ONLY_INCLUDE_IF(preinstalled-snaps,external-snaps)
22
import { StyleSheet } from 'react-native';
3-
import { Theme } from '../../../../util/theme/models';
3+
import { Theme } from '../../../util/theme/models';
44

55
/**
66
*

app/components/UI/Snaps/SnapAvatar/SnapAvatar.tsx app/components/Snaps/SnapAvatar/SnapAvatar.tsx

+11-11
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22
///: BEGIN:ONLY_INCLUDE_IF(preinstalled-snaps,external-snaps)
33
import React from 'react';
44
import { useSelector } from 'react-redux';
5-
import AvatarFavicon from '../../../../component-library/components/Avatars/Avatar/variants/AvatarFavicon';
6-
import { selectTargetSubjectMetadata } from '../../../../selectors/snaps/permissionController';
7-
import BadgeWrapper from '../../../../component-library/components/Badges/BadgeWrapper';
8-
import { BadgePosition } from '../../../../component-library/components/Badges/BadgeWrapper/BadgeWrapper.types';
9-
import AvatarIcon from '../../../../component-library/components/Avatars/Avatar/variants/AvatarIcon';
5+
import AvatarFavicon from '../../../component-library/components/Avatars/Avatar/variants/AvatarFavicon';
6+
import { selectTargetSubjectMetadata } from '../../../selectors/snaps/permissionController';
7+
import BadgeWrapper from '../../../component-library/components/Badges/BadgeWrapper';
8+
import { BadgePosition } from '../../../component-library/components/Badges/BadgeWrapper/BadgeWrapper.types';
9+
import AvatarIcon from '../../../component-library/components/Avatars/Avatar/variants/AvatarIcon';
1010
import {
1111
IconColor,
1212
IconName,
13-
} from '../../../..//component-library/components/Icons/Icon';
14-
import AvatarBase from '../../../../component-library/components/Avatars/Avatar/foundation/AvatarBase';
15-
import Text from '../../../../component-library/components/Texts/Text';
16-
import { useStyles } from '../../../../component-library/hooks';
13+
} from '../../../component-library/components/Icons/Icon';
14+
import AvatarBase from '../../../component-library/components/Avatars/Avatar/foundation/AvatarBase';
15+
import Text from '../../../component-library/components/Texts/Text';
16+
import { useStyles } from '../../../component-library/hooks';
1717
import styleSheet from './SnapAvatar.styles';
18-
import { RootState } from '../../../../reducers';
19-
import { AvatarSize } from '../../../../component-library/components/Avatars/Avatar';
18+
import { RootState } from '../../../reducers';
19+
import { AvatarSize } from '../../../component-library/components/Avatars/Avatar';
2020
import { ViewStyle } from 'react-native';
2121

2222
const getAvatarFallbackLetter = (subjectName: string) =>
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
///: BEGIN:ONLY_INCLUDE_IF(preinstalled-snaps)
2-
export { default } from './SnapsDialogApproval';
2+
export { default } from './SnapDialogApproval';
33
///: END:ONLY_INCLUDE_IF

app/components/UI/Snaps/SnapUIAddress/SnapUIAddress.test.tsx app/components/Snaps/SnapUIAddress/SnapUIAddress.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { SnapUIAddress } from './SnapUIAddress';
3-
import renderWithProvider from '../../../../util/test/renderWithProvider';
3+
import renderWithProvider from '../../../util/test/renderWithProvider';
44

55
const baseMockState = {
66
state: {

app/components/UI/Snaps/SnapUIAddress/SnapUIAddress.tsx app/components/Snaps/SnapUIAddress/SnapUIAddress.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import {
66
} from '@metamask/utils';
77
import { toChecksumHexAddress } from '@metamask/controller-utils';
88
import { SnapUIAvatar } from '../SnapUIAvatar/SnapUIAvatar';
9-
import { shortenString } from '../../../../util/notifications/methods';
9+
import { shortenString } from '../../../util/notifications/methods';
1010
import Text, {
1111
TextVariant,
12-
} from '../../../../component-library/components/Texts/Text';
13-
import { Box } from '../../Box/Box';
14-
import { AlignItems, FlexDirection } from '../../Box/box.types';
12+
} from '../../../component-library/components/Texts/Text';
13+
import { Box } from '../../UI/Box/Box';
14+
import { AlignItems, FlexDirection } from '../../UI/Box/box.types';
1515
import { useDisplayName } from './useDisplayName';
1616

1717
export interface SnapUIAddressProps {

app/components/UI/Snaps/SnapUIAddress/useDisplayName.ts app/components/Snaps/SnapUIAddress/useDisplayName.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import {
44
CaipNamespace,
55
} from '@metamask/utils';
66
import { useSelector } from 'react-redux';
7-
import { decimalToHex } from '../../../../util/conversions';
8-
import { RootState } from '../../../../reducers';
9-
import { selectInternalAccounts } from '../../../../selectors/accountsController';
10-
import { toLowerCaseEquals } from '../../../../util/general';
11-
import { selectAddressBookByChain } from '../../../../selectors/addressBookController';
7+
import { decimalToHex } from '../../../util/conversions';
8+
import { RootState } from '../../../reducers';
9+
import { selectInternalAccounts } from '../../../selectors/accountsController';
10+
import { toLowerCaseEquals } from '../../../util/general';
11+
import { selectAddressBookByChain } from '../../../selectors/addressBookController';
1212

1313
export interface UseDisplayNameParams {
1414
chain: {

app/components/UI/Snaps/SnapUIAvatar/SnapUIAvatar.tsx app/components/Snaps/SnapUIAvatar/SnapUIAvatar.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import {
1010
} from '@metamask/utils';
1111
import { Image } from 'react-native';
1212
import Jazzicon from 'react-native-jazzicon';
13-
import { toDataUrl } from '../../../../util/blockies';
14-
import { RootState } from '../../../../reducers';
13+
import { toDataUrl } from '../../../util/blockies';
14+
import { RootState } from '../../../reducers';
1515

1616
export const DIAMETERS: Record<string, number> = {
1717
xs: 16,

app/components/Snaps/SnapUICard/SnapUICard.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Text, {
44
TextColor,
55
TextVariant,
66
} from '../../../component-library/components/Texts/Text';
7-
import { SnapUIImage } from '../../UI/Snaps/SnapUIImage/SnapUIImage';
7+
import { SnapUIImage } from '../SnapUIImage/SnapUIImage';
88
import {
99
FlexDirection,
1010
TextAlign,

app/components/UI/Snaps/SnapUIInput/SnapUIInput.test.tsx app/components/Snaps/SnapUIInput/SnapUIInput.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React from 'react';
22
import { render, fireEvent } from '@testing-library/react-native';
33
import { SnapUIInput } from './SnapUIInput';
4-
import { useSnapInterfaceContext } from '../../../Snaps/SnapInterfaceContext';
4+
import { useSnapInterfaceContext } from '../SnapInterfaceContext';
55

66
// Mock the entire module
7-
jest.mock('../../../Snaps/SnapInterfaceContext');
7+
jest.mock('../SnapInterfaceContext');
88

99
describe('SnapUIInput', () => {
1010
const mockHandleInputChange = jest.fn();

app/components/UI/Snaps/SnapUIInput/SnapUIInput.tsx app/components/Snaps/SnapUIInput/SnapUIInput.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import React, { useEffect, useRef, useState } from 'react';
2-
import { useSnapInterfaceContext } from '../../../Snaps/SnapInterfaceContext';
2+
import { useSnapInterfaceContext } from '../SnapInterfaceContext';
33
import { TextInput, ViewStyle } from 'react-native';
44
import TextField, {
55
TextFieldSize,
6-
} from '../../../../component-library/components/Form/TextField';
6+
} from '../../../component-library/components/Form/TextField';
77
import HelpText, {
88
HelpTextSeverity,
9-
} from '../../../../component-library/components/Form/HelpText';
10-
import Label from '../../../../component-library/components/Form/Label';
11-
import { Box } from '../../Box/Box';
12-
import { TextVariant } from '../../../../component-library/components/Texts/Text';
9+
} from '../../../component-library/components/Form/HelpText';
10+
import Label from '../../../component-library/components/Form/Label';
11+
import { Box } from '../../UI/Box/Box';
12+
import { TextVariant } from '../../../component-library/components/Texts/Text';
1313

1414
export interface SnapUIInputProps {
1515
name: string;

app/components/UI/Snaps/SnapUILink/SnapUILink.test.tsx app/components/Snaps/SnapUILink/SnapUILink.test.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import React from 'react';
22
import { render, fireEvent } from '@testing-library/react-native';
33
import { Linking } from 'react-native';
44
import { SnapUILink } from './SnapUILink';
5-
import ButtonLink from '../../../../component-library/components/Buttons/Button/variants/ButtonLink';
5+
import ButtonLink from '../../../component-library/components/Buttons/Button/variants/ButtonLink';
66
import Icon, {
77
IconColor,
88
IconName,
99
IconSize,
10-
} from '../../../../component-library/components/Icons/Icon';
11-
import { TextColor } from '../../../../component-library/components/Texts/Text';
10+
} from '../../../component-library/components/Icons/Icon';
11+
import { TextColor } from '../../../component-library/components/Texts/Text';
1212

1313
jest.mock('react-native/Libraries/Linking/Linking', () => ({
1414
openURL: jest.fn(),

app/components/UI/Snaps/SnapUILink/SnapUILink.tsx app/components/Snaps/SnapUILink/SnapUILink.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
import { LinkChildren } from '@metamask/snaps-sdk/jsx';
33
import React from 'react';
44
import { Linking } from 'react-native';
5-
import ButtonLink from '../../../../component-library/components/Buttons/Button/variants/ButtonLink';
6-
import { TextColor } from '../../../../component-library/components/Texts/Text';
5+
import ButtonLink from '../../../component-library/components/Buttons/Button/variants/ButtonLink';
6+
import { TextColor } from '../../../component-library/components/Texts/Text';
77
import Icon, {
88
IconColor,
99
IconName,
1010
IconSize,
11-
} from '../../../../component-library/components/Icons/Icon';
11+
} from '../../../component-library/components/Icons/Icon';
1212

1313
export interface SnapUILinkProps {
1414
children: LinkChildren;

app/components/Snaps/SnapUIRenderer/components/footer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { FooterElement, ButtonElement } from '@metamask/snaps-sdk/jsx';
22
import { getJsxChildren } from '@metamask/snaps-utils';
33
import { UIComponent, UIComponentFactory, UIComponentParams } from './types';
44
import { button as buttonFn } from './button';
5-
import { TemplateConfirmation } from '../../SnapDialogApproval/SnapsDialogApproval';
5+
import { TemplateConfirmation } from '../../SnapDialogApproval/SnapDialogApproval';
66
import { ButtonVariants } from '../../../../component-library/components/Buttons/Button';
77

88
export const DEFAULT_FOOTER = {

app/components/Snaps/SnapUIRenderer/components/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { section } from './section';
1919
import { spinner } from './spinner';
2020
import { address } from './address';
2121
import { avatar } from './avatar';
22+
import { tooltip } from './tooltip';
2223

2324
export const COMPONENT_MAPPING = {
2425
Box: box,
@@ -42,4 +43,5 @@ export const COMPONENT_MAPPING = {
4243
Spinner: spinner,
4344
Avatar: avatar,
4445
Address: address,
46+
Tooltip: tooltip,
4547
};

0 commit comments

Comments
 (0)