ServerNotification rendered in App.js

This commit is contained in:
svetlagasheva 2021-06-23 19:19:25 +03:00
parent f05059e548
commit 320b276959
3 changed files with 3 additions and 11 deletions

View file

@ -5,7 +5,7 @@ const React = require('react');
const { Router } = require('stremio-router');
const { Core, Shell, Chromecast, KeyboardShortcuts, ServicesProvider } = require('stremio/services');
const { NotFound } = require('stremio/routes');
const { ToastProvider, sanitizeLocationPath, CONSTANTS } = require('stremio/common');
const { ToastProvider, ServerNotification, sanitizeLocationPath, CONSTANTS } = require('stremio/common');
const CoreEventsToaster = require('./CoreEventsToaster');
const routerViewsConfig = require('./routerViewsConfig');
const styles = require('./styles');
@ -98,6 +98,7 @@ const App = () => {
:
<div className={styles['app-loader']} />
}
<ServerNotification />
</ServicesProvider>
</React.StrictMode>
);

View file

@ -7,9 +7,9 @@
right: 0;
bottom: 0;
left: 0;
z-index: 1;
display: flex;
flex-direction: row;
align-items: center;
padding: 0.5rem 1rem;
background-color: @color-accent3;

View file

@ -3,23 +3,14 @@
const React = require('react');
const PropTypes = require('prop-types');
const { ModalsContainerProvider } = require('../ModalsContainerContext');
const ServerNotification = require('../../common/ServerNotification');
const UrlUtils = require('url');
const Route = ({ children }) => {
const { pathname } = UrlUtils.parse(window.location.hash.slice(1));
return (
<div className={'route-container'}>
<ModalsContainerProvider>
<div className={'route-content'}>
{children}
</div>
{
pathname !== null && (pathname === '/' || pathname.startsWith('/discover') || pathname.startsWith('/library')) ?
<ServerNotification />
:
null
}
</ModalsContainerProvider>
</div>
);