-
-
- >
- );
-
return (
-
setIsImportTokenModalOpen(false)}
- footer={ImportTokenModalFooter}
- >
- setIsImportTokenModalOpen(false)}>
+
+
+ setIsImportTokenModalOpen(false)}
+ width={BlockSize.Full}
+ >
+ {t('importTokenQuestion')}
+
-
-
+
{tokenForImport.name || ''}
-
- {t('contract')}:
-
-
+
- {tokenForImport.address || ''}
-
-
-
+
+
+
+
+
);
}
@@ -94,4 +105,5 @@ ImportToken.propTypes = {
onImportTokenClick: PropTypes.func,
setIsImportTokenModalOpen: PropTypes.func,
tokenForImport: PropTypes.object,
+ isOpen: PropTypes.bool,
};
diff --git a/ui/pages/swaps/import-token/import-token.stories.js b/ui/pages/swaps/import-token/import-token.stories.js
index 462f9029b..4246de19f 100644
--- a/ui/pages/swaps/import-token/import-token.stories.js
+++ b/ui/pages/swaps/import-token/import-token.stories.js
@@ -1,24 +1,26 @@
import React from 'react';
-import { action } from '@storybook/addon-actions';
import ImportToken from './import-token';
export default {
title: 'Pages/Swaps/ImportToken',
+ argTypes: {
+ onImportTokenClick: { action: 'Token Imported' },
+ isOpen: { control: 'boolean' },
+ tokenForImport: {
+ control: 'object',
+ },
+ },
+ args: {
+ isOpen: true,
+ tokenForImport: {
+ iconUrl: './BAT_icon.svg',
+ name: 'Basic Attention Token',
+ symbol: 'BAT',
+ address: '0x0d8775f648430679a709e98d2b0cb6250d2887ef',
+ },
+ },
};
-export const DefaultStory = () => {
- const data = {
- iconUrl: './BAT_icon.svg',
- name: 'Basic Attention Token',
- symbol: 'BAT',
- address: '0x0d8775f648430679a709e98d2b0cb6250d2887ef',
- };
- return (
-
- );
-};
+export const DefaultStory = (args) =>
;
DefaultStory.storyName = 'Default';
diff --git a/ui/pages/swaps/import-token/import-token.test.js b/ui/pages/swaps/import-token/import-token.test.js
index 24616bdf9..ee3d74ff4 100644
--- a/ui/pages/swaps/import-token/import-token.test.js
+++ b/ui/pages/swaps/import-token/import-token.test.js
@@ -13,6 +13,7 @@ const createProps = (customProps = {}) => {
name: 'PoSToken',
address: '0xee609fe292128cad03b786dbb9bc2634ccdbe7fc',
},
+ isOpen: true,
...customProps,
};
};
@@ -20,8 +21,10 @@ const createProps = (customProps = {}) => {
describe('ImportToken', () => {
it('renders the component with initial props', () => {
const props = createProps();
- const { getByText } = renderWithProvider(
);
+ const { getByText, getByDisplayValue } = renderWithProvider(
+
,
+ );
expect(getByText(props.tokenForImport.name)).toBeInTheDocument();
- expect(getByText(props.tokenForImport.address)).toBeInTheDocument();
+ expect(getByDisplayValue(props.tokenForImport.address)).toBeInTheDocument();
});
});
diff --git a/ui/pages/swaps/import-token/index.scss b/ui/pages/swaps/import-token/index.scss
deleted file mode 100644
index e10106e4b..000000000
--- a/ui/pages/swaps/import-token/index.scss
+++ /dev/null
@@ -1,26 +0,0 @@
-.import-token {
- flex-direction: column;
-
- .actionable-message {
- margin-top: 0;
-
- &__message {
- color: var(--color-text-default);
- text-align: left;
- }
- }
-
- &__contract-address {
- border-radius: 8px;
- background-color: var(--color-background-alternative);
- padding: 5px 10px;
- font-size: 0.75rem;
- }
-
- &__token-icon {
- font-size: $font-size-h2;
- margin-top: 24px;
- width: 69px;
- height: 69px;
- }
-}
diff --git a/ui/pages/swaps/index.scss b/ui/pages/swaps/index.scss
index 83d0cdc7c..d64be3b41 100644
--- a/ui/pages/swaps/index.scss
+++ b/ui/pages/swaps/index.scss
@@ -16,7 +16,6 @@
@import 'slippage-buttons/index';
@import 'swaps-footer/index';
@import 'view-quote/index';
-@import 'import-token/index';
@import 'create-new-swap/index';
@import 'view-on-block-explorer/index';
@import 'transaction-settings/index';
diff --git a/ui/pages/swaps/prepare-swap-page/prepare-swap-page.js b/ui/pages/swaps/prepare-swap-page/prepare-swap-page.js
index aeaa823ca..8b59ffee7 100644
--- a/ui/pages/swaps/prepare-swap-page/prepare-swap-page.js
+++ b/ui/pages/swaps/prepare-swap-page/prepare-swap-page.js
@@ -776,7 +776,7 @@ export default function PrepareSwapPage({
{tokenForImport && isImportTokenModalOpen && (
-
+
)}