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.
33 lines
989 B
33 lines
989 B
4 years ago
|
import React from 'react';
|
||
|
import { useSelector } from 'react-redux';
|
||
|
import PropTypes from 'prop-types';
|
||
5 years ago
|
|
||
4 years ago
|
import { alertIsOpen as unconnectedAccountAlertIsOpen } from '../../../ducks/alerts/unconnected-account';
|
||
|
import { alertIsOpen as invalidCustomNetworkAlertIsOpen } from '../../../ducks/alerts/invalid-custom-network';
|
||
|
import InvalidCustomNetworkAlert from './invalid-custom-network-alert';
|
||
|
import UnconnectedAccountAlert from './unconnected-account-alert';
|
||
5 years ago
|
|
||
4 years ago
|
const Alerts = ({ history }) => {
|
||
4 years ago
|
const _invalidCustomNetworkAlertIsOpen = useSelector(
|
||
|
invalidCustomNetworkAlertIsOpen,
|
||
4 years ago
|
);
|
||
4 years ago
|
const _unconnectedAccountAlertIsOpen = useSelector(
|
||
|
unconnectedAccountAlertIsOpen,
|
||
4 years ago
|
);
|
||
5 years ago
|
|
||
4 years ago
|
if (_invalidCustomNetworkAlertIsOpen) {
|
||
4 years ago
|
return <InvalidCustomNetworkAlert history={history} />;
|
||
4 years ago
|
}
|
||
5 years ago
|
if (_unconnectedAccountAlertIsOpen) {
|
||
4 years ago
|
return <UnconnectedAccountAlert />;
|
||
5 years ago
|
}
|
||
|
|
||
4 years ago
|
return null;
|
||
|
};
|
||
5 years ago
|
|
||
4 years ago
|
Alerts.propTypes = {
|
||
|
history: PropTypes.object.isRequired,
|
||
4 years ago
|
};
|
||
4 years ago
|
|
||
4 years ago
|
export default Alerts;
|