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

7 years ago
/* @flow */
7 years ago
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';
7 years ago
import type { State, Dispatch } from '~/flowtype';
type Props = {
acquiring: boolean;
acquireDevice: typeof TrezorConnectActions.acquire
}
const Acquire = (props: Props) => {
const actions = props.acquiring ? [] : [
7 years ago
{
label: 'Acquire device',
callback: () => {
props.acquireDevice();
},
},
7 years ago
];
7 years ago
return (
<section className="acquire">
<Notification
7 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}
7 years ago
/>
7 years ago
</section>
);
};
7 years ago
export default connect(
(state: State) => ({
acquiring: state.connect.acquiring,
}),
(dispatch: Dispatch) => ({
acquireDevice: bindActionCreators(TrezorConnectActions.acquire, dispatch),
}),
)(Acquire);