From fb44072b7791ee5192033f2be63d98211d1d5c54 Mon Sep 17 00:00:00 2001 From: ImJustChew Date: Sat, 1 Jun 2024 15:31:48 +0800 Subject: [PATCH] fix: embed courses into the page --- .../courses/CourseSearchContainer.tsx | 5 ++-- src/app/[lang]/(mods-pages)/courses/page.tsx | 26 +++---------------- src/components/Timetable/TimetableSidebar.tsx | 2 +- 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/src/app/[lang]/(mods-pages)/courses/CourseSearchContainer.tsx b/src/app/[lang]/(mods-pages)/courses/CourseSearchContainer.tsx index c6bde6fe..13b543f4 100644 --- a/src/app/[lang]/(mods-pages)/courses/CourseSearchContainer.tsx +++ b/src/app/[lang]/(mods-pages)/courses/CourseSearchContainer.tsx @@ -131,10 +131,9 @@ const CourseSearchContainer = () => { indexName="nthu_courses" routing > -
- +
-
+
diff --git a/src/app/[lang]/(mods-pages)/courses/page.tsx b/src/app/[lang]/(mods-pages)/courses/page.tsx index c3b32a23..03a6db17 100644 --- a/src/app/[lang]/(mods-pages)/courses/page.tsx +++ b/src/app/[lang]/(mods-pages)/courses/page.tsx @@ -5,30 +5,10 @@ import CourseSearchContainer from './CourseSearchContainer'; import { useRouter } from "next/navigation"; const CourseDialog = () => { - const [open, setOpen] = useState(true); - const router = useRouter(); - - //first load open dialog - useEffect(() => { - setOpen(true); - }, []) - - //if closed, navigate to timetable page - useEffect(() => { - if (!open) { - router.push('/timetable') - } - }, [open]) - return ( - - - Open - - - - - + return (
+ +
); } diff --git a/src/components/Timetable/TimetableSidebar.tsx b/src/components/Timetable/TimetableSidebar.tsx index bd63e875..e575816e 100644 --- a/src/components/Timetable/TimetableSidebar.tsx +++ b/src/components/Timetable/TimetableSidebar.tsx @@ -42,7 +42,7 @@ const TimetableSidebar = ({ {dict.course.item.add_to_semester} - +