Skip to content

Commit 677e872

Browse files
Merge pull request #115 from karannfr/prod
build fixes
2 parents 8c54985 + f950583 commit 677e872

5 files changed

Lines changed: 70 additions & 70 deletions

File tree

src/app/landing/landing-mobile.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import Image from 'next/image';
55
import Footer from '@/components/ui/Footer';
66
import Accordion from '@/components/ui/Accordion';
77

8-
import { ZButton } from '@/components/ui/Buttons';
9-
import { useRouter } from "next/navigation";
10-
import { signIn, useSession } from 'next-auth/react';
8+
// import { ZButton } from '@/components/ui/Buttons';
9+
// import { useRouter } from "next/navigation";
10+
import { signIn } from 'next-auth/react';
1111
import { PopupLogin } from '@/components/ui/PopupMobile';
1212

1313
export default function View() {
14-
const router = useRouter();
15-
const { data: session } = useSession();
16-
const loggedin = !!session;
14+
// const router = useRouter();
15+
// const { data: session } = useSession();
16+
// const loggedin = !!session;
1717
const [showLoginPopupSaved, setShowLoginPopupSaved] = useState(false);
1818

1919
return (
@@ -67,9 +67,9 @@ export default function View() {
6767
</div>
6868

6969
<div className="text-lg sm:text-xl font-poppins font-semibold text-black mb-6">
70-
We're almost ready!
70+
We&apos;re almost ready!
7171
<br />
72-
The website will be up as soon as the coming semesters faculty list is available.
72+
The website will be up as soon as the coming semester&apos;s faculty list is available.
7373
</div>
7474
{/* <ZButton
7575
type="regular"

src/app/landing/landing.tsx

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import Navbar from "@/components/ui/Navbar";
88
import Footer from "@/components/ui/Footer";
99
import Accordion from "@/components/ui/Accordion";
1010

11-
import FacultySelector from "@/components/cards/FacultySelector";
12-
import CourseCard from "@/components/cards/CourseCard";
13-
import ViewTimeTable from "@/components/cards/ViewTimeTable";
14-
import { TimetableProvider } from "@/lib/TimeTableContext";
11+
// import FacultySelector from "@/components/cards/FacultySelector";
12+
// import CourseCard from "@/components/cards/CourseCard";
13+
// import ViewTimeTable from "@/components/cards/ViewTimeTable";
14+
// import { TimetableProvider } from "@/lib/TimeTableContext";
1515
import { fullCourseData } from "@/lib/type";
1616
const LOCAL_STORAGE_KEY = "selectedCourses";
1717

1818
export default function View() {
19-
const [selectedCourses, setSelectedCourses] = useState<fullCourseData[]>(() => {
19+
const [selectedCourses] = useState<fullCourseData[]>(() => {
2020
if (typeof window === "undefined") return [];
2121
try {
2222
const saved = localStorage.getItem("selectedCourses");
@@ -27,59 +27,59 @@ export default function View() {
2727
});
2828

2929

30-
const facultySelectorOnConfirm = (newCourse: fullCourseData) => {
31-
setSelectedCourses((prevCourses) => {
32-
const existingIndex = prevCourses.findIndex(
33-
(course) => course.id === newCourse.id
34-
);
35-
36-
if (existingIndex !== -1) {
37-
const existingCourse = prevCourses[existingIndex];
38-
39-
// Replace faculty lists for matching slotNames, and add new ones if not already present
40-
const updatedSlots = newCourse.courseSlots.map((newSlot) => {
41-
const existingSlot = existingCourse.courseSlots.find(
42-
(slot) => slot.slotName === newSlot.slotName
43-
);
44-
45-
if (existingSlot) {
46-
// Replace the faculty list
47-
return {
48-
...existingSlot,
49-
slotFaculties: newSlot.slotFaculties,
50-
};
51-
} else {
52-
// New slot, just add it
53-
return newSlot;
54-
}
55-
});
56-
57-
// Merge any slots from existingCourse that are not in newCourse
58-
const preservedOldSlots = existingCourse.courseSlots.filter(
59-
(oldSlot) =>
60-
!newCourse.courseSlots.some(
61-
(newSlot) => newSlot.slotName === oldSlot.slotName
62-
)
63-
);
64-
65-
const mergedSlots = [...preservedOldSlots, ...updatedSlots];
66-
67-
const updatedCourse = {
68-
...existingCourse,
69-
courseSlots: mergedSlots,
70-
};
71-
72-
const updatedCourses = [...prevCourses];
73-
updatedCourses[existingIndex] = updatedCourse;
74-
75-
return updatedCourses;
76-
} else {
77-
// New course, add directly
78-
return [...prevCourses, newCourse];
79-
}
80-
}
81-
);
82-
};
30+
// const facultySelectorOnConfirm = (newCourse: fullCourseData) => {
31+
// setSelectedCourses((prevCourses) => {
32+
// const existingIndex = prevCourses.findIndex(
33+
// (course) => course.id === newCourse.id
34+
// );
35+
36+
// if (existingIndex !== -1) {
37+
// const existingCourse = prevCourses[existingIndex];
38+
39+
// // Replace faculty lists for matching slotNames, and add new ones if not already present
40+
// const updatedSlots = newCourse.courseSlots.map((newSlot) => {
41+
// const existingSlot = existingCourse.courseSlots.find(
42+
// (slot) => slot.slotName === newSlot.slotName
43+
// );
44+
45+
// if (existingSlot) {
46+
// // Replace the faculty list
47+
// return {
48+
// ...existingSlot,
49+
// slotFaculties: newSlot.slotFaculties,
50+
// };
51+
// } else {
52+
// // New slot, just add it
53+
// return newSlot;
54+
// }
55+
// });
56+
57+
// // Merge any slots from existingCourse that are not in newCourse
58+
// const preservedOldSlots = existingCourse.courseSlots.filter(
59+
// (oldSlot) =>
60+
// !newCourse.courseSlots.some(
61+
// (newSlot) => newSlot.slotName === oldSlot.slotName
62+
// )
63+
// );
64+
65+
// const mergedSlots = [...preservedOldSlots, ...updatedSlots];
66+
67+
// const updatedCourse = {
68+
// ...existingCourse,
69+
// courseSlots: mergedSlots,
70+
// };
71+
72+
// const updatedCourses = [...prevCourses];
73+
// updatedCourses[existingIndex] = updatedCourse;
74+
75+
// return updatedCourses;
76+
// } else {
77+
// // New course, add directly
78+
// return [...prevCourses, newCourse];
79+
// }
80+
// }
81+
// );
82+
// };
8383

8484
useEffect(() => {
8585
if (typeof window === "undefined") return;

src/components/ui/Accordion.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"use client;"
1+
"use client";
22

33
import FAQ from "./FAQ";
44

src/components/ui/FAQ.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"use client;"
1+
"use client";
22

33
import { ChevronDown, ChevronUp } from 'lucide-react';
44
import { useState, useRef, useEffect } from 'react';

src/components/ui/Hero.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ export default function Hero({page} : NavbarProps) {
3232
</div>
3333
{(page == "placeholder") &&
3434
<div className="text-lg sm:text-xl font-poppins font-semibold text-black mb-6">
35-
We're almost ready!
35+
We&apos;re almost ready!
3636
<br />
37-
The website will be up as soon as the coming semesters faculty list is available.
37+
The website will be up as soon as the coming semester&apos;s faculty list is available.
3838
</div>}
3939
{(page == "normal") &&
4040
<ZButton

0 commit comments

Comments
 (0)