diff --git a/next.config.js b/next.config.js index 8eedf80..ccf41ec 100644 --- a/next.config.js +++ b/next.config.js @@ -1,6 +1,7 @@ // @ts-check const withNextIntl = require('next-intl/plugin')(); const path = require('path'); +const json = require('./package.json'); /** @type {import('next').NextConfig} */ const nextConfig = { @@ -14,6 +15,9 @@ const nextConfig = { sassOptions: { includePaths: [path.join(__dirname, 'styles')], }, + env: { + version: json.version + }, typescript: { // !! WARN !! // Dangerously allow production builds to successfully complete even if diff --git a/src/app/[locale]/layout.tsx b/src/app/[locale]/layout.tsx index 520e6ae..3ab1d50 100644 --- a/src/app/[locale]/layout.tsx +++ b/src/app/[locale]/layout.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode } from 'react'; +import React, { ReactNode, Suspense } from 'react'; import { Metadata } from 'next'; import { unstable_setRequestLocale } from 'next-intl/server'; import { notFound } from 'next/navigation'; @@ -6,7 +6,7 @@ import { ConfigProvider } from 'antd'; import { AntdRegistry } from '@ant-design/nextjs-registry'; import theme from '../../constants/theme'; import { ALLOWED_LOCALES } from '../../constants/locale'; -import { Header, Footer } from '../../components/Page'; +import { Header, Footer, AppConfig } from '../../components/Page'; type LayoutProps = { children: ReactNode; @@ -30,6 +30,9 @@ export default function LocaleLayout({ children, params: { locale } }: LayoutPro
+ + +
{children} diff --git a/src/components/Page/AppConfig.tsx b/src/components/Page/AppConfig.tsx new file mode 100644 index 0000000..56a44da --- /dev/null +++ b/src/components/Page/AppConfig.tsx @@ -0,0 +1,11 @@ +'use client' + +import { useEffect } from 'react'; + +export const AppConfig = () => { + useEffect(() => { + console.log('AppVersion', process.env.version); + }, []); + + return null; +}; diff --git a/src/components/Page/index.ts b/src/components/Page/index.ts index c732478..6059d1b 100644 --- a/src/components/Page/index.ts +++ b/src/components/Page/index.ts @@ -1,3 +1,4 @@ export * from './Header'; export * from './Footer'; export * from './GeneralTopSection'; +export * from './AppConfig';