From d767ee0e05fba0daf7fdeaf30b832b9de2cb1eb2 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Thu, 30 Aug 2018 13:07:07 +0200 Subject: [PATCH] Remember device refactored --- src/components/modal/ConfirmSignTx/index.js | 55 +++++++++++++++++++++ src/components/modal/RememberDevice.js | 42 +--------------- 2 files changed, 56 insertions(+), 41 deletions(-) create mode 100644 src/components/modal/ConfirmSignTx/index.js diff --git a/src/components/modal/ConfirmSignTx/index.js b/src/components/modal/ConfirmSignTx/index.js new file mode 100644 index 00000000..94588b3a --- /dev/null +++ b/src/components/modal/ConfirmSignTx/index.js @@ -0,0 +1,55 @@ +import React from 'react'; +import colors from 'config/colors'; +import styled from 'styled-components'; +import P from 'components/Paragraph'; +import { H3 } from 'components/Heading'; + +const Wrapper = styled.div` + width: 390px; +`; + +const Header = styled.div` +`; + +const Content = styled.div` + border-top: 1px solid ${colors.DIVIDER}; + background: ${colors.MAIN}; + padding: 24px 48px; +`; + +const Label = styled.div` + font-size: 10px; + color: ${colors.TEXT_SECONDARY}; +`; + +const ConfirmSignTx = (props) => { + if (!props.modal.opened) return null; + const { device } = props.modal; + + const { + amount, + address, + currency, + total, + selectedFeeLevel, + } = props.sendForm; + + return ( + +
+

Confirm transaction on { device.label } device

+

Details are shown on display

+
+ + +

{ `${amount} ${currency}` }

+ +

{ address }

+ +

{ selectedFeeLevel.label }

+
+
+ ); +}; + +export default ConfirmSignTx; \ No newline at end of file diff --git a/src/components/modal/RememberDevice.js b/src/components/modal/RememberDevice.js index 2e318f7b..8d716176 100644 --- a/src/components/modal/RememberDevice.js +++ b/src/components/modal/RememberDevice.js @@ -94,44 +94,4 @@ export default class RememberDevice extends Component { ); } -} - -export class ForgetDevice extends Component { - keyboardHandler: (event: KeyboardEvent) => void; - - keyboardHandler(event: KeyboardEvent): void { - if (event.keyCode === 13) { - event.preventDefault(); - this.forget(); - } - } - - componentDidMount(): void { - this.keyboardHandler = this.keyboardHandler.bind(this); - window.addEventListener('keydown', this.keyboardHandler, false); - } - - componentWillUnmount(): void { - window.removeEventListener('keydown', this.keyboardHandler, false); - } - - forget() { - if (this.props.modal.opened) { - this.props.modalActions.onForgetSingleDevice(this.props.modal.device); - } - } - - render() { - if (!this.props.modal.opened) return null; - const { device } = this.props.modal; - const { onCancel } = this.props.modalActions; - return ( -
-

Forget { device.instanceLabel } ?

-

Forgetting only removes the device from the list on the left, your coins are still safe and you can access them by reconnecting your TREZOR again.

- - -
- ); - } -} +} \ No newline at end of file