Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Wallet Creation Modal #3282
Browse files Browse the repository at this point in the history
  • Loading branch information
ngotchac committed Nov 22, 2016
1 parent bd6f343 commit 19dbe3f
Show file tree
Hide file tree
Showing 15 changed files with 714 additions and 12 deletions.
21 changes: 21 additions & 0 deletions js/src/contracts/code/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 2015, 2016 Ethcore (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 <http://www.gnu.org/licenses/>.

import wallet from './wallet';

export {
wallet
};
23 changes: 23 additions & 0 deletions js/src/contracts/code/wallet.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions js/src/modals/CreateAccount/NewAccount/newAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,17 +192,14 @@ export default class CreateAccount extends Component {
};
});

console.log(accounts);

this.setState({
selectedAddress: addresses[0],
accounts: accounts
});
});
})
.catch((error) => {
console.log('createIdentities', error);

console.error('createIdentities', error);
setTimeout(this.createIdentities, 1000);
this.newError(error);
});
Expand Down
17 changes: 17 additions & 0 deletions js/src/modals/CreateWallet/WalletDetails/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2015, 2016 Ethcore (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 <http://www.gnu.org/licenses/>.

export default from './walletDetails';
88 changes: 88 additions & 0 deletions js/src/modals/CreateWallet/WalletDetails/walletDetails.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
// Copyright 2015, 2016 Ethcore (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 <http://www.gnu.org/licenses/>.

import React, { Component, PropTypes } from 'react';

import { Form, TypedInput, AddressSelect } from '../../../ui';
import { parseAbiType } from '../../../util/abi';

export default class WalletDetails extends Component {
static propTypes = {
accounts: PropTypes.object.isRequired,
wallet: PropTypes.object.isRequired,
errors: PropTypes.object.isRequired,
onChange: PropTypes.func.isRequired
};

render () {
const { accounts, wallet, errors } = this.props;

return (
<Form>
<AddressSelect
label='from account (contract owner)'
hint='the owner account for this contract'
value={ wallet.account }
error={ errors.account }
onChange={ this.onAccoutChange }
accounts={ accounts }
/>

<TypedInput
label='other wallet owners'
value={ wallet.owners.slice() }
onChange={ this.onOwnersChange }
accounts={ accounts }
param={ parseAbiType('address[]') }
/>

<TypedInput
label='required owners'
hint='number of required owners to accept a transaction'
value={ wallet.required }
error={ errors.required }
onChange={ this.onRequiredChange }
param={ parseAbiType('uint') }
/>

<TypedInput
label='wallet day limit'
hint='number of days to wait for other owners confirmation'
value={ wallet.daylimit }
error={ errors.daylimit }
onChange={ this.onDaylimitChange }
param={ parseAbiType('uint') }
/>
</Form>
);
}

onAccoutChange = (_, account) => {
this.props.onChange({ account });
}

onOwnersChange = (owners) => {
this.props.onChange({ owners });
}

onRequiredChange = (required) => {
this.props.onChange({ required });
}

onDaylimitChange = (daylimit) => {
this.props.onChange({ daylimit });
}
}
17 changes: 17 additions & 0 deletions js/src/modals/CreateWallet/WalletInfo/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2015, 2016 Ethcore (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 <http://www.gnu.org/licenses/>.

export default from './walletInfo';
Loading

0 comments on commit 19dbe3f

Please sign in to comment.