2018-10-03 19:42:20 -07:00
|
|
|
import React from 'react';
|
2018-12-03 18:08:29 -08:00
|
|
|
import { Layout } from 'antd';
|
2018-10-03 19:42:20 -07:00
|
|
|
import classnames from 'classnames';
|
|
|
|
import BasicHead from 'components/BasicHead';
|
|
|
|
import Header from 'components/Header';
|
|
|
|
import Footer from 'components/Footer';
|
|
|
|
import './index.less';
|
|
|
|
|
|
|
|
export interface TemplateProps {
|
|
|
|
title: string;
|
|
|
|
isHeaderTransparent?: boolean;
|
|
|
|
isFullScreen?: boolean;
|
|
|
|
hideFooter?: boolean;
|
|
|
|
}
|
|
|
|
|
2019-01-17 22:40:30 -08:00
|
|
|
type Props = TemplateProps;
|
2018-10-03 19:42:20 -07:00
|
|
|
|
2019-01-17 22:40:30 -08:00
|
|
|
export default class Template extends React.PureComponent<Props> {
|
2018-10-03 19:42:20 -07:00
|
|
|
render() {
|
2019-01-17 22:40:30 -08:00
|
|
|
const { children, title, isHeaderTransparent, isFullScreen, hideFooter } = this.props;
|
2018-10-03 19:42:20 -07:00
|
|
|
|
2019-01-17 22:40:30 -08:00
|
|
|
const content = children;
|
|
|
|
const isCentered = false;
|
2018-10-03 19:42:20 -07:00
|
|
|
|
|
|
|
const className = classnames(
|
|
|
|
'Template',
|
|
|
|
isFullScreen && 'is-fullscreen',
|
|
|
|
isCentered && 'is-centered',
|
|
|
|
);
|
|
|
|
return (
|
|
|
|
<BasicHead title={title}>
|
2019-03-12 20:08:50 -07:00
|
|
|
{!isHeaderTransparent && (
|
|
|
|
<noscript className="noScript is-banner">
|
|
|
|
It looks like you have Javascript disabled. You may experience issues with
|
|
|
|
interactive parts of the site.
|
|
|
|
</noscript>
|
|
|
|
)}
|
2018-10-03 19:42:20 -07:00
|
|
|
<div className={className}>
|
|
|
|
<Header isTransparent={isHeaderTransparent} />
|
|
|
|
<Layout.Content className="Template-content">
|
|
|
|
<div className="Template-content-inner">{content}</div>
|
|
|
|
</Layout.Content>
|
|
|
|
{!hideFooter && <Footer />}
|
|
|
|
</div>
|
|
|
|
</BasicHead>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|