mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-31 09:21:27 +00:00
33 lines
816 B
JavaScript
33 lines
816 B
JavaScript
// @flow
|
|
import * as React from 'react';
|
|
import classnames from 'classnames';
|
|
|
|
type Props = {
|
|
children: React.Node,
|
|
pageTitle: ?string,
|
|
noPadding: ?boolean,
|
|
extraPadding: ?boolean,
|
|
notContained: ?boolean, // No max-width, but keep the padding
|
|
};
|
|
|
|
const Page = (props: Props) => {
|
|
const { pageTitle, children, noPadding, extraPadding, notContained } = props;
|
|
return (
|
|
<main
|
|
className={classnames('main', {
|
|
'main--contained': !notContained && !noPadding && !extraPadding,
|
|
'main--no-padding': noPadding,
|
|
'main--extra-padding': extraPadding,
|
|
})}
|
|
>
|
|
{pageTitle && (
|
|
<div className="page__header">
|
|
{pageTitle && <h1 className="page__title">{pageTitle}</h1>}
|
|
</div>
|
|
)}
|
|
{children}
|
|
</main>
|
|
);
|
|
};
|
|
|
|
export default Page;
|