File size: 798 Bytes
1e92f2d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | import page from '@automattic/calypso-router';
import PropTypes from 'prop-types';
import { Component } from 'react';
import HeaderCake from 'calypso/components/header-cake';
import Main from 'calypso/components/main';
import './style.scss';
class LoadingPlaceholder extends Component {
static propTypes = {
path: PropTypes.string,
title: PropTypes.string.isRequired,
isFullWidth: PropTypes.bool.isRequired,
};
goBack = () => {
page.back( this.props.path || '/' );
};
render() {
return (
<Main wideLayout={ this.props.isFullWidth } className="loading-placeholder">
<HeaderCake className="loading-placeholder__header" onClick={ this.goBack }>
{ this.props.title }
</HeaderCake>
{ this.props.children }
</Main>
);
}
}
export default LoadingPlaceholder;
|