Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Showing course name on module item #477

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion components/MaterialLists/ModuleList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ interface ModuleListProps {
headingSize?: "HeadingTwo" | "HeadingFour"; // optional prop to determine the heading size
}

/**
* Lists all the modules according to a certain grouping.
* The modules items are clickable and redirect to the module page.
* The items display the module name and its parent course name.
*
* @param groupedMaterial List of grouped modules
* @param headingSize Optional prop to determine the heading size
* @returns List of grouped modules
* @author Maruf Bepary
*/
const ModuleList: React.FC<ModuleListProps> = ({
groupedMaterial: groupedModules,
headingSize = "HeadingTwo",
Expand Down Expand Up @@ -48,7 +58,16 @@ const ModuleList: React.FC<ModuleListProps> = ({
href={`${basePath}/${courseKey}/${moduleKey}`}
key={idx}
>
<Tag hasHover>{moduleDatabaseMap[moduleKey].name}</Tag>
<Tag hasHover>
<div>{moduleDatabaseMap[moduleKey].name}</div>
<div className="text-neutral-400 dark:text-red-200 italic text-sm">
{
courseDatabaseMap[
moduleDatabaseMap[moduleKey].parentCourse
].name
}
</div>
</Tag>
</Link>
</div>
);
Expand Down