This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
251 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
// 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 moment from 'moment'; | ||
|
||
import { Container, InputAddress, Input } from '../../../ui'; | ||
|
||
import styles from '../wallet.css'; | ||
|
||
export default class WalletDetails extends Component { | ||
static contextTypes = { | ||
api: PropTypes.object.isRequired | ||
}; | ||
|
||
static propTypes = { | ||
owners: PropTypes.array, | ||
require: PropTypes.object, | ||
dailylimit: PropTypes.object | ||
}; | ||
|
||
render () { | ||
return ( | ||
<div className={ styles.details }> | ||
<Container title='Owners'> | ||
{ this.renderOwners() } | ||
</Container> | ||
|
||
<Container title='Details'> | ||
{ this.renderDetails() } | ||
</Container> | ||
</div> | ||
); | ||
} | ||
|
||
renderOwners () { | ||
const { owners } = this.props; | ||
|
||
if (!owners) { | ||
return null; | ||
} | ||
|
||
const ownersList = owners.map((address) => ( | ||
<InputAddress | ||
key={ address } | ||
value={ address } | ||
disabled | ||
text | ||
/> | ||
)); | ||
|
||
return ( | ||
<div> | ||
{ ownersList } | ||
</div> | ||
); | ||
} | ||
|
||
renderDetails () { | ||
const { require, dailylimit } = this.props; | ||
const { api } = this.context; | ||
|
||
if (!dailylimit || !dailylimit.limit) { | ||
return null; | ||
} | ||
|
||
const limit = api.util.fromWei(dailylimit.limit).toFormat(3); | ||
const spent = api.util.fromWei(dailylimit.spent).toFormat(3); | ||
const date = moment(dailylimit.last.toNumber() * 24 * 3600 * 1000); | ||
|
||
return ( | ||
<div> | ||
<p> | ||
<span>This wallet requires at least</span> | ||
<span className={ styles.detail }>{ require.toFormat() } owners</span> | ||
<span>to validate any action (transactions, modifications).</span> | ||
</p> | ||
|
||
<p> | ||
<span className={ styles.detail }>{ spent }<span className={ styles.eth } /></span> | ||
<span>has been spent today, out of</span> | ||
<span className={ styles.detail }>{ limit }<span className={ styles.eth } /></span> | ||
<span>set as the daily limit, which has been reset on</span> | ||
<span className={ styles.detail }>{ date.format('LL') }</span> | ||
</p> | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 './details'; |
Oops, something went wrong.