Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mraysu committed May 6, 2024
1 parent e2cbc5c commit 65f4e72
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
46 changes: 24 additions & 22 deletions frontend/src/components/ProgramCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Poppins } from "next/font/google";
//import Image from "next/image";
import Image from "next/image";
import React from "react";

import { Program } from "../api/programs";
Expand All @@ -18,7 +18,7 @@ export type CardProps = {
setPrograms: React.Dispatch<React.SetStateAction<ProgramMap>>;
};

/*function processDate(startString: Date): string {
function processDate(startString: Date): string {
const startDate = new Date(startString);

const options = {
Expand All @@ -28,7 +28,7 @@ export type CardProps = {
} as const;

return "Started " + startDate.toLocaleDateString("en-US", options);
}*/
}

export function ProgramCard({ program, isAdmin, className, setPrograms }: CardProps) {
const { isTablet } = useWindowSize();
Expand All @@ -40,10 +40,10 @@ export function ProgramCard({ program, isAdmin, className, setPrograms }: CardPr
let titleClass;
let optionsDiv = "grow";
const optionsClass = "relative float-right hover:cursor-pointer";
//let dateClass;
//let numClass;
//let numTextClass;
//let iconClass = "relative";
let dateClass;
let numClass;
let numTextClass;
let iconClass = "relative";

const programFields: Program = {
_id: program._id,
Expand All @@ -67,21 +67,21 @@ export function ProgramCard({ program, isAdmin, className, setPrograms }: CardPr
typeClass = cn("uppercase relative text-[10px] top-2 left-3", poppins.className);
titleClass = cn("capitalize relative text-sm top-2 left-3 font-bold", poppins.className);
optionsDiv += " pr-[8px] pt-[12px]";
//dateClass = cn("relative text-[10px] top-2 left-3", poppins.className);
//numClass = "h-5 gap-x-1.5 flex flex-row relative top-2 left-3";
//numTextClass = cn("text-[10px]", poppins.className);
//iconClass = "h-2 w-3 mt-[7px]";
dateClass = cn("relative text-[10px] top-2 left-3", poppins.className);
numClass = "h-5 gap-x-1.5 flex flex-row relative top-2 left-3";
numTextClass = cn("text-[10px]", poppins.className);
iconClass = "h-2 w-3 mt-[7px]";
} else {
outerDivClass += " rounded-2xl h-68";
topDivClass += " h-36";
botDivClass += " h-32";
typeClass = cn("uppercase relative text-sm top-5 left-7", poppins.className);
titleClass = cn("capitalize relative text-3xl top-8 left-7 font-bold", poppins.className);
optionsDiv += " pr-[16px] pt-[24px]";
//dateClass = cn("relative text-base top-5 left-7", poppins.className);
//numClass = "h-8 gap-x-1.5 flex flex-row relative top-14 left-7";
//numTextClass = cn("text-base", poppins.className);
//iconClass = "h-3 w-[18px] mt-[5px]";
dateClass = cn("relative text-base top-5 left-7", poppins.className);
numClass = "h-8 gap-x-1.5 flex flex-row relative top-14 left-7";
numTextClass = cn("text-base", poppins.className);
iconClass = "h-3 w-[18px] mt-[5px]";
}

if (className) {
Expand All @@ -104,7 +104,7 @@ export function ProgramCard({ program, isAdmin, className, setPrograms }: CardPr
)}
</div>
<div className={botDivClass}>
{/*<p className={dateClass}>{processDate(program.startDate)}</p>}
<p className={dateClass}>{processDate(/*program.startDate*/ new Date())}</p>
<div className={numClass}>
<Image
alt="students"
Expand All @@ -113,12 +113,14 @@ export function ProgramCard({ program, isAdmin, className, setPrograms }: CardPr
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} Students</p>
)}
</div>*/}
{/*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*/}0 Students</p>
//)
}
</div>
</div>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/StudentsTable/useColumnSchema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ const ProgramPopover = ({ link, program }: { link: ProgramLink; program: Program
const rowInfo = [
["Type", program.type],
["Schedule", program.daysOfWeek.join(", ")],
["Start Date", new Date(program.startDate).toLocaleDateString("en-US")],
["Renewal Date", new Date(program.endDate).toLocaleDateString("en-US")],
["Start Date", new Date(/*program.startDate*/).toLocaleDateString("en-US")],
["Renewal Date", new Date(/*program.endDate*/).toLocaleDateString("en-US")],
["Hours Left", link.hoursLeft.toString()],
];

Expand Down

0 comments on commit 65f4e72

Please sign in to comment.