saleor-dashboard/src/components/WindowTitle/index.tsx

19 lines
390 B
TypeScript
Raw Normal View History

2019-06-19 14:40:52 +00:00
import * as React from "react";
import { Helmet } from "react-helmet";
import useShop from "@saleor/hooks/useShop";
interface WindowTitleProps {
title: string;
}
export const WindowTitle: React.StatelessComponent<WindowTitleProps> = ({
title
}) => {
const shop = useShop();
return shop === undefined || !title ? null : (
<Helmet title={`${title} | ${shop.name}`} />
);
};