mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
ServerNotification rendered in App.js
This commit is contained in:
parent
f05059e548
commit
320b276959
3 changed files with 3 additions and 11 deletions
|
|
@ -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>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue