2020-06-15 18:10:06 +02:00
|
|
|
import React from 'react';
|
|
|
|
import { Navbar } from './Navbar';
|
|
|
|
|
|
|
|
export interface PageProps {
|
|
|
|
title?: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Page extends React.PureComponent<PageProps> {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<React.Fragment>
|
|
|
|
<Navbar />
|
|
|
|
{this.props.children}
|
|
|
|
</React.Fragment>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
this.updateTitle();
|
|
|
|
}
|
|
|
|
|
|
|
|
componentDidUpdate() {
|
|
|
|
this.updateTitle();
|
|
|
|
}
|
|
|
|
|
|
|
|
updateTitle() {
|
|
|
|
const { title } = this.props;
|
2020-07-16 20:21:58 +02:00
|
|
|
if (title !== undefined) window.document.title = title + ' - Daddy';
|
2020-06-15 18:10:06 +02:00
|
|
|
}
|
|
|
|
}
|