mirror of https://github.com/trezor/trezor-wallet
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.8 KiB
66 lines
1.8 KiB
6 years ago
|
import React, { Component } from 'react';
|
||
|
import styled from 'styled-components';
|
||
|
import { H3 } from 'components/Heading';
|
||
|
import P from 'components/Paragraph';
|
||
|
import Button from 'components/buttons/Button';
|
||
|
|
||
6 years ago
|
const Wrapper = styled.div`
|
||
6 years ago
|
width: 360px;
|
||
|
padding: 24px 48px;
|
||
|
`;
|
||
|
|
||
|
const StyledP = styled(P)`
|
||
|
padding: 14px 0px;
|
||
|
`;
|
||
|
|
||
|
const StyledButton = styled(Button)`
|
||
|
margin: 0 0 10px 0;
|
||
|
`;
|
||
|
|
||
|
const Row = styled.div`
|
||
|
display: flex;
|
||
|
flex-direction: column;
|
||
|
padding: 10px 0;
|
||
|
`;
|
||
|
|
||
|
class ForgetDevice extends Component {
|
||
|
componentDidMount() {
|
||
|
this.keyboardHandler = this.keyboardHandler.bind(this);
|
||
|
window.addEventListener('keydown', this.keyboardHandler, false);
|
||
|
}
|
||
|
|
||
|
componentWillUnmount() {
|
||
|
window.removeEventListener('keydown', this.keyboardHandler, false);
|
||
|
}
|
||
|
|
||
|
keyboardHandler(event) {
|
||
|
if (event.keyCode === 13) {
|
||
|
event.preventDefault();
|
||
|
this.forget();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
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 (
|
||
6 years ago
|
<Wrapper>
|
||
|
<H3>Forget { device.instanceLabel }?</H3>
|
||
6 years ago
|
<StyledP isSmaller>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.</StyledP>
|
||
|
<Row>
|
||
6 years ago
|
<StyledButton onClick={() => this.forget()}>Forget</StyledButton>
|
||
|
<StyledButton isWhite onClick={onCancel}>Don't forget</StyledButton>
|
||
6 years ago
|
</Row>
|
||
6 years ago
|
</Wrapper>
|
||
6 years ago
|
);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default ForgetDevice;
|