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

Production deployment #34

Merged
merged 8 commits into from
Mar 15, 2024
7 changes: 5 additions & 2 deletions app/library/class/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ const ClassLibrary = () => {
const gradeData = await getGrades(selectedGrade);
const teacherData = await getTeachers(undefined, actualTabName);
setTeachers(teacherData);
if (teacherData.length > 0 && selectedTeacher === undefined) {
setSelectedTeacher(teacherData[0].id);
}
if (subjectData.length > 0) {
const subjectId = subjectData[0].id;
const gradeId = gradeData[0].id;
Expand Down Expand Up @@ -191,7 +194,6 @@ const ClassLibrary = () => {
value={selectedTeacher}
className="w-32 h-8 rounded-lg text-center"
>
<option value="" className="text-sm md:text-lg">Teacher: All</option>
{teachers.map((teacher) => (
<option key={teacher.id} value={teacher.id} className="text-sm md:text-lg">
{teacher.user.first_name}
Expand Down Expand Up @@ -225,7 +227,8 @@ const ClassLibrary = () => {
.map((resource) => (
<li key={resource.id} onClick={() => handleResourceTracking(resource.name)} className="py-2">
<Link href={resource.link} target="_blank" rel="noopener noreferrer" className="flex flex-row items-center">
<Image src={PlayIcon} alt="Play" className="w-10 h-10 mr-2" /> {resource.name}
<Image src={PlayIcon} alt="Play" className="w-10 h-10 mr-2" /> {resource.name} {" - "}
{resource.type_params.date}
</Link>
</li>
))}
Expand Down
22 changes: 11 additions & 11 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,14 @@ export default function Home() {
className="bg-primary text-white text-sm rounded-lg w-16 h-8 mr-4 shadow-md shadow-slate-400">START</PrimaryButton>
</Link>
);
} else {
return (
<p className="text-sm italic font-normal mr-6">
Starts at <br />
{sessionStartTimeStr}
</p>
);
}
} else {
return (
<p className="text-sm italic font-normal mr-6">
Starts at <br />
{sessionStartTimeStr}
</p>
);
}
return null;
}
Expand Down Expand Up @@ -177,12 +177,12 @@ export default function Home() {
{formatTime(data.end_time)}
</p>
</div>
<div className="bg-white rounded-lg shadow-lg min-h-24 h-auto py-6 relative w-full flex flex-row justify-between mr-4">
<div className="bg-white rounded-lg shadow-lg min-h-24 h-auto py-6 relative w-full flex flex-row justify-between mr-4 items-center">
<div className={`${index % 2 === 0 ? 'bg-orange-200' : 'bg-red-200'} h-full w-2 absolute left-0 top-0 rounded-s-md`}></div>
<div className="text-sm md:text-base font-semibold mx-6 md:mx-8">
<span className="font-normal pr-4">Subject:</span> {data.session.meta_data.subject ?? "Science"}
<div className="text-sm md:text-base font-semibold ">
<span className="font-normal pr-7">Batch:</span> {data.session.meta_data.batch ?? "Science Batch"}
<span className="font-normal pr-7">Name:</span> {data.session.name}
</div>
</div>
{renderButton(data)}
Expand Down Expand Up @@ -210,14 +210,14 @@ export default function Home() {
{formatQuizSessionTime(data.end_time)}
</p>
</div>
<div className="bg-white rounded-lg shadow-lg min-h-24 h-auto py-6 relative w-full flex flex-row justify-between mr-4">
<div className="bg-white rounded-lg shadow-lg min-h-24 h-auto py-6 relative w-full flex flex-row justify-between mr-4 items-center">
<div className={`${index % 2 === 0 ? 'bg-orange-200' : 'bg-red-200'} h-full w-2 absolute left-0 top-0 rounded-s-md`}></div>
<div className="text-sm md:text-base font-semibold mx-6 md:mx-8">
<div className="flex">
<span className="font-normal pr-8">Name:</span> <span>{data.name}</span>
</div>
<div className="text-sm md:text-base font-semibold ">
<span className="font-normal pr-5">Stream:</span> <span>{data.stream}</span>
<span className="font-normal pr-5">Format:</span> <span>{data.testFormat}</span>
</div>
</div>
{renderButton(data)}
Expand Down
6 changes: 5 additions & 1 deletion app/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ export interface Resource {
link: string;
chapter_id: number;
type: string;
type_params: {
date: string
}
}

export interface Topic {
Expand Down Expand Up @@ -138,7 +141,8 @@ export interface QuizSession {
subject: string,
redirectPlatform: string,
stream: string,
id: string
id: string,
testFormat: string
}

export interface SessionSchedule {
Expand Down
3 changes: 2 additions & 1 deletion utils/quizUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export const generateQuizLinks = async (batchData: any): Promise<QuizSession[]>
redirectPlatform: sessionData.redirectPlatform,
name: sessionData.name,
stream: sessionData.stream,
id: sessionData.id
id: sessionData.id,
testFormat: sessionData.testFormat
};
}
return null;
Expand Down
Loading