alpinesmuseum-public/assets/js/components/AppContent/AppContent.js

32 lines
893 B
JavaScript

import React, { Component } from 'react';
import ContentHeader from './ContentHeader';
import ContentBodyContainer from './ContentBodyContainer';
import ContentOverlayContainer from './ContentOverlayContainer';
import PreLaunchPage from './PreLaunchPage';
import animateScrollTo from 'animated-scroll-to';
export default class AppContent extends Component {
componentDidMount() {
const { isPreLaunch, getMode } = this.props;
animateScrollTo(document.getElementById('root'));
if (isPreLaunch === undefined) {
getMode();
return null;
}
}
render() {
const { isPreLaunch } = this.props;
return (
<div className={`AppContent${isPreLaunch ? ' is-pre-launch' : ''}`}>
<ContentHeader isPreLaunch={isPreLaunch} />
{!isPreLaunch && <ContentBodyContainer />}
{!isPreLaunch && <ContentOverlayContainer />}
{isPreLaunch && <PreLaunchPage />}
</div>
);
}
}