1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-17 05:49:10 +00:00
trezor-wallet/src/js/components/wallet/pages/Acquire.js

52 lines
1.3 KiB
JavaScript
Raw Normal View History

2018-02-20 09:30:36 +00:00
/* @flow */
'use strict';
import React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
2018-05-18 16:41:40 +00:00
import { Notification } from '~/js/components/common/Notification';
2018-05-18 16:38:02 +00:00
import * as TrezorConnectActions from '~/js/actions/TrezorConnectActions';
2018-02-20 09:30:36 +00:00
2018-05-18 16:38:02 +00:00
import type { State, Dispatch } from '~/js/flowtype';
2018-04-16 21:19:50 +00:00
type Props = {
connect: $ElementType<State, 'connect'>,
acquireDevice: typeof TrezorConnectActions.acquire
}
const Acquire = (props: Props) => {
2018-03-08 16:10:53 +00:00
const actions = [
{
label: 'Acquire device',
callback: () => {
props.acquireDevice()
}
}
];
2018-02-20 09:30:36 +00:00
return (
<section className="acquire">
2018-03-08 16:10:53 +00:00
<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 }
2018-03-08 16:10:53 +00:00
/>
2018-02-20 09:30:36 +00:00
</section>
);
}
2018-04-16 21:19:50 +00:00
export default connect(
(state: State) => {
return {
log: state.log
};
},
(dispatch: Dispatch) => {
return {
2018-05-05 11:52:03 +00:00
acquireDevice: bindActionCreators(TrezorConnectActions.acquire, dispatch),
2018-04-16 21:19:50 +00:00
};
}
)(Acquire);