Removes some Backbone views
This commit is contained in:
parent
93bc094342
commit
94d116c621
22 changed files with 160 additions and 656 deletions
|
@ -1,4 +1,4 @@
|
|||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import classNames from 'classnames';
|
||||
|
||||
import { AppViewType } from '../state/ducks/app';
|
||||
|
@ -10,12 +10,16 @@ import { ThemeType } from '../types/Util';
|
|||
export type PropsType = {
|
||||
appView: AppViewType;
|
||||
hasInitialLoadCompleted: boolean;
|
||||
renderCallManager: () => JSX.Element;
|
||||
renderGlobalModalContainer: () => JSX.Element;
|
||||
theme: ThemeType;
|
||||
};
|
||||
|
||||
export const App = ({
|
||||
appView,
|
||||
hasInitialLoadCompleted,
|
||||
renderCallManager,
|
||||
renderGlobalModalContainer,
|
||||
theme,
|
||||
}: PropsType): JSX.Element => {
|
||||
let contents;
|
||||
|
@ -28,6 +32,20 @@ export const App = ({
|
|||
contents = <Inbox hasInitialLoadCompleted={hasInitialLoadCompleted} />;
|
||||
}
|
||||
|
||||
// This is here so that themes are properly applied to anything that is
|
||||
// created in a portal and exists outside of the <App /> container.
|
||||
useEffect(() => {
|
||||
document.body.classList.remove('light-theme');
|
||||
document.body.classList.remove('dark-theme');
|
||||
|
||||
if (theme === ThemeType.dark) {
|
||||
document.body.classList.add('dark-theme');
|
||||
}
|
||||
if (theme === ThemeType.light) {
|
||||
document.body.classList.add('light-theme');
|
||||
}
|
||||
}, [theme]);
|
||||
|
||||
return (
|
||||
<div
|
||||
className={classNames({
|
||||
|
@ -36,6 +54,8 @@ export const App = ({
|
|||
'dark-theme': theme === ThemeType.dark,
|
||||
})}
|
||||
>
|
||||
{renderGlobalModalContainer()}
|
||||
{renderCallManager()}
|
||||
{contents}
|
||||
</div>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue