1
0
mirror of https://github.com/trezor/trezor-wallet synced 2025-07-13 10:08:09 +00:00
trezor-wallet/src/components/notifications/Context/components/Account/index.js
2018-10-01 15:10:06 +02:00

36 lines
1.3 KiB
JavaScript

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