refactor: remove useless config for absolute paths and improve components exports
This commit is contained in:
parent
f46690690c
commit
9d672e3cf3
@ -1,9 +1,9 @@
|
||||
// eslint-disable-next-line @next/next/no-document-import-in-page
|
||||
import { Head } from 'next/document'
|
||||
|
||||
import { projectConfig } from '@/utils/config'
|
||||
import { projectConfig } from 'utils/config'
|
||||
|
||||
const CommonHead = (): JSX.Element => {
|
||||
export const CommonHead = (): JSX.Element => {
|
||||
return (
|
||||
<Head>
|
||||
{/* Link Tags */}
|
||||
@ -62,5 +62,3 @@ const CommonHead = (): JSX.Element => {
|
||||
</Head>
|
||||
)
|
||||
}
|
||||
|
||||
export default CommonHead
|
||||
|
@ -1,6 +1,6 @@
|
||||
import Head from 'next/head'
|
||||
|
||||
import { projectConfig } from '@/utils/config'
|
||||
import { projectConfig } from 'utils/config'
|
||||
|
||||
interface HeadProps {
|
||||
longName?: string
|
||||
@ -10,8 +10,7 @@ interface HeadProps {
|
||||
const NextHead: React.FC<HeadProps> = (props) => {
|
||||
const {
|
||||
longName = projectConfig.longName,
|
||||
shortName = projectConfig.shortName,
|
||||
children
|
||||
shortName = projectConfig.shortName
|
||||
} = props
|
||||
|
||||
return (
|
||||
@ -23,8 +22,6 @@ const NextHead: React.FC<HeadProps> = (props) => {
|
||||
</title>
|
||||
|
||||
<meta name='viewport' content='width=device-width, initial-scale=1.0' />
|
||||
|
||||
{children}
|
||||
</Head>
|
||||
)
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import Document, { Html, Main, NextScript } from 'next/document'
|
||||
|
||||
import CommonHead from '@/components/Head/CommonHead'
|
||||
import { CommonHead } from 'components/Head/CommonHead'
|
||||
|
||||
class MyDocument extends Document {
|
||||
render(): JSX.Element {
|
||||
|
@ -17,11 +17,7 @@
|
||||
"resolveJsonModule": true,
|
||||
"moduleResolution": "node",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"paths": {
|
||||
"@/components/*": ["components/*"],
|
||||
"@/utils/*": ["utils/*"]
|
||||
}
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
|
||||
"exclude": ["dist", ".next", "out", "next.config.js"]
|
||||
|
Loading…
Reference in New Issue
Block a user