lbry-desktop/src/ui/component/page/view.jsx

33 lines
913 B
React
Raw Normal View History

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-08-27 16:43:42 +02:00
import SideBar from 'component/sideBar';
import Header from 'component/header';
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,
fullscreen: boolean,
2019-09-26 18:07:11 +02:00
authenticated: boolean,
2018-03-26 23:32:43 +02:00
};
2019-06-17 22:32:38 +02:00
function Page(props: Props) {
2019-09-26 18:07:11 +02:00
const { children, className, fullscreen = false, authenticated } = props;
const obscureSideBar = IS_WEB ? !authenticated : false;
2019-06-17 22:32:38 +02:00
2019-08-27 16:43:42 +02:00
return (
<Fragment>
<Header minimal={fullscreen} />
<div className={classnames('main-wrapper__inner')}>
2019-09-26 18:07:11 +02:00
<main className={classnames('main', className, { 'main--full-width': fullscreen })}>{children}</main>
{!fullscreen && <SideBar obscureSideBar={obscureSideBar} />}
2019-08-27 16:43:42 +02:00
</div>
</Fragment>
);
}
2018-03-26 23:32:43 +02:00
export default Page;