Skip to content

Commit

Permalink
Merge pull request #15 from acm-ucr/carlahauu/course-name
Browse files Browse the repository at this point in the history
Created Course Name Component
  • Loading branch information
shahdivyank authored Oct 30, 2024
2 parents 69ee501 + 81299e4 commit dbfbe3c
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const nextConfig = {
},
basePath: "",
assetPrefix: "",
trailingSlash: true,
};

module.exports = nextConfig;
24 changes: 24 additions & 0 deletions src/app/course/[name]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import Name from "@/components/course/name";
import { courses } from "@/courses";

interface props {
params: {
name: string;
};
}

export const generateStaticParams = () => {
return courses.map(({ param }) => ({ name: param }));
};

const Page = ({ params }: props) => {
const { name } = params;

return (
<>
<Name>{name}</Name>
</>
);
};

export default Page;
5 changes: 5 additions & 0 deletions src/app/course/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const Page = () => {
return <div>Page</div>;
};

export default Page;
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions src/components/course/name.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
interface CourseNameProps {
children: string;
}

const Name = ({ children }: CourseNameProps) => {
return (
<div className="font-Malayalam rounded-2xl bg-devstation-cyan-100 py-4 text-center text-6xl text-white">
{children}
</div>
);
};
export default Name;
File renamed without changes.
6 changes: 6 additions & 0 deletions src/courses/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const courses = [
{
name: "Introduction to Next.js",
param: "intro-nextjs",
},
];

0 comments on commit dbfbe3c

Please sign in to comment.