From 3c37889971c49a2274f9879314ab5b8815e84fa1 Mon Sep 17 00:00:00 2001 From: lytrankieio123 Date: Fri, 20 Aug 2021 17:52:35 +0700 Subject: [PATCH 1/2] refactor: move Head to src/common --- pages/_app.tsx | 16 ++++++++-------- src/components/common/Head/Head.tsx | 18 ++++++++++++++++++ src/components/common/index.ts | 1 + 3 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 src/components/common/Head/Head.tsx diff --git a/pages/_app.tsx b/pages/_app.tsx index d87626806..bd7f0f066 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,10 +1,10 @@ -import '../src/styles/main.scss' -import 'keen-slider/keen-slider.min.css' +import { ThemeProvider } from 'next-themes'; +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} @@ -18,11 +18,11 @@ export default function MyApp({ Component, pageProps }: AppProps) { return ( <> - + - + ) } diff --git a/src/components/common/Head/Head.tsx b/src/components/common/Head/Head.tsx new file mode 100644 index 000000000..b2c0c997b --- /dev/null +++ b/src/components/common/Head/Head.tsx @@ -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 ( + <> + + + + + + + ) +} + +export default Head diff --git a/src/components/common/index.ts b/src/components/common/index.ts index 4911a0637..ef0feda5c 100644 --- a/src/components/common/index.ts +++ b/src/components/common/index.ts @@ -1,3 +1,4 @@ export { default as ButtonCommon } from './ButtonCommon/ButtonCommon' export { default as Layout } from './Layout/Layout' +export { default as Head } from './Head/Head' From 7613ef85817a60587fae7b70d26b4831d166e755 Mon Sep 17 00:00:00 2001 From: lytrankieio123 Date: Fri, 20 Aug 2021 17:53:06 +0700 Subject: [PATCH 2/2] config: enable noUnusedLocals in tsconfig --- tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tsconfig.json b/tsconfig.json index 72608f830..6a08e59f8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,6 +15,7 @@ "isolatedModules": true, "jsx": "preserve", "incremental": true, + "noUnusedLocals": true, "paths": { "@lib/*": ["lib/*"], "@utils/*": ["utils/*"],