Because of mismatched redux versions between NotificationPortal and our app, the former couldn't automatically discover the store. Also drop reregister of notificationsReducer, we already register it in store.
33 lines
908 B
JavaScript
33 lines
908 B
JavaScript
import React, { useEffect } from 'react';
|
|
import { useStore } from 'react-redux';
|
|
import { useNavigate } from 'react-router-dom';
|
|
import '@patternfly/patternfly/patternfly-addons.css';
|
|
import NotificationsPortal from '@redhat-cloud-services/frontend-components-notifications/NotificationPortal';
|
|
|
|
import { Router } from './Router';
|
|
|
|
const App = (props) => {
|
|
const navigate = useNavigate();
|
|
const store = useStore();
|
|
|
|
useEffect(() => {
|
|
document.title = 'Image Builder | Red Hat Insights';
|
|
insights.chrome.init();
|
|
insights.chrome.identifyApp('image-builder');
|
|
const unregister = insights.chrome.on('APP_NAVIGATION', (event) =>
|
|
navigate(`/${event.navId}`)
|
|
);
|
|
return () => {
|
|
unregister();
|
|
};
|
|
}, []);
|
|
|
|
return (
|
|
<React.Fragment>
|
|
<NotificationsPortal store={store} />
|
|
<Router childProps={props} />
|
|
</React.Fragment>
|
|
);
|
|
};
|
|
|
|
export default App;
|