Update document title via Page component
This commit is contained in:
parent
a7297e3d12
commit
29f44f8c75
|
@ -33,8 +33,9 @@ export class BoardPage extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { board } = this.props;
|
||||
return (
|
||||
<Page>
|
||||
<Page title={`${board ? (board.title + ' - ') : ''}GenGitKan`}>
|
||||
<div className="container is-fluid">
|
||||
{this.renderBoard()}
|
||||
</div>
|
||||
|
|
|
@ -9,7 +9,7 @@ import { selectBoardByUserProjects } from '../../store/selectors/boards';
|
|||
export class HomePage extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<Page>
|
||||
<Page title="GenGitKan - Accueil">
|
||||
<div className="container is-fluid">
|
||||
<div className="level has-margin-top-normal">
|
||||
<div className="level-left"></div>
|
||||
|
|
|
@ -10,4 +10,17 @@ export class Page extends React.PureComponent {
|
|||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.updateTitle();
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
this.updateTitle();
|
||||
}
|
||||
|
||||
updateTitle() {
|
||||
const { title } = this.props;
|
||||
if (title !== undefined) window.document.title = title;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue