diff --git a/js/src/api/subscriptions/personal.js b/js/src/api/subscriptions/personal.js index c1f070262..15b037b42 100644 --- a/js/src/api/subscriptions/personal.js +++ b/js/src/api/subscriptions/personal.js @@ -119,7 +119,6 @@ export default class Personal { case 'parity_removeAddress': case 'parity_setAccountName': case 'parity_setAccountMeta': - case 'parity_changeVault': this._accountsInfo(); return; diff --git a/js/src/modals/CreateAccount/createAccount.css b/js/src/modals/CreateAccount/createAccount.css index 5c8bc7e5c..d58e0edfd 100644 --- a/js/src/modals/CreateAccount/createAccount.css +++ b/js/src/modals/CreateAccount/createAccount.css @@ -19,23 +19,24 @@ line-height: 1.618em; } -.password { - flex: 0 1 50%; - width: 50%; - box-sizing: border-box; - - &:nth-child(odd) { - padding-right: 0.25rem; - } - - &:nth-child(even) { - padding-left: 0.25rem; - } -} - +/* TODO: 2 column layout can be made generic, now duplicated in Vaults */ .passwords { display: flex; flex-wrap: wrap; + + .password { + box-sizing: border-box; + flex: 0 1 50%; + width: 50%; + + &:nth-child(odd) { + padding-right: 0.25rem; + } + + &:nth-child(even) { + padding-left: 0.25rem; + } + } } .identities, .selector { diff --git a/js/src/modals/CreateAccount/errors.js b/js/src/modals/CreateAccount/errors.js index 487bf9729..bb5708275 100644 --- a/js/src/modals/CreateAccount/errors.js +++ b/js/src/modals/CreateAccount/errors.js @@ -18,37 +18,44 @@ import React from 'react'; import { FormattedMessage } from 'react-intl'; export default { + duplicateName: ( + + ), + noFile: ( ), noKey: ( ), noMatchPassword: ( ), noName: ( ), invalidKey: ( ) diff --git a/js/src/modals/VaultAccounts/index.js b/js/src/modals/VaultAccounts/index.js new file mode 100644 index 000000000..506a569f3 --- /dev/null +++ b/js/src/modals/VaultAccounts/index.js @@ -0,0 +1,17 @@ +// Copyright 2015-2017 Parity Technologies (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + +export default from './vaultAccounts'; diff --git a/js/src/modals/VaultAccounts/vaultAccounts.css b/js/src/modals/VaultAccounts/vaultAccounts.css new file mode 100644 index 000000000..1960376f3 --- /dev/null +++ b/js/src/modals/VaultAccounts/vaultAccounts.css @@ -0,0 +1,48 @@ +/* Copyright 2015-2017 Parity Technologies (UK) Ltd. +/* This file is part of Parity. +/* +/* Parity is free software: you can redistribute it and/or modify +/* it under the terms of the GNU General Public License as published by +/* the Free Software Foundation, either version 3 of the License, or +/* (at your option) any later version. +/* +/* Parity is distributed in the hope that it will be useful, +/* but WITHOUT ANY WARRANTY; without even the implied warranty of +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +/* GNU General Public License for more details. +/* +/* You should have received a copy of the GNU General Public License +/* along with Parity. If not, see . +*/ + +/* TODO: These overlap with DappPermissions now, make DRY */ +/* (selection component or just styles?) */ +.iconDisabled { + opacity: 0.15; +} + +.item { + display: flex; + flex: 1; + position: relative; + + .overlay { + position: absolute; + right: 0.5em; + top: 0.5em; + } +} + +.selected, +.unselected { + margin-bottom: 0.25em; + width: 100%; + + &:focus { + outline: none; + } +} + +.selected { + background: rgba(255, 255, 255, 0.15) !important; +} diff --git a/js/src/modals/VaultAccounts/vaultAccounts.js b/js/src/modals/VaultAccounts/vaultAccounts.js new file mode 100644 index 000000000..96f170f79 --- /dev/null +++ b/js/src/modals/VaultAccounts/vaultAccounts.js @@ -0,0 +1,195 @@ +// Copyright 2015-2017 Parity Technologies (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + +import { observer } from 'mobx-react'; +import React, { Component, PropTypes } from 'react'; +import { FormattedMessage } from 'react-intl'; +import { connect } from 'react-redux'; +import { bindActionCreators } from 'redux'; + +import { newError } from '~/redux/actions'; +import { personalAccountsInfo } from '~/redux/providers/personalActions'; +import { AccountCard, Button, Portal, SectionList } from '~/ui'; +import { CancelIcon, CheckIcon } from '~/ui/Icons'; + +import styles from './vaultAccounts.css'; + +@observer +class VaultAccounts extends Component { + static contextTypes = { + api: PropTypes.object.isRequired + }; + + static propTypes = { + accounts: PropTypes.object.isRequired, + newError: PropTypes.func.isRequired, + personalAccountsInfo: PropTypes.func.isRequired, + vaultStore: PropTypes.object.isRequired + }; + + render () { + const { accounts } = this.props; + const { isBusyAccounts, isModalAccountsOpen, selectedAccounts } = this.props.vaultStore; + + if (!isModalAccountsOpen) { + return null; + } + + const vaultAccounts = Object + .keys(accounts) + .filter((address) => accounts[address].uuid) + .map((address) => accounts[address]); + + return ( + } + key='cancel' + label={ + + } + onClick={ this.onClose } + />, +