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/components/notifications/Context/components/Account/index.js

40 lines
1.3 KiB

6 years ago
/* @flow */
import * as React from 'react';
import Notification from 'components/Notification';
6 years ago
import type { Props } from '../../index';
// There could be only one account notification
export default (props: Props) => {
const { network, notification } = props.selectedAccount;
if (network && notification.type && notification.title) {
6 years ago
if (notification.type === 'backend') {
// special case: backend is down
// TODO: this is a different component with "auto resolve" button
6 years ago
return (
<Notification
type="error"
title={notification.title}
message={notification.message}
6 years ago
actions={
[{
label: 'Connect',
6 years ago
callback: async () => {
await props.blockchainReconnect(network.shortcut);
6 years ago
},
}]
}
/>
);
6 years ago
}
6 years ago
return (
<Notification
type={notification.type}
title={notification.title}
message={notification.message}
/>
);
6 years ago
}
6 years ago
6 years ago
return null;
};