2017-05-26 19:56:10 +00:00
|
|
|
// @flow
|
2021-01-16 19:12:10 +00:00
|
|
|
import { observer } from "mobx-react";
|
2020-08-09 05:53:59 +00:00
|
|
|
import * as React from "react";
|
2020-06-20 20:59:15 +00:00
|
|
|
import { Helmet } from "react-helmet";
|
2021-09-11 05:46:57 +00:00
|
|
|
import { cdnPath } from "../../shared/utils/urls";
|
2021-01-16 19:12:10 +00:00
|
|
|
import useStores from "hooks/useStores";
|
2017-05-26 19:56:10 +00:00
|
|
|
|
2021-01-16 19:12:10 +00:00
|
|
|
type Props = {|
|
2017-05-26 19:56:10 +00:00
|
|
|
title: string,
|
2018-06-10 00:17:40 +00:00
|
|
|
favicon?: string,
|
2021-01-16 19:12:10 +00:00
|
|
|
|};
|
2017-05-26 19:56:10 +00:00
|
|
|
|
2021-01-16 19:12:10 +00:00
|
|
|
const PageTitle = ({ title, favicon }: Props) => {
|
|
|
|
const { auth } = useStores();
|
2020-07-14 02:41:42 +00:00
|
|
|
const { team } = auth;
|
2020-06-29 20:01:34 +00:00
|
|
|
|
2020-07-14 02:41:42 +00:00
|
|
|
return (
|
|
|
|
<Helmet>
|
|
|
|
<title>
|
|
|
|
{team && team.name ? `${title} - ${team.name}` : `${title} - Outline`}
|
|
|
|
</title>
|
2021-04-24 06:24:54 +00:00
|
|
|
{favicon ? (
|
|
|
|
<link rel="shortcut icon" href={favicon} />
|
|
|
|
) : (
|
|
|
|
<link
|
|
|
|
rel="shortcut icon"
|
|
|
|
type="image/png"
|
|
|
|
href={cdnPath("/favicon-32.png")}
|
|
|
|
sizes="32x32"
|
|
|
|
/>
|
|
|
|
)}
|
2020-07-14 02:41:42 +00:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
|
</Helmet>
|
|
|
|
);
|
2021-01-16 19:12:10 +00:00
|
|
|
};
|
2017-05-26 19:56:10 +00:00
|
|
|
|
2021-01-16 19:12:10 +00:00
|
|
|
export default observer(PageTitle);
|