1
0
mirror of https://github.com/trezor/trezor-wallet synced 2025-07-12 01:28:13 +00:00
trezor-wallet/src/js/components/wallet/pages/Acquire.js
2018-05-18 18:54:21 +02:00

52 lines
1.3 KiB
JavaScript

/* @flow */
'use strict';
import React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { Notification } from '~/js/components/common/Notification';
import * as TrezorConnectActions from '~/js/actions/TrezorConnectActions';
import type { State, Dispatch } from '~/flowtype';
type Props = {
connect: $ElementType<State, 'connect'>,
acquireDevice: typeof TrezorConnectActions.acquire
}
const Acquire = (props: Props) => {
const actions = [
{
label: 'Acquire device',
callback: () => {
props.acquireDevice()
}
}
];
return (
<section className="acquire">
<Notification
title="Device is used in other window"
message="Do you want to use your device in this window?"
className="info"
cancelable={ false }
actions={ actions }
/>
</section>
);
}
export default connect(
(state: State) => {
return {
log: state.log
};
},
(dispatch: Dispatch) => {
return {
acquireDevice: bindActionCreators(TrezorConnectActions.acquire, dispatch),
};
}
)(Acquire);