mirror of
https://github.com/trezor/trezor-wallet
synced 2024-12-29 02:18:06 +00:00
Added loading state for acquire button
This commit is contained in:
parent
e750fc2da6
commit
cbbcf1f4d1
@ -19,6 +19,7 @@ type Props = {
|
||||
className?: string;
|
||||
message?: ?string;
|
||||
actions?: Array<CallbackAction>;
|
||||
isActionInProgress?: boolean;
|
||||
close?: typeof NotificationActions.close,
|
||||
loading?: boolean
|
||||
};
|
||||
@ -122,6 +123,7 @@ const Notification = (props: Props): React$Element<string> => {
|
||||
<NotificationButton
|
||||
key={action.label}
|
||||
type={props.type}
|
||||
isLoading={props.isActionInProgress}
|
||||
onClick={() => { close(); action.callback(); }}
|
||||
>{action.label}
|
||||
</NotificationButton>
|
||||
|
@ -21,28 +21,27 @@ const Wrapper = styled.div`
|
||||
flex: 1;
|
||||
`;
|
||||
|
||||
const Acquire = (props: Props) => {
|
||||
const actions = props.acquiring ? [] : [
|
||||
{
|
||||
label: 'Acquire device',
|
||||
callback: () => {
|
||||
props.acquireDevice();
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
const Acquire = (props: Props) => (
|
||||
<Wrapper>
|
||||
<Notification
|
||||
title="Device is used in other window"
|
||||
message="Do you want to use your device in this window?"
|
||||
type="info"
|
||||
cancelable={false}
|
||||
actions={actions}
|
||||
isActionInProgress={props.acquiring}
|
||||
actions={
|
||||
[
|
||||
{
|
||||
label: 'Acquire device',
|
||||
callback: () => {
|
||||
props.acquireDevice();
|
||||
},
|
||||
},
|
||||
]
|
||||
}
|
||||
/>
|
||||
</Wrapper>
|
||||
);
|
||||
};
|
||||
|
||||
export default connect(
|
||||
(state: State) => ({
|
||||
|
Loading…
Reference in New Issue
Block a user