mirror of
https://github.com/vercel/commerce.git
synced 2025-05-05 17:27:51 +00:00
UI Provider
This commit is contained in:
parent
8737f70b97
commit
ae43c92661
18
components/core/Head/Head.tsx
Normal file
18
components/core/Head/Head.tsx
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import { FC } from 'react'
|
||||||
|
import NextHead from 'next/head'
|
||||||
|
import { DefaultSeo } from 'next-seo'
|
||||||
|
import config from '@config/seo.json'
|
||||||
|
|
||||||
|
const Head: FC = () => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<DefaultSeo {...config} />
|
||||||
|
<NextHead>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<link rel="manifest" href="/site.webmanifest" key="site-manifest" />
|
||||||
|
</NextHead>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Head
|
1
components/core/Head/index.ts
Normal file
1
components/core/Head/index.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export { default } from './Head'
|
@ -6,3 +6,4 @@ export { default as Navbar } from './Navbar'
|
|||||||
export { default as Searchbar } from './Searchbar'
|
export { default as Searchbar } from './Searchbar'
|
||||||
export { default as UserNav } from './UserNav'
|
export { default as UserNav } from './UserNav'
|
||||||
export { default as Toggle } from './Toggle'
|
export { default as Toggle } from './Toggle'
|
||||||
|
export { default as Head } from './Head'
|
||||||
|
18
config.json
18
config.json
@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"seo": {
|
|
||||||
"title": "ACME Storefront | Powered by Next.js Commerce",
|
|
||||||
"titleTemplate": "%s - ACME Storefront",
|
|
||||||
"description": "Next.js Commerce -> https://www.nextjs.org/commerce",
|
|
||||||
"openGraph": {
|
|
||||||
"type": "website",
|
|
||||||
"locale": "en_IE",
|
|
||||||
"url": "https://nextjs.org/commerce",
|
|
||||||
"site_name": "Next.js Commerce"
|
|
||||||
},
|
|
||||||
"twitter": {
|
|
||||||
"handle": "@nextjs",
|
|
||||||
"site": "@nextjs",
|
|
||||||
"cardType": "summary_large_image"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
16
config/seo.json
Normal file
16
config/seo.json
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"title": "ACME Storefront | Powered by Next.js Commerce",
|
||||||
|
"titleTemplate": "%s - ACME Storefront",
|
||||||
|
"description": "Next.js Commerce -> https://www.nextjs.org/commerce",
|
||||||
|
"openGraph": {
|
||||||
|
"type": "website",
|
||||||
|
"locale": "en_IE",
|
||||||
|
"url": "https://nextjs.org/commerce",
|
||||||
|
"site_name": "Next.js Commerce"
|
||||||
|
},
|
||||||
|
"twitter": {
|
||||||
|
"handle": "@nextjs",
|
||||||
|
"site": "@nextjs",
|
||||||
|
"cardType": "summary_large_image"
|
||||||
|
}
|
||||||
|
}
|
@ -3,11 +3,9 @@ import '@assets/tailwind.css'
|
|||||||
import '@assets/utils.css'
|
import '@assets/utils.css'
|
||||||
import 'animate.css'
|
import 'animate.css'
|
||||||
import { FC } from 'react'
|
import { FC } from 'react'
|
||||||
import { DefaultSeo } from 'next-seo'
|
|
||||||
import type { AppProps } from 'next/app'
|
import type { AppProps } from 'next/app'
|
||||||
|
|
||||||
import config from '../config.json'
|
|
||||||
import Head from 'next/head'
|
|
||||||
import { CommerceProvider } from '@lib/bigcommerce'
|
import { CommerceProvider } from '@lib/bigcommerce'
|
||||||
|
|
||||||
const Noop: FC = ({ children }) => <>{children}</>
|
const Noop: FC = ({ children }) => <>{children}</>
|
||||||
@ -17,11 +15,6 @@ export default function MyApp({ Component, pageProps }: AppProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Head>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
||||||
<link rel="manifest" href="/site.webmanifest" key="site-manifest" />
|
|
||||||
</Head>
|
|
||||||
<DefaultSeo {...config.seo} />
|
|
||||||
<CommerceProvider locale="en-us">
|
<CommerceProvider locale="en-us">
|
||||||
<Layout>
|
<Layout>
|
||||||
<Component {...pageProps} />
|
<Component {...pageProps} />
|
||||||
|
@ -18,7 +18,8 @@
|
|||||||
"@lib/*": ["lib/*"],
|
"@lib/*": ["lib/*"],
|
||||||
"@assets/*": ["assets/*"],
|
"@assets/*": ["assets/*"],
|
||||||
"@components/*": ["components/*"],
|
"@components/*": ["components/*"],
|
||||||
"@utils/*": ["utils/*"]
|
"@utils/*": ["utils/*"],
|
||||||
|
"@config/*": ["config/*"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"],
|
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user