diff --git a/ui/components/institutional/custody-confirm-link-modal/__snapshots__/custody-confirm-link-modal.test.js.snap b/ui/components/institutional/custody-confirm-link-modal/__snapshots__/custody-confirm-link-modal.test.js.snap
deleted file mode 100644
index def7aa038dc7..000000000000
--- a/ui/components/institutional/custody-confirm-link-modal/__snapshots__/custody-confirm-link-modal.test.js.snap
+++ /dev/null
@@ -1,40 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`Custody Confirm Link should match snapshot 1`] = `
-
-
-
-
- >
-
-
-
- Awaiting approval...
-
-
- Approve the transaction in the Saturn Custody app. Once all required custody approvals have been performed the transaction will complete. Check your Saturn Custody app for status.
-
-
- Close
-
-
-
-`;
diff --git a/ui/components/institutional/custody-confirm-link-modal/custody-confirm-link-modal.js b/ui/components/institutional/custody-confirm-link-modal/custody-confirm-link-modal.js
index f98b16dda895..e7d0c4d5bc90 100644
--- a/ui/components/institutional/custody-confirm-link-modal/custody-confirm-link-modal.js
+++ b/ui/components/institutional/custody-confirm-link-modal/custody-confirm-link-modal.js
@@ -1,4 +1,5 @@
import React, { useContext } from 'react';
+import PropTypes from 'prop-types';
import { useSelector, useDispatch } from 'react-redux';
import { MetaMetricsContext } from '../../../contexts/metametrics';
import {
@@ -9,28 +10,34 @@ import { useI18nContext } from '../../../hooks/useI18nContext';
import withModalProps from '../../../helpers/higher-order-components/with-modal-props';
import { toChecksumHexAddress } from '../../../../shared/modules/hexstring-utils';
import { mmiActionsFactory } from '../../../store/institutional/institution-background';
-import { hideModal, setSelectedAddress } from '../../../store/actions';
+import { setSelectedAddress } from '../../../store/actions';
import { getMetaMaskAccountsRaw } from '../../../selectors';
import {
getMMIAddressFromModalOrAddress,
getCustodyAccountDetails,
getMMIConfiguration,
} from '../../../selectors/institutional/selectors';
-import Box from '../../ui/box/box';
import {
AlignItems,
- DISPLAY,
- FLEX_DIRECTION,
- FontWeight,
+ Display,
+ FlexDirection,
JustifyContent,
TextAlign,
TextColor,
TextVariant,
} from '../../../helpers/constants/design-system';
-import { Button, BUTTON_VARIANT } from '../../component-library';
-import { Text } from '../../component-library/text/deprecated';
+import {
+ Button,
+ BUTTON_VARIANT,
+ Modal,
+ ModalHeader,
+ ModalContent,
+ ModalOverlay,
+ Text,
+ Box,
+} from '../../component-library';
-const CustodyConfirmLink = () => {
+const CustodyConfirmLink = ({ hideModal }) => {
const t = useI18nContext();
const dispatch = useDispatch();
const mmiActions = mmiActionsFactory();
@@ -70,67 +77,70 @@ const CustodyConfirmLink = () => {
};
return (
-
- {iconUrl ? (
-
-
- {'>'}
-
-
- ) : (
-
- {custodianName}
+
+
+
+ {t('awaitingApproval')}
+
+ {iconUrl ? (
+
+
+ {'>'}
+
+
+ ) : (
+
+ {custodianName}
+
+ )}
+
+ {text || t('custodyDeeplinkDescription', [displayName])}
+
+
+ {action ||
+ (action ? t('openCustodianApp', [displayName]) : t('close'))}
+
- )}
-
- {t('awaitingApproval')}
-
-
- {text || t('custodyDeeplinkDescription', [displayName])}
-
-
- {action || (action ? t('openCustodianApp', [displayName]) : t('close'))}
-
-
+
+
);
};
+CustodyConfirmLink.propTypes = {
+ hideModal: PropTypes.func.isRequired,
+};
+
export default withModalProps(CustodyConfirmLink);
diff --git a/ui/components/institutional/custody-confirm-link-modal/custody-confirm-link-modal.test.js b/ui/components/institutional/custody-confirm-link-modal/custody-confirm-link-modal.test.js
index a82ec72838fa..35c21d0e376d 100644
--- a/ui/components/institutional/custody-confirm-link-modal/custody-confirm-link-modal.test.js
+++ b/ui/components/institutional/custody-confirm-link-modal/custody-confirm-link-modal.test.js
@@ -81,8 +81,8 @@ describe('Custody Confirm Link', () => {
it('tries to open new tab with deeplink URL', () => {
global.platform = { openTab: jest.fn() };
- const { getByRole } = renderWithProvider( , store);
- fireEvent.click(getByRole('button'));
+ const { getByTestId } = renderWithProvider( , store);
+ fireEvent.click(getByTestId('custody-confirm-link__btn'));
expect(global.platform.openTab).toHaveBeenCalledWith({
url: 'test-url',
});
@@ -90,12 +90,6 @@ describe('Custody Confirm Link', () => {
expect(hideModal).toHaveBeenCalledTimes(1);
});
- it('should match snapshot', () => {
- const { container } = renderWithProvider( , store);
-
- expect(container).toMatchSnapshot();
- });
-
it('shows custodian name when iconUrl is undefined', () => {
const customMockStore = {
...mockStore,
diff --git a/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.js b/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.js
index d9e1e98ce0fd..232f4817f5f8 100644
--- a/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.js
+++ b/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.js
@@ -12,8 +12,8 @@ import {
ModalContent,
ModalHeader,
ModalOverlay,
+ Text,
} from '../../component-library';
-import { Text } from '../../component-library/text/deprecated';
import {
BlockSize,
diff --git a/ui/components/institutional/transaction-failed-modal/index.js b/ui/components/institutional/transaction-failed-modal/index.js
index 2f120e8253b0..4bbc214c2e11 100644
--- a/ui/components/institutional/transaction-failed-modal/index.js
+++ b/ui/components/institutional/transaction-failed-modal/index.js
@@ -1 +1 @@
-export { default } from './transaction-failed';
+export { default } from './transaction-failed-modal';
diff --git a/ui/components/institutional/transaction-failed-modal/transaction-failed-modal.js b/ui/components/institutional/transaction-failed-modal/transaction-failed-modal.js
new file mode 100644
index 000000000000..2f4e9f48f541
--- /dev/null
+++ b/ui/components/institutional/transaction-failed-modal/transaction-failed-modal.js
@@ -0,0 +1,99 @@
+import React, { memo } from 'react';
+import PropTypes from 'prop-types';
+import withModalProps from '../../../helpers/higher-order-components/with-modal-props';
+import { useI18nContext } from '../../../hooks/useI18nContext';
+import {
+ AlignItems,
+ BorderRadius,
+ Display,
+ FlexDirection,
+ TextAlign,
+ TextVariant,
+} from '../../../helpers/constants/design-system';
+import {
+ Icon,
+ IconName,
+ IconSize,
+ Text,
+ Box,
+ Modal,
+ ModalContent,
+ ModalHeader,
+ ModalOverlay,
+ Button,
+ BUTTON_VARIANT,
+ BUTTON_SIZES,
+} from '../../component-library';
+
+const TransactionFailedModal = ({
+ hideModal,
+ closeNotification,
+ operationFailed,
+ errorMessage,
+}) => {
+ const t = useI18nContext();
+
+ const handleSubmit = () => {
+ if (closeNotification) {
+ global.platform.closeCurrentWindow();
+ }
+ hideModal();
+ };
+
+ return (
+
+
+
+
+ {operationFailed
+ ? `${t('operationFailed')}!`
+ : `${t('transactionFailed')}!`}
+
+
+
+
+ {errorMessage}
+
+
+
+
+ {t('ok')}
+
+
+
+
+ );
+};
+
+TransactionFailedModal.propTypes = {
+ hideModal: PropTypes.func,
+ errorMessage: PropTypes.string,
+ closeNotification: PropTypes.bool,
+ operationFailed: PropTypes.bool,
+};
+
+export default withModalProps(memo(TransactionFailedModal));
diff --git a/ui/components/institutional/transaction-failed-modal/transaction-failed.stories.js b/ui/components/institutional/transaction-failed-modal/transaction-failed-modal.stories.js
similarity index 100%
rename from ui/components/institutional/transaction-failed-modal/transaction-failed.stories.js
rename to ui/components/institutional/transaction-failed-modal/transaction-failed-modal.stories.js
diff --git a/ui/components/institutional/transaction-failed-modal/transaction-failed.test.js b/ui/components/institutional/transaction-failed-modal/transaction-failed-modal.test.js
similarity index 100%
rename from ui/components/institutional/transaction-failed-modal/transaction-failed.test.js
rename to ui/components/institutional/transaction-failed-modal/transaction-failed-modal.test.js
diff --git a/ui/components/institutional/transaction-failed-modal/transaction-failed.js b/ui/components/institutional/transaction-failed-modal/transaction-failed.js
deleted file mode 100644
index 8c4188794e5d..000000000000
--- a/ui/components/institutional/transaction-failed-modal/transaction-failed.js
+++ /dev/null
@@ -1,80 +0,0 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-import withModalProps from '../../../helpers/higher-order-components/with-modal-props';
-import { useI18nContext } from '../../../hooks/useI18nContext';
-import Modal from '../../app/modal';
-import Box from '../../ui/box/box';
-import {
- AlignItems,
- BorderRadius,
- DISPLAY,
- FLEX_DIRECTION,
- FontWeight,
- TextAlign,
- TextVariant,
-} from '../../../helpers/constants/design-system';
-import { Icon, IconName, IconSize } from '../../component-library';
-import { Text } from '../../component-library/text/deprecated';
-
-const TransactionFailedModal = ({
- hideModal,
- closeNotification,
- operationFailed,
- errorMessage,
-}) => {
- const t = useI18nContext();
- const handleSubmit = () => {
- if (closeNotification) {
- global.platform.closeCurrentWindow();
- }
- hideModal();
- };
-
- return (
-
-
-
-
- {operationFailed
- ? `${t('operationFailed')}!`
- : `${t('transactionFailed')}!`}
-
-
- {errorMessage}
-
-
-
- );
-};
-
-TransactionFailedModal.propTypes = {
- hideModal: PropTypes.func,
- errorMessage: PropTypes.string,
- closeNotification: PropTypes.bool,
- operationFailed: PropTypes.bool,
-};
-
-export default withModalProps(TransactionFailedModal);