diff --git a/__tests__/index.test.js b/__tests__/index.test.js index d5b82ee..1c45661 100644 --- a/__tests__/index.test.js +++ b/__tests__/index.test.js @@ -1,6 +1,6 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; -import TopicsPage from '../src/app/page'; +import Page from '../src/app/page'; import RootLayout from '../src/app/layout'; import { fetchInterviews } from '../src/data/fetchInterviewData'; diff --git a/prefix.ts b/prefix.ts new file mode 100644 index 0000000..997d890 --- /dev/null +++ b/prefix.ts @@ -0,0 +1,3 @@ +const prefix = process.env.NEXT_PUBLIC_BASE_PATH || ''; + +export { prefix }; diff --git a/src/app/[topic]/page.tsx b/src/app/[path]/[topic]/page.tsx similarity index 59% rename from src/app/[topic]/page.tsx rename to src/app/[path]/[topic]/page.tsx index 0a71aee..aa5b935 100644 --- a/src/app/[topic]/page.tsx +++ b/src/app/[path]/[topic]/page.tsx @@ -1,20 +1,22 @@ import { GetStaticPathsResult } from 'next'; -import { legalTopics, Topic } from '../../config/topics.config'; +import { legalTopics, Topic } from '../../../config/topics.config'; interface PageProps { params: { topic: string; + path: string; }; } const Page = ({ params }: PageProps) => { - const { topic } = params; + const { topic, path } = params; return