Patched the module badges on the training view
This commit is contained in:
@@ -220,6 +220,7 @@ const Training: React.FC<{ user: User }> = ({ user }) => {
|
|||||||
const trainingContentContainer = (timestamp: string) => {
|
const trainingContentContainer = (timestamp: string) => {
|
||||||
if (!groupedByTrainingContent) return <></>;
|
if (!groupedByTrainingContent) return <></>;
|
||||||
const trainingContent: ITrainingContent = groupedByTrainingContent[timestamp];
|
const trainingContent: ITrainingContent = groupedByTrainingContent[timestamp];
|
||||||
|
const uniqueModules = [...new Set(trainingContent.exams.map(exam => exam.module))];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -236,11 +237,9 @@ const Training: React.FC<{ user: User }> = ({ user }) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col gap-2">
|
<div className="flex flex-col gap-2">
|
||||||
<div className="w-full flex flex-row gap-1">
|
<div className="w-full flex flex-row gap-1">
|
||||||
{Object.values(groupedByTrainingContent || {}).flatMap((content) =>
|
{uniqueModules.map((module) => (
|
||||||
content.exams.map(({ module, id }) => (
|
<ModuleBadge key={module} module={module} />
|
||||||
<ModuleBadge key={id} module={module} />
|
))}
|
||||||
))
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user