mirror of
https://github.com/outline/outline.git
synced 2026-12-05 02:44:34 +03:00
* chore: enable typescript/restrict-template-expressions lint rule Coerce values of unknown type with explicit String() and tighten typing for template literal expressions across the codebase. * fix: restore --line-height on Card for fadeOut ::after gradient
36 lines
867 B
TypeScript
36 lines
867 B
TypeScript
import { observer } from "mobx-react";
|
|
import { Helmet } from "react-helmet-async";
|
|
import env from "~/env";
|
|
import useStores from "~/hooks/useStores";
|
|
import { useTeamContext } from "./TeamContext";
|
|
|
|
type Props = {
|
|
title: string;
|
|
favicon?: string;
|
|
};
|
|
|
|
const originalShortcutHref = document
|
|
.querySelector('link[rel="shortcut icon"]')
|
|
?.getAttribute("href") as string;
|
|
|
|
const PageTitle = ({ title, favicon }: Props) => {
|
|
const { auth } = useStores();
|
|
const team = useTeamContext() ?? auth.team;
|
|
|
|
return (
|
|
<Helmet>
|
|
<title>
|
|
{team?.name ? `${title} - ${team.name}` : `${title} - ${env.APP_NAME}`}
|
|
</title>
|
|
<link
|
|
rel="shortcut icon"
|
|
type="image/png"
|
|
href={favicon ?? originalShortcutHref}
|
|
key={favicon ?? originalShortcutHref}
|
|
/>
|
|
</Helmet>
|
|
);
|
|
};
|
|
|
|
export default observer(PageTitle);
|