Skip to content

Commit

Permalink
finish merge
Browse files Browse the repository at this point in the history
  • Loading branch information
adhi0331 committed Jun 16, 2024
1 parent bce0f03 commit 5310409
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 59 deletions.
75 changes: 17 additions & 58 deletions frontend/src/components/ProgramCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ export function ProgramCard({
component={editButton}
data={programFields}
setPrograms={setPrograms}
setAlertState={setAlertState}
/>
</div>
<div className={outerDivClass}>
Expand All @@ -254,70 +255,28 @@ export function ProgramCard({
</div>
<div className={botDivClass}>
<div className={numClass}>
<div className="relative">
<div id={editId} className={editClass}>
<ProgramFormButton
type="edit"
component={editButton}
data={programFields}
setPrograms={setPrograms}
setAlertState={setAlertState}
/>
</div>
<div className={outerDivClass}>
<div className={topDivClass} style={{ backgroundColor: program.color }}>
<div>
<p className={typeClass}>{program.type} Program</p>
<p className={titleClass}>{program.name}</p>
</div>
{isAdmin && !archiveView && (
<div className={optionsDiv}>
<Image
alt="students"
src="/programs/Students.png"
height={12}
width={18}
className={iconClass}
/>
{enrollments && <p className={numTextClass}>{getStudentNum(enrollments.length)}</p>}
{/* {program.students.length === 0 && <p className={numTextClass}>No Students</p>}
{program.students.length === 1 && <p className={numTextClass}>1 Student</p>}
{program.students.length > 1 && (
<p className={numTextClass}>{program.students.length} Students</p>
)} */}
</div>
)}
</div>
<div className={botDivClass}>
<div className={numClass}>
{!archiveView && (
<Image
alt="students"
src="/programs/Students.png"
height={12}
width={18}
className={iconClass}
/>
)}
{/*program.students.length === 0 && <p className={numTextClass}>No Students</p>*/}
{/*program.students.length === 1 && <p className={numTextClass}>1 Student</p>*/}
{
//program.students.length > 1 && (
<p className={numTextClass}>
{/*program.students.length*/}
{
archiveView
{!archiveView && (
<Image
alt="students"
src="/programs/Students.png"
height={12}
width={18}
className={iconClass}
/>
)}
{enrollments && (
<p className={numTextClass}>
{archiveView
? "Archived on " +
(date.getMonth() + 1) +
"/" +
date.getDate() +
"/" +
date.getFullYear()
: "0 Students" //<---- Change in the future --------
}
</p>
//)
}
: getStudentNum(enrollments.length)}
</p>
)}
</div>
</div>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/ProgramProfile.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Poppins } from "next/font/google";
import Image from "next/image";
import Link from "next/link";
import { useEffect, useMemo, useState } from "react";

import { Enrollment, Program, getProgram, getProgramEnrollments } from "../api/programs";
Expand Down Expand Up @@ -171,7 +172,7 @@ export function ProgramProfile({ id }: ProgramProfileProps) {
<p className={messageClass}>
You can add a student to this program from their individual profile. See{" "}
<u>
<a href="/students">all students</a>
<Link href="/home">all students</Link>
</u>
</p>
<div className={middleDivClass}>
Expand Down

0 comments on commit 5310409

Please sign in to comment.