Merge branch 'MatheusRV-feat/change-title-based-on-teamName' into develop

This commit is contained in:
Tom Moor
2020-07-13 19:42:57 -07:00
2 changed files with 23 additions and 14 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 ? team.name : "Outline"}</title>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"

View File

@ -1,23 +1,32 @@
// @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) => (
<Helmet>
<title>{`${title} - Outline`}</title>
<link
rel="shortcut icon"
type="image/png"
href={favicon || "/favicon-32.png"}
sizes="32x32"
/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</Helmet>
);
const PageTitle = observer(({ auth, title, favicon }: Props) => {
const { team } = auth;
export default PageTitle;
return (
<Helmet>
<title>
{team && team.name ? `${title} - ${team.name}` : `${title} - Outline`}
</title>
<link
rel="shortcut icon"
type="image/png"
href={favicon || "/favicon-32.png"}
sizes="32x32"
/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</Helmet>
);
});
export default inject("auth")(PageTitle);