1
0
mirror of https://github.com/trezor/trezor-wallet synced 2025-07-06 06:42:34 +00:00

Show loader after 'Acquire Device' button is clicked and is waiting for acquire

This commit is contained in:
Vasek Mlejnsky 2018-08-02 15:19:26 +02:00
parent cc507f8ae8
commit 6349254e45
5 changed files with 30 additions and 12 deletions

View File

@ -8,7 +8,7 @@ export default (props: { size: string, label?: string, className?: string }): Re
const style = {
width: `${props.size}px`,
height: `${props.size}px`,
};
}
return (
<div className={ className } style={style}>

View File

@ -5,6 +5,8 @@ import React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import Loader from '../common/LoaderCircle';
import * as NOTIFICATION from '~/js/actions/constants/notification';
import * as NotificationActions from '~/js/actions/NotificationActions';
import type { Action, State, Dispatch } from '~/flowtype';

View File

@ -23,16 +23,32 @@ const Acquire = (props: Props) => {
},
},
];
const acquireDeviceAction = {
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}
/>
{props.acquiring ? (
<Notification
title="Device is being acquired"
message="Please wait"
className="loading"
cancelable={false}
loading={true}
/>
) : (
<Notification
title="Device is used in other window"
message="Do you want to use your device in this window?"
className="info"
cancelable={ false }
actions={ [acquireDeviceAction] }
/>
)}
</section>
);
};