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.
trezor-wallet/src/js/components/wallet/pages/Acquire.js

48 lines
1.2 KiB

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