Merge branch 'feat/change-title-based-on-teamName' of https://github.com/MatheusRV/outline into MatheusRV-feat/change-title-based-on-teamName

This commit is contained in:
Tom Moor 2020-07-13 19:13:59 -07:00
commit e859e3b9e0
2 changed files with 13 additions and 5 deletions

View File

@ -97,7 +97,7 @@ class Layout extends React.Component<Props> {
return (
<Container column auto>
<Helmet>
<title>Outline</title>
<title>{team ? `${team.name} Outline` : "Outline"}</title>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"

View File

@ -1,15 +1,23 @@
// @flow
import * as React from "react";
import { observer, inject } from "mobx-react";
import { Helmet } from "react-helmet";
import AuthStore from "stores/AuthStore";
type Props = {
title: string,
favicon?: string,
auth: AuthStore,
};
const PageTitle = ({ title, favicon }: Props) => (
const { auth } = this.props;
const { team } = auth;
const PageTitle = observer(({ auth, title, favicon }: Props) => (
<Helmet>
<title>{`${title} - Outline`}</title>
<title>
{team ? `${title} - ${team.name} - Outline` : `${title} - Outline`}
</title>
<link
rel="shortcut icon"
type="image/png"
@ -18,6 +26,6 @@ const PageTitle = ({ title, favicon }: Props) => (
/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</Helmet>
);
));
export default PageTitle;
export default inject("auth")(PageTitle);