2018-03-26 23:32:43 +02:00
|
|
|
// @flow
|
2019-08-27 16:43:42 +02:00
|
|
|
import type { Node } from 'react';
|
|
|
|
import React, { Fragment } from 'react';
|
2018-03-26 23:32:43 +02:00
|
|
|
import classnames from 'classnames';
|
2019-12-18 06:27:08 +01:00
|
|
|
import SideNavigation from 'component/sideNavigation';
|
2019-08-27 16:43:42 +02:00
|
|
|
import Header from 'component/header';
|
2020-05-08 18:48:58 +02:00
|
|
|
import Footer from 'lbrytv/component/footer';
|
2018-03-26 23:32:43 +02:00
|
|
|
|
2019-10-21 00:41:28 +02:00
|
|
|
export const MAIN_CLASS = 'main';
|
2018-03-26 23:32:43 +02:00
|
|
|
type Props = {
|
2019-08-27 16:43:42 +02:00
|
|
|
children: Node | Array<Node>,
|
2019-01-09 19:39:05 +01:00
|
|
|
className: ?string,
|
2019-08-27 16:43:42 +02:00
|
|
|
autoUpdateDownloaded: boolean,
|
|
|
|
isUpgradeAvailable: boolean,
|
2019-10-28 15:04:37 +01:00
|
|
|
authPage: boolean,
|
2020-02-19 07:31:40 +01:00
|
|
|
noHeader: boolean,
|
2020-05-08 18:48:58 +02:00
|
|
|
noFooter: boolean,
|
2018-03-26 23:32:43 +02:00
|
|
|
};
|
|
|
|
|
2019-06-17 22:32:38 +02:00
|
|
|
function Page(props: Props) {
|
2020-05-08 18:48:58 +02:00
|
|
|
const { children, className, authPage = false, noHeader, noFooter } = props;
|
2019-06-17 22:32:38 +02:00
|
|
|
|
2019-08-27 16:43:42 +02:00
|
|
|
return (
|
|
|
|
<Fragment>
|
2020-02-19 07:31:40 +01:00
|
|
|
{!noHeader && <Header authHeader={authPage} />}
|
2019-08-27 16:43:42 +02:00
|
|
|
<div className={classnames('main-wrapper__inner')}>
|
2019-10-21 00:41:28 +02:00
|
|
|
<main className={classnames(MAIN_CLASS, className, { 'main--full-width': authPage })}>{children}</main>
|
2020-04-02 19:02:12 +02:00
|
|
|
{!authPage && !noHeader && <SideNavigation />}
|
2019-08-27 16:43:42 +02:00
|
|
|
</div>
|
2020-05-08 18:48:58 +02:00
|
|
|
{/* @if TARGET='web' */}
|
|
|
|
{!noFooter && <Footer />}
|
|
|
|
{/* @endif */}
|
2019-08-27 16:43:42 +02:00
|
|
|
</Fragment>
|
|
|
|
);
|
2018-05-07 06:50:55 +02:00
|
|
|
}
|
|
|
|
|
2018-03-26 23:32:43 +02:00
|
|
|
export default Page;
|