Files
medusa-store/packages/admin-ui/ui/src/components/seo/index.tsx
T
Kasper Fabricius Kristensen 596566a510 fix(admin-ui): Navigating to tax settings should not break URL (#3989)
* fix navigation to taxes page, and switch out react-helmet with react-helemt-async

* add changeset

* pinpoint react-hot-toast
2023-05-03 13:40:04 +02:00

81 lines
1.5 KiB
TypeScript

import React from "react"
import { Helmet } from "react-helmet-async"
const site = {
siteMetadata: {
title: `Admin`,
description: `The best ecommerce software.`,
author: `@medusajs`,
},
}
function SEO({
description,
lang,
meta = [],
title,
}: {
description?: string
lang?: string
meta?: React.DetailedHTMLProps<
React.MetaHTMLAttributes<HTMLMetaElement>,
HTMLMetaElement
>[]
title: string
}) {
const metaDescription = description || site.siteMetadata.description
return (
<Helmet
htmlAttributes={{
lang,
}}
title={title}
titleTemplate={`%s ${site.siteMetadata.title}`}
meta={[
{
name: `description`,
content: metaDescription,
},
{
property: `og:title`,
content: title,
},
{
property: `og:description`,
content: metaDescription,
},
{
property: `og:type`,
content: `website`,
},
{
name: `twitter:card`,
content: `summary`,
},
{
name: `twitter:creator`,
content: site.siteMetadata.author,
},
{
name: `twitter:title`,
content: title,
},
{
name: `twitter:description`,
content: metaDescription,
},
...meta,
]}
/>
)
}
SEO.defaultProps = {
lang: `en`,
meta: [],
description: ``,
}
export default SEO