diff --git a/app/images/eth_badge.svg b/app/images/eth_badge.svg new file mode 100644 index 000000000..90063426f --- /dev/null +++ b/app/images/eth_badge.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/ui/components/app/app-components.scss b/ui/components/app/app-components.scss index 714c579fe..77574fb3e 100644 --- a/ui/components/app/app-components.scss +++ b/ui/components/app/app-components.scss @@ -95,3 +95,4 @@ @import 'detected-token/detected-token-details/index'; @import 'detected-token/detected-token-ignored-popover/index'; @import 'detected-token/detected-token-selection-popover/index'; +@import 'network-account-balance-header/index'; diff --git a/ui/components/app/network-account-balance-header/index.js b/ui/components/app/network-account-balance-header/index.js new file mode 100644 index 000000000..e813b7f29 --- /dev/null +++ b/ui/components/app/network-account-balance-header/index.js @@ -0,0 +1 @@ +export { default } from './network-account-balance-header'; diff --git a/ui/components/app/network-account-balance-header/index.scss b/ui/components/app/network-account-balance-header/index.scss new file mode 100644 index 000000000..b76730904 --- /dev/null +++ b/ui/components/app/network-account-balance-header/index.scss @@ -0,0 +1,11 @@ +.network-account-balance-header { + border-top: 1px solid var(--color-border-muted); + border-bottom: 1px solid var(--color-border-muted); + + &__network-account { + &__ident-icon-ethereum { + margin-inline-start: -10px; + margin-top: -20px; + } + } +} diff --git a/ui/components/app/network-account-balance-header/network-account-balance-header.js b/ui/components/app/network-account-balance-header/network-account-balance-header.js new file mode 100644 index 000000000..80be85448 --- /dev/null +++ b/ui/components/app/network-account-balance-header/network-account-balance-header.js @@ -0,0 +1,111 @@ +import React, { useContext } from 'react'; +import PropTypes from 'prop-types'; +import Identicon from '../../ui/identicon/identicon.component'; +import { + DISPLAY, + FLEX_DIRECTION, + TYPOGRAPHY, + COLORS, + FONT_WEIGHT, + ALIGN_ITEMS, + JUSTIFY_CONTENT, +} from '../../../helpers/constants/design-system'; +import Box from '../../ui/box/box'; +import { I18nContext } from '../../../contexts/i18n'; +import Typography from '../../ui/typography'; + +export default function NetworkAccountBalanceHeader({ + networkName, + accountName, + accountBalance, + tokenName, + accountAddress, +}) { + const t = useContext(I18nContext); + + return ( + + + + + + + + + {networkName} + + + + {accountName} + + + + + + {t('balance')} + + + + {accountBalance} {tokenName} + + + + ); +} + +NetworkAccountBalanceHeader.propTypes = { + networkName: PropTypes.string, + accountName: PropTypes.string, + accountBalance: PropTypes.number, + tokenName: PropTypes.string, + accountAddress: PropTypes.string, +}; diff --git a/ui/components/app/network-account-balance-header/network-account-balance-header.stories.js b/ui/components/app/network-account-balance-header/network-account-balance-header.stories.js new file mode 100644 index 000000000..367559161 --- /dev/null +++ b/ui/components/app/network-account-balance-header/network-account-balance-header.stories.js @@ -0,0 +1,37 @@ +import React from 'react'; +import NetworkAccountBalanceHeader from './network-account-balance-header'; + +export default { + title: 'Components/App/NetworkAccountBalanceHeader', + id: __filename, + argTypes: { + networkName: { + control: { type: 'text' }, + }, + accountName: { + control: { type: 'text' }, + }, + accountBalance: { + control: { type: 'number' }, + }, + tokenName: { + control: { type: 'text' }, + }, + accountAddress: { + control: { type: 'text' }, + }, + }, + args: { + networkName: 'Ethereum Network', + accountName: 'Account 1', + accountBalance: 200.12, + tokenName: 'DAI', + accountAddress: '0x5CfE73b6021E818B776b421B1c4Db2474086a7e1', + }, +}; + +export const DefaultStory = (args) => { + return ; +}; + +DefaultStory.storyName = 'Default';