mirror of
https://github.com/vercel/commerce.git
synced 2025-07-04 04:01:21 +00:00
refactor: move Head to src/common
This commit is contained in:
parent
ef1c53b3a9
commit
3c37889971
@ -1,10 +1,10 @@
|
|||||||
import '../src/styles/main.scss'
|
import { ThemeProvider } from 'next-themes';
|
||||||
import 'keen-slider/keen-slider.min.css'
|
import type { AppProps } from 'next/app';
|
||||||
|
import React, { FC, useEffect } from 'react';
|
||||||
|
import { Head } from 'src/components/common';
|
||||||
|
import 'keen-slider/keen-slider.min.css';
|
||||||
|
import '../src/styles/main.scss';
|
||||||
|
|
||||||
import { FC, useEffect } from 'react'
|
|
||||||
import type { AppProps } from 'next/app'
|
|
||||||
import { Head } from '@components/common'
|
|
||||||
import { ManagedUIContext } from '@components/ui/context'
|
|
||||||
|
|
||||||
const Noop: FC = ({ children }) => <>{children}</>
|
const Noop: FC = ({ children }) => <>{children}</>
|
||||||
|
|
||||||
@ -18,11 +18,11 @@ export default function MyApp({ Component, pageProps }: AppProps) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Head />
|
<Head />
|
||||||
<ManagedUIContext>
|
<ThemeProvider>
|
||||||
<Layout pageProps={pageProps}>
|
<Layout pageProps={pageProps}>
|
||||||
<Component {...pageProps} />
|
<Component {...pageProps} />
|
||||||
</Layout>
|
</Layout>
|
||||||
</ManagedUIContext>
|
</ThemeProvider>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
18
src/components/common/Head/Head.tsx
Normal file
18
src/components/common/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,3 +1,4 @@
|
|||||||
export { default as ButtonCommon } from './ButtonCommon/ButtonCommon'
|
export { default as ButtonCommon } from './ButtonCommon/ButtonCommon'
|
||||||
export { default as Layout } from './Layout/Layout'
|
export { default as Layout } from './Layout/Layout'
|
||||||
|
export { default as Head } from './Head/Head'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user