From 31175625b446cb5d18b17db23018bca8b14d280c Mon Sep 17 00:00:00 2001 From: Chi Kei Chan Date: Thu, 21 Mar 2019 16:03:30 -0700 Subject: Folder restructure (#6304) * Remove ui/app/keychains/ * Remove ui/app/img/ (unused images) * Move conversion-util to helpers/utils/ * Move token-util to helpers/utils/ * Move /helpers/*.js inside /helpers/utils/ * Move util tests inside /helpers/utils/ * Renameand move confirm-transaction/util.js to helpers/utils/ * Move higher-order-components to helpers/higher-order-components/ * Move infura-conversion.json to helpers/constants/ * Move all utility functions to helpers/utils/ * Move pages directory to top-level * Move all constants to helpers/constants/ * Move metametrics inside helpers/ * Move app and root inside pages/ * Move routes inside helpers/ * Re-organize ducks/ * Move reducers to ducks/ * Move selectors inside selectors/ * Move test out of test folder * Move action, reducer, store inside store/ * Move ui components inside ui/ * Move UI components inside ui/ * Move connected components inside components/app/ * Move i18n-helper inside helpers/ * Fix unit tests * Fix unit test * Move pages components * Rename routes component * Move reducers to ducks/index * Fix bad path in unit test --- .../components/pages/add-token/token-list/index.js | 2 - .../pages/add-token/token-list/index.scss | 65 ---------------------- .../token-list/token-list-placeholder/index.js | 2 - .../token-list/token-list-placeholder/index.scss | 23 -------- .../token-list-placeholder.component.js | 27 --------- .../add-token/token-list/token-list.component.js | 60 -------------------- .../add-token/token-list/token-list.container.js | 11 ---- 7 files changed, 190 deletions(-) delete mode 100644 ui/app/components/pages/add-token/token-list/index.js delete mode 100644 ui/app/components/pages/add-token/token-list/index.scss delete mode 100644 ui/app/components/pages/add-token/token-list/token-list-placeholder/index.js delete mode 100644 ui/app/components/pages/add-token/token-list/token-list-placeholder/index.scss delete mode 100644 ui/app/components/pages/add-token/token-list/token-list-placeholder/token-list-placeholder.component.js delete mode 100644 ui/app/components/pages/add-token/token-list/token-list.component.js delete mode 100644 ui/app/components/pages/add-token/token-list/token-list.container.js (limited to 'ui/app/components/pages/add-token/token-list') diff --git a/ui/app/components/pages/add-token/token-list/index.js b/ui/app/components/pages/add-token/token-list/index.js deleted file mode 100644 index 21dd5ac72..000000000 --- a/ui/app/components/pages/add-token/token-list/index.js +++ /dev/null @@ -1,2 +0,0 @@ -import TokenList from './token-list.container' -module.exports = TokenList diff --git a/ui/app/components/pages/add-token/token-list/index.scss b/ui/app/components/pages/add-token/token-list/index.scss deleted file mode 100644 index e32739d59..000000000 --- a/ui/app/components/pages/add-token/token-list/index.scss +++ /dev/null @@ -1,65 +0,0 @@ -@import './token-list-placeholder/index'; - -.token-list { - &__title { - font-size: .75rem; - } - - &__tokens-container { - display: flex; - flex-direction: column; - } - - &__token { - transition: 200ms ease-in-out; - display: flex; - flex-flow: row nowrap; - align-items: center; - padding: 8px; - margin-top: 8px; - box-sizing: border-box; - border-radius: 10px; - cursor: pointer; - border: 2px solid transparent; - position: relative; - - &:hover { - border: 2px solid rgba($malibu-blue, .5); - } - - &--selected { - border: 2px solid $malibu-blue !important; - } - - &--disabled { - opacity: .4; - pointer-events: none; - } - } - - &__token-icon { - width: 48px; - height: 48px; - background-repeat: no-repeat; - background-size: contain; - background-position: center; - border-radius: 50%; - background-color: $white; - box-shadow: 0 2px 4px 0 rgba($black, .24); - margin-right: 12px; - flex: 0 0 auto; - } - - &__token-data { - display: flex; - flex-direction: row; - align-items: center; - min-width: 0; - } - - &__token-name { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } -} diff --git a/ui/app/components/pages/add-token/token-list/token-list-placeholder/index.js b/ui/app/components/pages/add-token/token-list/token-list-placeholder/index.js deleted file mode 100644 index b82f45e93..000000000 --- a/ui/app/components/pages/add-token/token-list/token-list-placeholder/index.js +++ /dev/null @@ -1,2 +0,0 @@ -import TokenListPlaceholder from './token-list-placeholder.component' -module.exports = TokenListPlaceholder diff --git a/ui/app/components/pages/add-token/token-list/token-list-placeholder/index.scss b/ui/app/components/pages/add-token/token-list/token-list-placeholder/index.scss deleted file mode 100644 index cc495dfb0..000000000 --- a/ui/app/components/pages/add-token/token-list/token-list-placeholder/index.scss +++ /dev/null @@ -1,23 +0,0 @@ -.token-list-placeholder { - display: flex; - align-items: center; - padding-top: 36px; - flex-direction: column; - line-height: 22px; - opacity: .5; - - &__text { - color: $silver-chalice; - width: 50%; - text-align: center; - margin-top: 8px; - - @media screen and (max-width: 575px) { - width: 60%; - } - } - - &__link { - color: $curious-blue; - } -} diff --git a/ui/app/components/pages/add-token/token-list/token-list-placeholder/token-list-placeholder.component.js b/ui/app/components/pages/add-token/token-list/token-list-placeholder/token-list-placeholder.component.js deleted file mode 100644 index 20f550927..000000000 --- a/ui/app/components/pages/add-token/token-list/token-list-placeholder/token-list-placeholder.component.js +++ /dev/null @@ -1,27 +0,0 @@ -import React, { Component } from 'react' -import PropTypes from 'prop-types' - -export default class TokenListPlaceholder extends Component { - static contextTypes = { - t: PropTypes.func, - } - - render () { - return ( -
- -
- { this.context.t('addAcquiredTokens') } -
- - { this.context.t('learnMore') } - -
- ) - } -} diff --git a/ui/app/components/pages/add-token/token-list/token-list.component.js b/ui/app/components/pages/add-token/token-list/token-list.component.js deleted file mode 100644 index 724a68d6e..000000000 --- a/ui/app/components/pages/add-token/token-list/token-list.component.js +++ /dev/null @@ -1,60 +0,0 @@ -import React, { Component } from 'react' -import PropTypes from 'prop-types' -import classnames from 'classnames' -import { checkExistingAddresses } from '../util' -import TokenListPlaceholder from './token-list-placeholder' - -export default class InfoBox extends Component { - static contextTypes = { - t: PropTypes.func, - } - - static propTypes = { - tokens: PropTypes.array, - results: PropTypes.array, - selectedTokens: PropTypes.object, - onToggleToken: PropTypes.func, - } - - render () { - const { results = [], selectedTokens = {}, onToggleToken, tokens = [] } = this.props - - return results.length === 0 - ? - : ( -
-
- { this.context.t('searchResults') } -
-
- { - Array(6).fill(undefined) - .map((_, i) => { - const { logo, symbol, name, address } = results[i] || {} - const tokenAlreadyAdded = checkExistingAddresses(address, tokens) - - return Boolean(logo || symbol || name) && ( -
!tokenAlreadyAdded && onToggleToken(results[i])} - key={i} - > -
-
-
- { `${name} (${symbol})` } -
-
- ) - }) - } -
-
- ) - } -} diff --git a/ui/app/components/pages/add-token/token-list/token-list.container.js b/ui/app/components/pages/add-token/token-list/token-list.container.js deleted file mode 100644 index cd7b07a37..000000000 --- a/ui/app/components/pages/add-token/token-list/token-list.container.js +++ /dev/null @@ -1,11 +0,0 @@ -import { connect } from 'react-redux' -import TokenList from './token-list.component' - -const mapStateToProps = ({ metamask }) => { - const { tokens } = metamask - return { - tokens, - } -} - -export default connect(mapStateToProps)(TokenList) -- cgit