Merge branch 'master' of http://49.232.154.205:10100/DeXun/fad-trade-next
This commit is contained in:
@@ -16,11 +16,12 @@ const options = {
|
||||
},
|
||||
};
|
||||
|
||||
async function getMDXContent(locale: string) {
|
||||
async function getMDXContent(locale: string, section: string) {
|
||||
const filePath = path.join(
|
||||
process.cwd(),
|
||||
"content",
|
||||
"about",
|
||||
section,
|
||||
`${locale}.mdx`
|
||||
);
|
||||
try {
|
||||
@@ -56,9 +57,18 @@ export async function generateMetadata({
|
||||
});
|
||||
}
|
||||
|
||||
export default async function AboutPage({ params }: { params: Params }) {
|
||||
export default async function AboutPage({
|
||||
params,
|
||||
searchParams
|
||||
}: {
|
||||
params: Params;
|
||||
searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
|
||||
}) {
|
||||
const { locale } = await params;
|
||||
const content = await getMDXContent(locale);
|
||||
const resolvedSearchParams = await searchParams;
|
||||
const section = (resolvedSearchParams.section as string) || "company";
|
||||
|
||||
const content = await getMDXContent(locale, section);
|
||||
|
||||
return (
|
||||
<article className="w-full md:w-3/5 px-2 md:px-12">
|
||||
@@ -75,4 +85,4 @@ export async function generateStaticParams() {
|
||||
return LOCALES.map((locale) => ({
|
||||
locale,
|
||||
}));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user