refactor: remove useless config for absolute paths and improve components exports

This commit is contained in:
Walid 2022-04-12 14:47:21 +00:00
parent f46690690c
commit 9d672e3cf3
No known key found for this signature in database
GPG Key ID: 4BDA1ABD227F9279
4 changed files with 6 additions and 15 deletions

View File

@ -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

View File

@ -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>
)
}

View File

@ -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 {

View File

@ -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"]