saleor-dashboard/src/components/WindowTitle/index.tsx
2019-11-07 12:34:54 +01:00

16 lines
367 B
TypeScript

import React from "react";
import { Helmet } from "react-helmet";
import useShop from "@saleor/hooks/useShop";
interface WindowTitleProps {
title: string;
}
export const WindowTitle: React.FC<WindowTitleProps> = ({ title }) => {
const shop = useShop();
return shop === undefined || !title ? null : (
<Helmet title={`${title} | ${shop.name}`} />
);
};