diff --git a/package.json b/package.json index 195f50c02a836fe91f9d17f04ae3aa52f09d938e..cac1e1e874a254ebb3a61a542940cf292333d275 100644 --- a/package.json +++ b/package.json @@ -41,11 +41,11 @@ "scripts": { "build": "lerna run build", "preelectron": "yarn build", - "electron": "lerna run electron --scope fether", + "electron": "cd packages/fether-electron && yarn electron", "lint": "semistandard 'packages/**/*.js' --parser babel-eslint", "prepackage": "yarn build", - "package": "lerna run package --scope fether", - "release": "lerna run release --scope fether", + "package": "cd packages/fether-electron && yarn package", + "release": "cd packages/fether-electron && yarn release", "start": "npm-run-all -l -p start-*", "start-electron": "cd packages/fether-electron && yarn start", "start-hoc": "cd packages/light-hoc && yarn start", diff --git a/packages/fether-react/src/Accounts/AccountsList/AccountsList.js b/packages/fether-react/src/Accounts/AccountsList/AccountsList.js index 3f1cc479ac074573a3c81d4b687ff0d0a36f44ba..6854faf5a24a43c247fcfb5add4881c0c426090a 100644 --- a/packages/fether-react/src/Accounts/AccountsList/AccountsList.js +++ b/packages/fether-react/src/Accounts/AccountsList/AccountsList.js @@ -96,6 +96,7 @@ class AccountsList extends Component { ? accountsInfo[address].name : '(No name)') } + shortAddress /> )) diff --git a/packages/fether-react/src/Whitelist/NewTokenItem/NewTokenItem.js b/packages/fether-react/src/Whitelist/NewTokenItem/NewTokenItem.js index f20f74174f2124488aa5a87393434d6da0aa5ad1..d725b555e68c574c398fad97b1f9c091c3d1ed02 100644 --- a/packages/fether-react/src/Whitelist/NewTokenItem/NewTokenItem.js +++ b/packages/fether-react/src/Whitelist/NewTokenItem/NewTokenItem.js @@ -6,18 +6,22 @@ import React, { Component } from 'react'; import { inject, observer } from 'mobx-react'; import { TokenCard } from 'fether-ui'; +import { withRouter } from 'react-router-dom'; +@withRouter @inject('tokensStore') @observer class NewTokenItem extends Component { handleAddToken = () => { - const { token, tokensStore } = this.props; + const { history, token, tokensStore } = this.props; tokensStore.addToken(token.address, token); + history.goBack(); }; handleRemoveToken = () => { - const { token, tokensStore } = this.props; + const { history, token, tokensStore } = this.props; tokensStore.removeToken(token.address); + history.goBack(); }; render () { diff --git a/packages/fether-react/src/Whitelist/Whitelist.js b/packages/fether-react/src/Whitelist/Whitelist.js index 99c0bcda91a08712ab3bac52f82e777aa4d088ab..9805a2e16f2c117cc34d42b4aaa21c83953d4810 100644 --- a/packages/fether-react/src/Whitelist/Whitelist.js +++ b/packages/fether-react/src/Whitelist/Whitelist.js @@ -9,7 +9,6 @@ import debounce from 'lodash/debounce'; import { Header } from 'fether-ui'; import { inject, observer } from 'mobx-react'; import light from 'light-hoc'; -import { Link } from 'react-router-dom'; import Health from '../Health'; import NewTokenItem from './NewTokenItem'; @@ -96,17 +95,18 @@ class Whitelist extends Component { }; render () { + const { history } = this.props; const { matches, search } = this.state; return (
+ Close - + } - title={

My tokens

} + title={

Search tokens

} />
diff --git a/packages/fether-react/src/assets/sass/components/_account.scss b/packages/fether-react/src/assets/sass/components/_account.scss index e9c0ce46abf036ef86642d60e03a7833398ec8c1..9c61b0eb1885c159d8049919a26ce36f386c943f 100644 --- a/packages/fether-react/src/assets/sass/components/_account.scss +++ b/packages/fether-react/src/assets/sass/components/_account.scss @@ -1,6 +1,12 @@ .account { display: flex; + &.-header { + .account_address { + font-size: 0.6rem; + } + } + .account_avatar { width: (ms(0) * 1.3) + 1rem; height: (ms(0) * 1.3) + 1rem; @@ -38,7 +44,7 @@ .account_address { font-family: $mono; color: $grey; - font-size: ms(-2) * 0.9; // 0.9 is ugly here + font-size: ms(-2); line-height: ms(-2) * 1.3; } } diff --git a/packages/fether-react/src/assets/sass/components/_header-nav.scss b/packages/fether-react/src/assets/sass/components/_header-nav.scss index aea21943068531681afb6fc3197aee40319c1e9d..44607bd021e49bb188c2a7673e18a7e312b4cf9a 100644 --- a/packages/fether-react/src/assets/sass/components/_header-nav.scss +++ b/packages/fether-react/src/assets/sass/components/_header-nav.scss @@ -32,7 +32,7 @@ padding: 0.25rem 0.5rem 0.175rem; display: inline-block; font-size: ms(0); - line-height: ms(0) * 1.3; + line-height: ms(0) * 0.8; color: rgba($black, 0.675); font-weight: 500; } diff --git a/packages/fether-ui/src/AccountCard/AccountCard.js b/packages/fether-ui/src/AccountCard/AccountCard.js index c5073d3c2b857bd87eeddc58f2bedfef77e31d20..f569788d51fd1ea6d56aed268e1ed44a54e554d7 100644 --- a/packages/fether-ui/src/AccountCard/AccountCard.js +++ b/packages/fether-ui/src/AccountCard/AccountCard.js @@ -4,39 +4,35 @@ // SPDX-License-Identifier: BSD-3-Clause import React from 'react'; -import Blockies from 'react-blockies'; import PropTypes from 'prop-types'; +import Address from './Address'; +import Avatar from './Avatar'; import Card from '../Card'; -import Placeholder from '../Placeholder'; +import Information from './Information'; +import Name from './Name'; -const AccountCard = ({ address, animate, name, ...otherProps }) => ( +const AccountCard = ({ address, name, shortAddress, ...otherProps }) => (
-
- {address ? ( - - ) : ( - - )} -
-
- {name ? ( -
{name}
- ) : ( - - )} -
- {address || } -
-
+ + + +
+
); +AccountCard.Address = Address; +AccountCard.Avatar = Avatar; +AccountCard.Information = Information; +AccountCard.Name = Name; + AccountCard.propTypes = { address: PropTypes.string, - name: PropTypes.string + name: PropTypes.string, + shortAddress: PropTypes.bool }; export default AccountCard; diff --git a/packages/fether-ui/src/AccountCard/Address/Address.js b/packages/fether-ui/src/AccountCard/Address/Address.js new file mode 100644 index 0000000000000000000000000000000000000000..d1279565807a61f6376b7e89ed7481d170d0902d --- /dev/null +++ b/packages/fether-ui/src/AccountCard/Address/Address.js @@ -0,0 +1,35 @@ +// Copyright 2015-2018 Parity Technologies (UK) Ltd. +// This file is part of Parity. +// +// SPDX-License-Identifier: BSD-3-Clause + +import React from 'react'; +import PropTypes from 'prop-types'; + +import AddressShort from '../../AddressShort'; +import Placeholder from '../../Placeholder'; + +const Address = ({ address, short, ...otherProps }) => ( +
+ {address ? ( + short ? ( + + ) : ( + address + ) + ) : ( + + )} +
+); + +Address.defaultProps = { + short: false +}; + +Address.propTypes = { + name: PropTypes.string, + short: PropTypes.bool +}; + +export default Address; diff --git a/packages/fether-ui/src/AccountCard/Address/index.js b/packages/fether-ui/src/AccountCard/Address/index.js new file mode 100644 index 0000000000000000000000000000000000000000..32a089646b45bb33ab5d357bf66e609b68e0341a --- /dev/null +++ b/packages/fether-ui/src/AccountCard/Address/index.js @@ -0,0 +1,8 @@ +// Copyright 2015-2018 Parity Technologies (UK) Ltd. +// This file is part of Parity. +// +// SPDX-License-Identifier: BSD-3-Clause + +import Address from './Address'; + +export default Address; diff --git a/packages/fether-ui/src/AccountCard/Avatar/Avatar.js b/packages/fether-ui/src/AccountCard/Avatar/Avatar.js new file mode 100644 index 0000000000000000000000000000000000000000..6b089966fa4ad061795c1ee0a5e00b2a27c48217 --- /dev/null +++ b/packages/fether-ui/src/AccountCard/Avatar/Avatar.js @@ -0,0 +1,26 @@ +// Copyright 2015-2018 Parity Technologies (UK) Ltd. +// This file is part of Parity. +// +// SPDX-License-Identifier: BSD-3-Clause + +import React from 'react'; +import Blockies from 'react-blockies'; +import PropTypes from 'prop-types'; + +import Placeholder from '../../Placeholder'; + +const Avatar = ({ address, ...otherProps }) => ( +
+ {address ? ( + + ) : ( + + )} +
+); + +Avatar.propTypes = { + address: PropTypes.string +}; + +export default Avatar; diff --git a/packages/fether-ui/src/AccountCard/Avatar/index.js b/packages/fether-ui/src/AccountCard/Avatar/index.js new file mode 100644 index 0000000000000000000000000000000000000000..7118470af4180ac03ba115888a427f4e24101806 --- /dev/null +++ b/packages/fether-ui/src/AccountCard/Avatar/index.js @@ -0,0 +1,8 @@ +// Copyright 2015-2018 Parity Technologies (UK) Ltd. +// This file is part of Parity. +// +// SPDX-License-Identifier: BSD-3-Clause + +import Avatar from './Avatar'; + +export default Avatar; diff --git a/packages/fether-ui/src/AccountCard/Information/Information.js b/packages/fether-ui/src/AccountCard/Information/Information.js new file mode 100644 index 0000000000000000000000000000000000000000..ff9bdfefdcc431454131448cde5b4021ce671c5e --- /dev/null +++ b/packages/fether-ui/src/AccountCard/Information/Information.js @@ -0,0 +1,20 @@ +// Copyright 2015-2018 Parity Technologies (UK) Ltd. +// This file is part of Parity. +// +// SPDX-License-Identifier: BSD-3-Clause + +import React from 'react'; + +import PropTypes from 'prop-types'; + +const Information = ({ children, ...otherProps }) => ( +
+ {children} +
+); + +Information.propTypes = { + children: PropTypes.node +}; + +export default Information; diff --git a/packages/fether-ui/src/AccountCard/Information/index.js b/packages/fether-ui/src/AccountCard/Information/index.js new file mode 100644 index 0000000000000000000000000000000000000000..916846dc74cd021e0d23951a0f6d6e17c0e664ce --- /dev/null +++ b/packages/fether-ui/src/AccountCard/Information/index.js @@ -0,0 +1,8 @@ +// Copyright 2015-2018 Parity Technologies (UK) Ltd. +// This file is part of Parity. +// +// SPDX-License-Identifier: BSD-3-Clause + +import Information from './Information'; + +export default Information; diff --git a/packages/fether-ui/src/AccountCard/Name/Name.js b/packages/fether-ui/src/AccountCard/Name/Name.js new file mode 100644 index 0000000000000000000000000000000000000000..6fec49b0dc842799aa3770835f167b366588debf --- /dev/null +++ b/packages/fether-ui/src/AccountCard/Name/Name.js @@ -0,0 +1,21 @@ +// Copyright 2015-2018 Parity Technologies (UK) Ltd. +// This file is part of Parity. +// +// SPDX-License-Identifier: BSD-3-Clause + +import React from 'react'; +import PropTypes from 'prop-types'; + +import Placeholder from '../../Placeholder'; + +const Name = ({ name, ...otherProps }) => ( +
+ {name || } +
+); + +Name.propTypes = { + name: PropTypes.string +}; + +export default Name; diff --git a/packages/fether-ui/src/AccountCard/Name/index.js b/packages/fether-ui/src/AccountCard/Name/index.js new file mode 100644 index 0000000000000000000000000000000000000000..091ba90e20479b00f354088c8c34d7ae36840871 --- /dev/null +++ b/packages/fether-ui/src/AccountCard/Name/index.js @@ -0,0 +1,8 @@ +// Copyright 2015-2018 Parity Technologies (UK) Ltd. +// This file is part of Parity. +// +// SPDX-License-Identifier: BSD-3-Clause + +import Name from './Name'; + +export default Name; diff --git a/packages/fether-ui/src/AccountHeader/AccountHeader.js b/packages/fether-ui/src/AccountHeader/AccountHeader.js index efc342efd88b610d74553ce0c37f8418438ad0fd..9f60c356931199ee61c22edadf16fffa4825ebe8 100644 --- a/packages/fether-ui/src/AccountHeader/AccountHeader.js +++ b/packages/fether-ui/src/AccountHeader/AccountHeader.js @@ -11,11 +11,11 @@ import ClickToCopy from '../ClickToCopy'; import Header from '../Header'; const NormalContainer = ({ children }) => ( -

{children}

+

{children}

); const CopyContainer = ({ address, children, ...otherProps }) => ( - {children} + {children} ); @@ -30,10 +30,8 @@ const AccountHeader = ({ address, copyAddress, name, ...otherProps }) => { name && ( {' '} - {name}{' '} - - {address.slice(0, 4)}..{address.slice(-4)} - + {name}
+ {address}
) } diff --git a/packages/fether-ui/src/AddressShort/AddressShort.js b/packages/fether-ui/src/AddressShort/AddressShort.js new file mode 100644 index 0000000000000000000000000000000000000000..d7fa5c0ef41e0b7ec74cf7ac1c7109f53c132841 --- /dev/null +++ b/packages/fether-ui/src/AddressShort/AddressShort.js @@ -0,0 +1,19 @@ +// Copyright 2015-2018 Parity Technologies (UK) Ltd. +// This file is part of Parity. +// +// SPDX-License-Identifier: BSD-3-Clause + +import React from 'react'; +import PropTypes from 'prop-types'; + +const AddressShort = ({ address, as: T = 'span', ...otherProps }) => ( + + {address.slice(0, 4)}..{address.slice(-4)} + +); + +AddressShort.propTypes = { + address: PropTypes.string.isRequired +}; + +export default AddressShort; diff --git a/packages/fether-ui/src/AddressShort/index.js b/packages/fether-ui/src/AddressShort/index.js new file mode 100644 index 0000000000000000000000000000000000000000..bf2aed3a96cafe66bccc762279534a8a5ae86168 --- /dev/null +++ b/packages/fether-ui/src/AddressShort/index.js @@ -0,0 +1,8 @@ +// Copyright 2015-2018 Parity Technologies (UK) Ltd. +// This file is part of Parity. +// +// SPDX-License-Identifier: BSD-3-Clause + +import AddressShort from './AddressShort'; + +export default AddressShort; diff --git a/packages/fether-ui/src/index.js b/packages/fether-ui/src/index.js index 60344cde4ea318ce9a18ee6958c782bceeb613e3..32124296c1f10f9b89011101cca5c245870275d0 100644 --- a/packages/fether-ui/src/index.js +++ b/packages/fether-ui/src/index.js @@ -5,6 +5,7 @@ import AccountCard from './AccountCard'; import AccountHeader from './AccountHeader'; +import AddressShort from './AddressShort'; import Card from './Card'; import FormField from './FormField'; import Header from './Header'; @@ -14,6 +15,7 @@ import TokenCard from './TokenCard'; export { AccountCard, AccountHeader, + AddressShort, Card, FormField, Header,