@@ -2,15 +2,20 @@ import React from "react";
22
33interface ModalProps {
44 closeModal : React . Dispatch < React . SetStateAction < boolean > > ;
5+ setModalContent ?: React . Dispatch < React . SetStateAction < React . ReactNode | undefined > > ;
6+ modalContent ?: React . ReactNode ;
57}
68
7- const Modal : React . FC < ModalProps > = ( { closeModal } ) => {
9+ const Modal : React . FC < ModalProps > = ( { closeModal, setModalContent , modalContent } ) => {
810 return (
911 < div className = "modal-overlay" >
1012 < div className = "modal-content" >
1113 < button
1214 className = "close-button"
13- onClick = { ( ) => closeModal ( false ) }
15+ onClick = { ( ) => {
16+ closeModal ( false ) ;
17+ if ( setModalContent ) setModalContent ( undefined ) ;
18+ } }
1419 >
1520 < svg
1621 fill = "none"
@@ -27,25 +32,29 @@ const Modal: React.FC<ModalProps> = ({ closeModal }) => {
2732 />
2833 </ svg >
2934 </ button >
30- < h2 > GYFT - MetaKGP</ h2 >
31- < p >
32- GYFT gives you an ICS file for your current semester
33- timetable which you can add in any common calendar
34- application. Now, you'll always know when your classes
35- are—whether you decide to go or not!
36- </ p >
37- < h4 > How to get your timetable?</ h4 >
38- < ol >
39- < li > Enter your roll number and password for ERP login</ li >
40- < li > Answer the security question and enter the OTP.</ li >
41- < li >
42- Download the timetable for the current semester in .ics
43- format.
44- </ li >
45- < li >
46- Import the .ics file into your favorite calendar app!
47- </ li >
48- </ ol >
35+ { modalContent ? modalContent : (
36+ < >
37+ < h2 > GYFT - MetaKGP</ h2 >
38+ < p >
39+ GYFT gives you an ICS file for your current semester
40+ timetable which you can add in any common calendar
41+ application. Now, you'll always know when your classes
42+ are—whether you decide to go or not!
43+ </ p >
44+ < h4 > How to get your timetable?</ h4 >
45+ < ol >
46+ < li > Enter your roll number and password for ERP login</ li >
47+ < li > Answer the security question and enter the OTP.</ li >
48+ < li >
49+ Download the timetable for the current semester in .ics
50+ format.
51+ </ li >
52+ < li >
53+ Import the .ics file into your favorite calendar app!
54+ </ li >
55+ </ ol >
56+ </ >
57+ ) }
4958 </ div >
5059 </ div >
5160 ) ;
0 commit comments