/* @flow */ import React, { Component } from 'react'; import styled from 'styled-components'; import Input from 'components/inputs/Input'; import Textarea from 'components/Textarea'; import Title from 'views/Wallet/components/Title'; import Button from 'components/Button'; import Content from 'views/Wallet/components/Content'; import colors from 'config/colors'; import type { Props } from './Container'; const Wrapper = styled.div` display: flex; flex: 1; flex-direction: row; background: ${colors.WHITE}; `; const Row = styled.div` padding-bottom: 28px; `; const RowButtons = styled(Row)` display: flex; align-items: center; justify-content: flex-end; `; const StyledButton = styled(Button)` margin-left: 10px; width: 110px; `; const Column = styled.div` display: flex; flex: 1; flex-direction: column; `; const Sign = styled(Column)``; const Verify = styled(Column)` padding-left: 20px; `; class SignVerify extends Component { getError(inputName: string) { if (!this.props.signVerify) return null; return this.props.signVerify.errors.find(e => e.inputName === inputName); } handleInputChange = (event: SyntheticInputEvent) => { this.props.signVerifyActions.inputChange(event.target.name, event.target.value); } render() { const device = this.props.wallet.selectedDevice; const { account, discovery, shouldRender, notification, network, } = this.props.selectedAccount; const { type, title, message } = notification; if (!device || !account || !discovery || !shouldRender) return ; const { signVerifyActions, signVerify: { signMessage, signSignature, verifyAddress, verifyMessage, verifySignature, errors, }, } = this.props; const verifyAddressError = this.getError('verifyAddress'); return ( Sign & Verify