Shubhangii rawat#151
Open
shubhangiirawat wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an exam-period-aware exam timetable experience to the existing timetable UI, including a toggle between “Regular Timetable” and an “Exam Timetable” view and updated exam date configuration.
Changes:
- Updated timetable page wiring/imports to render the timetable container.
- Extended
TimetableContainerto fetch and render an exam timetable view with a toggle button. - Updated exam timetable configuration and exam popup behavior to align with the new date range + exam-period detection.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
src/pages/Timetable.jsx |
Adjusts how the timetable container is imported/rendered and updates Helmet metadata. |
src/components/Timetable/TimetableContainer.jsx |
Adds toggle-driven exam timetable view, exam schedule fetching, and related styling/components. |
src/components/Timetable/index.jsx |
Minor change to module exports file (formatting). |
src/components/Timetable/examTimetableConfig.js |
Updates exam date range format and adds isExamPeriod() helper. |
src/components/Timetable/ExamTimetable.jsx |
Aligns exam popup logic with exam-period detection and updated date range parsing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
464
to
+468
| ) | ||
| item.tutorialSlots.forEach((slotName) => | ||
| createEventHandler(slotName, 'Tutorial') | ||
| ) | ||
| }) | ||
|
|
||
| )} | ||
| ) |
Comment on lines
+795
to
+798
| useEffect(() => { | ||
| console.log('examCourses:', examCourses) | ||
| console.log('isExamPeriod:', isExamPeriod()) | ||
| if (!isExamPeriod()) return undefined |
Comment on lines
+1000
to
+1002
| onClick={() => | ||
| setShowRegularTimetable((prev) => !prev) | ||
| } |
Comment on lines
+1397
to
+1407
| const CourseDateBadge = styled.div` | ||
| display: flex; | ||
| flex-direction: column; | ||
| justify-content: center; | ||
| background: rgb(255, 233, 204); | ||
| padding: 0.3rem 0.5rem; | ||
| width: 45px; | ||
| text-align: center; | ||
| border-top-left-radius: 8px; | ||
| border-bottom-left-radius: 8px; | ||
| ` |
Comment on lines
+1
to
+5
| import React, { useState,useEffect } from 'react' | ||
| import { Helmet } from 'react-helmet-async' | ||
|
|
||
| import { PageContainer } from 'components/shared' | ||
| import { TimetableContainer } from 'components/Timetable' | ||
| import TimetableContainer from 'components/Timetable/TimetableContainer' |
Comment on lines
+30
to
+38
| export const isExamPeriod = () => { | ||
| const today = new Date() | ||
| return EXAM_DATE_RANGE.some(({ start, end }) => { | ||
| const s = new Date(start) | ||
| const e = new Date(end) | ||
| e.setHours(23, 59, 59) // include the end day fully | ||
| return today >= s && today <= e | ||
| }) | ||
| } No newline at end of file |
Comment on lines
+45
to
52
| padding: '12px', | ||
| fontFamily: 'Montserrat,Segoe UI, Tahoma, Geneva, Verdana, sans-serif', | ||
| backgroundColor: '#2d2941ff ', | ||
| borderRadius: '12px', | ||
| JustifyContent: 'start', | ||
| marginTop: '1.2rem', | ||
| margin: '0px', | ||
| width:'550px' | ||
| }, |
Comment on lines
+561
to
+563
| const PopupExample = ({ | ||
| setShowRegularTimetable, | ||
| }) => { |
Comment on lines
+747
to
751
| export const Exam = ({ | ||
| setShowRegularTimetable, | ||
| }) => { | ||
| return ( | ||
| <div className="Exam"> |
Comment on lines
995
to
+999
| <PageHeading> | ||
| <PageTitle>Timetable</PageTitle> | ||
| <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}> | ||
| <Exam /> | ||
| <button | ||
| type="button" |
| @@ -1,32 +1,24 @@ | |||
| import React, { useState,useEffect } from 'react' | |||
|
|
||
| const TimeTable = () => { | ||
| return ( | ||
| // import { Exam(( } from 'components/Timetable/ExamTimetable' |
Comment on lines
+795
to
+798
| useEffect(() => { | ||
| console.log('examCourses:', examCourses) | ||
| console.log('isExamPeriod:', isExamPeriod()) | ||
| if (!isExamPeriod()) return undefined |
Comment on lines
+1397
to
+1407
| const CourseDateBadge = styled.div` | ||
| display: flex; | ||
| flex-direction: column; | ||
| justify-content: center; | ||
| background: rgb(255, 233, 204); | ||
| padding: 0.3rem 0.5rem; | ||
| width: 45px; | ||
| text-align: center; | ||
| border-top-left-radius: 8px; | ||
| border-bottom-left-radius: 8px; | ||
| ` |
Comment on lines
+30
to
+38
| export const isExamPeriod = () => { | ||
| const today = new Date() | ||
| return EXAM_DATE_RANGE.some(({ start, end }) => { | ||
| const s = new Date(start) | ||
| const e = new Date(end) | ||
| e.setHours(23, 59, 59) // include the end day fully | ||
| return today >= s && today <= e | ||
| }) | ||
| } No newline at end of file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
exam time table during exams with toggle button