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

Develop #83

Merged
merged 2 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
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
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
Loading