// Copyright 2015-2018 Parity Technologies (UK) Ltd. // This file is part of Parity. // // SPDX-License-Identifier: MIT import React, { Component } from 'react'; import { fromWei } from '@parity/api/lib/util/wei'; import { inject, observer } from 'mobx-react'; @inject('signerStore') @observer class SignerDetails extends Component { state = { password: '' }; handleAccept = () => { const { match: { params: { requestId } }, signerStore } = this.props; const { password } = this.state; signerStore.acceptRequest(requestId, password); }; handleChangePassword = ({ target: { value } }) => { this.setState({ password: value }); }; handleReject = () => { const { match: { params: { requestId } }, signerStore } = this.props; signerStore.rejectRequest(requestId); }; handleSubmit = e => { e.preventDefault(); }; render () { const { match: { params: { requestId } }, signerStore: { requests } } = this.props; const { password } = this.state; const request = requests[requestId]; if (!request) { // This happens after we accept/reject a request return null; } const transaction = request.payload.sendTransaction; return (

Request number {requestId}

From: {transaction.from}

To: {transaction.to}

Amount: {+fromWei(transaction.value)}ETH

Gas: {+transaction.gas}


{' '}
@brian, for now for errors look in console, e.g. when nothing happens when you click on Accept
); } } export default SignerDetails;