Skip to content

Commit

Permalink
Merge pull request #83 from CassandraGoose/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
CassandraGoose authored Apr 25, 2024
2 parents dad71dd + 039bb97 commit 4f42283
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 29 deletions.
2 changes: 1 addition & 1 deletion app/pathways/[pathway]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default async function Page({
key={contentArea.id}
>
<h2 className="text-xl">{contentArea.title}</h2>
<div className="card-body flex w-full flex-row flex-wrap justify-around">
<div className="card-body flex w-full flex-row flex-wrap justify-start">
{contentArea.competencies.map((competency) => {
return (
<Fragment key={competency.id}>
Expand Down
54 changes: 27 additions & 27 deletions app/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Fragment } from 'react';
import { getUserPathways } from '../lib/queries';
import { notFound } from 'next/navigation';
import { caluclateProgress } from '../lib/utilities';
import { Pathway, Competency } from '../lib/interface';
import { Pathway, Competency, ContentArea } from '../lib/interface';
import Modal from '@/app/profile/_components/Modal';
import ContentAreaPill from '../_components/ContentAreaPill';
import CompetencyCard from '../_components/CompetencyCard';
Expand All @@ -21,16 +21,6 @@ export default async function Page({
const pathways = userPathways.pathways;
const showModal = searchParams?.showModal;

const getAllContentAreaForPathway = (pathway: Pathway): string[] => {
const contentAreas = new Set();
pathway.competencies.forEach((competency: Competency) => {
competency.contentAreas!.forEach((contentArea) => {
contentAreas.add(contentArea.title);
});
});
return Array.from(contentAreas) as string[];
};

return (
<section className="mx-12 flex flex-col">
{showModal && <Modal />}
Expand Down Expand Up @@ -65,15 +55,16 @@ export default async function Page({
{pathway.description}
</p>
<div className="card-actions flex">
{getAllContentAreaForPathway(pathway).map(
(contentArea: string) => {
return (
<span key={contentArea}>
<ContentAreaPill contentArea={contentArea} />
</span>
);
},
)}
{pathway.contentAreas.map((contentArea: ContentArea) => {
return (
<span
className="mr-2"
key={contentArea.title + contentArea.id}
>
<ContentAreaPill contentArea={contentArea.title} />
</span>
);
})}
</div>
</div>
<div className="p-8">
Expand All @@ -90,14 +81,23 @@ export default async function Page({
</div>
</div>
<div className="card-body flex flex-row flex-wrap">
{pathway.competencies.map((competency) => {
{pathway.contentAreas.map((contentArea: ContentArea) => {
return (
<Fragment key={competency.id}>
<CompetencyCard
key={competency.id}
competency={competency}
/>
</Fragment>
<div key={contentArea.id} className="flex flex-col">
<p className="text-xl">{contentArea.title}</p>
<div className="card-body flex w-full flex-row flex-wrap justify-start">
{contentArea.competencies.map(
(competency: Competency) => {
return (
<CompetencyCard
key={competency.id}
competency={competency}
/>
);
},
)}
</div>
</div>
);
})}
</div>
Expand Down
1 change: 0 additions & 1 deletion prisma/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ async function main() {
});

const pw = process.env.TEST_USER_PW || '';
console.log('PW IS: ', pw);

const hashedPassword = await new Argon2id().hash(pw);

Expand Down

0 comments on commit 4f42283

Please sign in to comment.