From 3a9f78f3cde21d3ebb102246d432aaf7539ea699 Mon Sep 17 00:00:00 2001 From: Madhawa Monarawila Date: Tue, 17 Sep 2024 05:18:42 +0530 Subject: [PATCH 1/5] Add option to "Read and Agree" with mentee guides at the mentee application process --- src/components/TermsAgreementModal/index.tsx | 251 +++++++++++++++++++ src/pages/MenteeRegistration/index.tsx | 52 +++- src/schemas.ts | 3 - 3 files changed, 292 insertions(+), 14 deletions(-) create mode 100644 src/components/TermsAgreementModal/index.tsx diff --git a/src/components/TermsAgreementModal/index.tsx b/src/components/TermsAgreementModal/index.tsx new file mode 100644 index 00000000..772ccaa3 --- /dev/null +++ b/src/components/TermsAgreementModal/index.tsx @@ -0,0 +1,251 @@ +import React from 'react'; +import { useForm } from 'react-hook-form'; +import { z } from 'zod'; +import { zodResolver } from '@hookform/resolvers/zod'; + +const termsSchema = z.object({ + agreed: z.boolean().refine((val) => val, { + message: 'You must agree to the ScholarX Mentee/Mentor Guide 2024', + }), + consentGiven: z.boolean().refine((val) => val, { + message: 'You must give consent to proceed', + }), +}); + +type TermsFormData = z.infer; + +interface TermsAgreementModalProps { + isOpen: boolean; + onClose: () => void; + onAgree: (data: TermsFormData) => void; +} + +const TermsAgreementModal: React.FC = ({ + isOpen, + onClose, + onAgree, +}) => { + const { + register, + handleSubmit, + formState: { errors, isValid }, + } = useForm({ + resolver: zodResolver(termsSchema), + mode: 'onChange', + defaultValues: { + agreed: false, + consentGiven: false, + }, + }); + + const onSubmit = (data: TermsFormData) => { + if (isValid) { + console.log('Form is valid. Submitting data:', data); + onAgree(data); + } else { + console.log('Form is invalid. Errors:', errors); + } + }; + + if (!isOpen) return null; + + return ( +
+
+
+
+

+ ScholarX Mentee Guide 2024 +

+
+

Introduction

+

+ Welcome to ScholarX! This guide is designed to help you navigate + through the ScholarX mentoring program, ensuring you make the + most out of this valuable opportunity. +

+ +

What is ScholarX?

+

+ ScholarX is a 6-month mentoring program designed by the + Sustainable Education Foundation to connect Sri Lankan + undergraduate students with global experts from academia and + industry. This program aims to enrich students' academic + and professional journey, providing valuable guidance and + opportunities for personal and career growth. +

+ +

Communication

+
    +
  • + Initiate Contact: Once matched, your mentor + will send the first email. Promptly respond and arrange the + first meeting. +
    + + If you don’t receive a mail within 1 week of matching a + mentor, let us know to check with the mentor. + +
  • +
  • + Establish Ground Rules: Discuss and set + expectations, including the frequency of meetings and + communication methods. +
  • +
  • + Preferred Platforms: +
      +
    • Zoom
    • +
    • Google Meet
    • +
    • Skype
    • +
    • Messenger
    • +
    +
  • +
  • + Preparation: +
      +
    • Prepare questions for your mentor.
    • +
    • + Bring necessary resources (e.g., CVs, research papers). +
    • +
    • Complete any tasks assigned by your mentor.
    • +
    +
  • +
+ +

Mentoring Sessions

+

+ Focus Areas: +

+
    +
  • Learn through reflection on your mentor’s experiences.
  • +
  • Follow recommended online courses and certifications.
  • +
  • + Seek guidance on international competitions and scholarships. +
  • +
  • Discuss professional tools and methods.
  • +
  • + General career guidance and project collaboration if possible. +
  • +
+ +

Checkpoints

+
    +
  • + First Meeting: Ensure your mentor contacts + you and schedules the first meeting. +
  • +
  • + Monthly Check-ins: Submit monthly updates on + your progress{' '} + + via the provided Google form. + +
  • +
  • + Public Sharing: Make at least 3 media + submissions during the 6-month period. Include links in the + monthly check-ins. +
      +
    • + Types of Media: +
    • +
        +
      • + Written: Blogs on personal websites, Medium Blogspot. +
      • +
      • Video: YouTube, Facebook.
      • +
      • Audio: Anchor, YouTube, podcasts.
      • +
      +
    +
  • +
  • + Social Media: Share your experience using + hashtags #SEF and #ScholarX. +
  • +
+ +

Etiquette

+
    +
  • + Commitment: Adhere to scheduled meetings and + inform your mentor in advance if you need to reschedule. +
  • +
  • + Proactivity: Actively seek feedback and + advice. +
  • +
  • + Mutual Respect: Remember, mentorship is a + two-way relationship. Be open to learning and sharing ideas. +
  • +
+ +

Conclusion

+

+ A concluding ceremony will round off the program, with a date to + be determined. Maintaining contact with your mentor after the + program is at their discretion. +
+ For any questions, please contact the Program Manager at + sustainableedufoundation@gmail.com. +

+
+ +
+ + {errors.agreed && ( +

{errors.agreed.message}

+ )} + + + {errors.consentGiven && ( +

+ {errors.consentGiven.message} +

+ )} +
+
+ +
+ + +
+
+
+
+ ); +}; + +export default TermsAgreementModal; diff --git a/src/pages/MenteeRegistration/index.tsx b/src/pages/MenteeRegistration/index.tsx index 76cd3a1d..d60838a2 100644 --- a/src/pages/MenteeRegistration/index.tsx +++ b/src/pages/MenteeRegistration/index.tsx @@ -11,6 +11,7 @@ import { API_URL } from '../../constants'; import useProfile from '../../hooks/useProfile'; import { MenteeApplicationSchema } from '../../schemas'; import { MenteeApplication } from '../../types'; +import TermsAgreementModal from '../../components/TermsAgreementModal'; const steps = [ { @@ -35,9 +36,11 @@ const MenteeRegistration: React.FC = () => { setError, clearErrors, trigger, + getValues, formState: { errors }, } = useForm({ resolver: zodResolver(MenteeApplicationSchema), + mode: 'onChange', defaultValues: { firstName: user?.first_name, lastName: user?.last_name, @@ -51,6 +54,8 @@ const MenteeRegistration: React.FC = () => { const [currentStep, setCurrentStep] = useState(0); const [image, setImage] = useState(null); const [profilePic, setProfilePic] = useState(user?.image_url); + const [isModalOpen, setIsModalOpen] = useState(false); + const [isSubmitting, setIsSubmitting] = useState(false); const handleProfilePicChange = (event: ChangeEvent) => { if (event.target.files != null) { @@ -89,7 +94,7 @@ const MenteeRegistration: React.FC = () => { } } - const output = await trigger(fields as [keyof MenteeApplication], { + const output = await trigger(fields as Array, { shouldFocus: true, }); @@ -102,9 +107,30 @@ const MenteeRegistration: React.FC = () => { }; const onSubmit: SubmitHandler = async (data) => { - await applyForMentor(data); - if (image) { - await updateProfile({ profile: null, image }); + setIsModalOpen(true); + }; + + const handleModalAgree = async (agreedData: { + agreed: boolean; + consentGiven: boolean; + }) => { + setIsModalOpen(false); + setIsSubmitting(true); + const formData = getValues(); + try { + const validatedData = MenteeApplicationSchema.parse({ + ...formData, + ...agreedData, + }); + await applyForMentor(validatedData); + if (image) { + await updateProfile({ profile: null, image }); + } + } catch (error) { + console.error('Error submitting application:', error); + // Handle validation errors here if needed + } finally { + setIsSubmitting(false); } }; @@ -130,6 +156,9 @@ const MenteeRegistration: React.FC = () => { }, }); + console.log('Form State:', watch()); + console.log('Form Errors:', errors); + console.log('IsModalOpen', isModalOpen); return (
Become a Mentee
@@ -355,13 +384,6 @@ const MenteeRegistration: React.FC = () => { register={register} error={errors.submission} /> -

Privacy Statement

Sustainable Foundation Education assures that your video @@ -425,6 +447,7 @@ const MenteeRegistration: React.FC = () => { {currentStep === 2 && !applicationSuccess && (

+ { + setIsModalOpen(false); + }} + onAgree={handleModalAgree} + /> ); }; diff --git a/src/schemas.ts b/src/schemas.ts index b72bec90..95d9b29e 100644 --- a/src/schemas.ts +++ b/src/schemas.ts @@ -15,9 +15,6 @@ export const MenteeApplicationSchema = z.object({ .optional(), cv: z.string().min(1, { message: 'CV cannot be empty' }), isUndergrad: z.boolean(), - consentGiven: z.boolean().refine((val) => val, { - message: 'You must give your consent to proceed.', - }), graduatedYear: z .number({ invalid_type_error: 'Graduated year is required' }) .refine( From 1dd702bca3133c14d7f6e42e0646846f3ab108f5 Mon Sep 17 00:00:00 2001 From: Madhawa Monarawila Date: Sun, 29 Sep 2024 00:19:30 +0530 Subject: [PATCH 2/5] Add option to "Read and Agree" with mentor guides at the mentor application process --- src/assets/svg/Icons/OpenIcon.tsx | 24 ++ src/components/TermsAgreementModal/index.tsx | 243 ++++++------------ src/pages/MenteeRegistration/index.tsx | 19 +- .../MentorRegistration.component.tsx | 62 ++++- src/schemas.ts | 21 +- 5 files changed, 175 insertions(+), 194 deletions(-) create mode 100644 src/assets/svg/Icons/OpenIcon.tsx diff --git a/src/assets/svg/Icons/OpenIcon.tsx b/src/assets/svg/Icons/OpenIcon.tsx new file mode 100644 index 00000000..fefec2a5 --- /dev/null +++ b/src/assets/svg/Icons/OpenIcon.tsx @@ -0,0 +1,24 @@ +import React from 'react'; + +const OpenIcon: React.FC = () => { + return ( +
+ + + +
+ ); +}; + +export default OpenIcon; diff --git a/src/components/TermsAgreementModal/index.tsx b/src/components/TermsAgreementModal/index.tsx index 772ccaa3..19f1ff59 100644 --- a/src/components/TermsAgreementModal/index.tsx +++ b/src/components/TermsAgreementModal/index.tsx @@ -2,197 +2,109 @@ import React from 'react'; import { useForm } from 'react-hook-form'; import { z } from 'zod'; import { zodResolver } from '@hookform/resolvers/zod'; +import Tooltip from '../Tooltip'; +import OpenIcon from '../../assets/svg/Icons/OpenIcon'; +import { + menteeTermsAgreementModalSchema, + mentorTermsAgreementModalSchema, +} from '../../schemas'; -const termsSchema = z.object({ - agreed: z.boolean().refine((val) => val, { - message: 'You must agree to the ScholarX Mentee/Mentor Guide 2024', - }), - consentGiven: z.boolean().refine((val) => val, { - message: 'You must give consent to proceed', - }), -}); - -type TermsFormData = z.infer; +type MentorFormData = z.infer; +type MenteeFormData = z.infer; interface TermsAgreementModalProps { isOpen: boolean; onClose: () => void; - onAgree: (data: TermsFormData) => void; + onAgree: (data: MentorFormData | MenteeFormData) => void; + isMentor: boolean; + guideUrl: string; } const TermsAgreementModal: React.FC = ({ isOpen, onClose, onAgree, + isMentor, + guideUrl, }) => { + const schema = isMentor + ? mentorTermsAgreementModalSchema + : menteeTermsAgreementModalSchema; const { register, handleSubmit, formState: { errors, isValid }, - } = useForm({ - resolver: zodResolver(termsSchema), + } = useForm({ + resolver: zodResolver(schema), mode: 'onChange', - defaultValues: { - agreed: false, - consentGiven: false, - }, + defaultValues: isMentor + ? { agreed: false, canCommit: false } + : { agreed: false, consentGiven: false }, }); - const onSubmit = (data: TermsFormData) => { + const onSubmit = (data: MentorFormData | MenteeFormData) => { if (isValid) { - console.log('Form is valid. Submitting data:', data); onAgree(data); } else { - console.log('Form is invalid. Errors:', errors); + console.error('Form is invalid. Errors:', errors); } }; if (!isOpen) return null; + const guideType = isMentor ? 'Mentor' : 'Mentee'; + const title = isMentor + ? 'One Last Step to Join as a ScholarX Mentor' + : 'ScholarX Mentee Terms and Privacy'; + return (
-
-
+
+
-

- ScholarX Mentee Guide 2024 +

+ {title}

-
-

Introduction

-

- Welcome to ScholarX! This guide is designed to help you navigate - through the ScholarX mentoring program, ensuring you make the - most out of this valuable opportunity. -

-

What is ScholarX?

-

- ScholarX is a 6-month mentoring program designed by the - Sustainable Education Foundation to connect Sri Lankan - undergraduate students with global experts from academia and - industry. This program aims to enrich students' academic - and professional journey, providing valuable guidance and - opportunities for personal and career growth. +

+

+ ScholarX {guideType} Guide 2024

- -

Communication

-
    -
  • - Initiate Contact: Once matched, your mentor - will send the first email. Promptly respond and arrange the - first meeting. -
    - - If you don’t receive a mail within 1 week of matching a - mentor, let us know to check with the mentor. - -
  • -
  • - Establish Ground Rules: Discuss and set - expectations, including the frequency of meetings and - communication methods. -
  • -
  • - Preferred Platforms: -
      -
    • Zoom
    • -
    • Google Meet
    • -
    • Skype
    • -
    • Messenger
    • -
    -
  • -
  • - Preparation: -
      -
    • Prepare questions for your mentor.
    • -
    • - Bring necessary resources (e.g., CVs, research papers). -
    • -
    • Complete any tasks assigned by your mentor.
    • -
    -
  • -
- -

Mentoring Sessions

-

- Focus Areas: -

-
    -
  • Learn through reflection on your mentor’s experiences.
  • -
  • Follow recommended online courses and certifications.
  • -
  • - Seek guidance on international competitions and scholarships. -
  • -
  • Discuss professional tools and methods.
  • -
  • - General career guidance and project collaboration if possible. -
  • -
- -

Checkpoints

-
    -
  • - First Meeting: Ensure your mentor contacts - you and schedules the first meeting. -
  • -
  • - Monthly Check-ins: Submit monthly updates on - your progress{' '} - - via the provided Google form. +
  • -
  • - Public Sharing: Make at least 3 media - submissions during the 6-month period. Include links in the - monthly check-ins. -
      -
    • - Types of Media: -
    • -
        -
      • - Written: Blogs on personal websites, Medium Blogspot. -
      • -
      • Video: YouTube, Facebook.
      • -
      • Audio: Anchor, YouTube, podcasts.
      • -
      -
    -
  • -
  • - Social Media: Share your experience using - hashtags #SEF and #ScholarX. -
  • -
- -

Etiquette

-
    -
  • - Commitment: Adhere to scheduled meetings and - inform your mentor in advance if you need to reschedule. -
  • -
  • - Proactivity: Actively seek feedback and - advice. -
  • -
  • - Mutual Respect: Remember, mentorship is a - two-way relationship. Be open to learning and sharing ideas. -
  • -
+ +
+
-

Conclusion

-

- A concluding ceremony will round off the program, with a date to - be determined. Maintaining contact with your mentor after the - program is at their discretion. -
- For any questions, please contact the Program Manager at - sustainableedufoundation@gmail.com. -

+
+
-
+ {!isMentor && ( + <> +

+ Privacy Statement +

+

+ Sustainable Foundation Education assures that your video + submission will be used exclusively for application evaluation + purposes. We are committed to protecting your privacy and will + not use your video for any other activities, such as general + AI training or public distribution. Your personal information + and video content will be handled with the utmost + confidentiality. +

+ + )} + +
{errors.agreed && ( -

{errors.agreed.message}

+

+ {errors.agreed.message as string} +

)} - {errors.consentGiven && ( -

- {errors.consentGiven.message} + {(errors.canCommit ?? errors.consentGiven) && ( +

+ { + (errors.canCommit?.message ?? + errors.consentGiven?.message) as string + }

)}
diff --git a/src/pages/MenteeRegistration/index.tsx b/src/pages/MenteeRegistration/index.tsx index d60838a2..bde1dfc4 100644 --- a/src/pages/MenteeRegistration/index.tsx +++ b/src/pages/MenteeRegistration/index.tsx @@ -106,13 +106,14 @@ const MenteeRegistration: React.FC = () => { setCurrentStep((prevStep) => prevStep - 1); }; - const onSubmit: SubmitHandler = async (data) => { + const onSubmit: SubmitHandler = async () => { setIsModalOpen(true); }; const handleModalAgree = async (agreedData: { agreed: boolean; - consentGiven: boolean; + consentGive?: boolean; + canCommit?: boolean; }) => { setIsModalOpen(false); setIsSubmitting(true); @@ -156,9 +157,6 @@ const MenteeRegistration: React.FC = () => { }, }); - console.log('Form State:', watch()); - console.log('Form Errors:', errors); - console.log('IsModalOpen', isModalOpen); return (
Become a Mentee
@@ -384,15 +382,6 @@ const MenteeRegistration: React.FC = () => { register={register} error={errors.submission} /> -

Privacy Statement

-

- Sustainable Foundation Education assures that your video - submission will be used exclusively for application evaluation - purposes. We are committed to protecting your privacy and will not - use your video for any other activities, such as general AI - training or public distribution. Your personal information and - video content will be handled with the utmost confidentiality. -

)} {status === 'error' ? ( @@ -469,6 +458,8 @@ const MenteeRegistration: React.FC = () => { setIsModalOpen(false); }} onAgree={handleModalAgree} + isMentor={false} + guideUrl="https://docs.google.com/document/d/1gIYte14FIQtqUhGiMErZRovhNErdUrFdQ0LnCFFnfag/" />
); diff --git a/src/pages/MentorRegistration/MentorRegistration.component.tsx b/src/pages/MentorRegistration/MentorRegistration.component.tsx index 8e02c51b..456e9e28 100644 --- a/src/pages/MentorRegistration/MentorRegistration.component.tsx +++ b/src/pages/MentorRegistration/MentorRegistration.component.tsx @@ -13,6 +13,7 @@ import useProfile from '../../hooks/useProfile'; import { useLoginModalContext } from '../../contexts/LoginModalContext'; import useMentor from '../../hooks/useMentor'; import { Link } from 'react-router-dom'; +import TermsAgreementModalMentor from '../../components/TermsAgreementModal'; const steps = [ { @@ -44,6 +45,7 @@ const MentorRegistrationPage: React.FC = () => { setError, setValue, unregister, + getValues, formState: { errors }, } = useForm({ resolver: zodResolver(MentorApplicationSchema), @@ -73,6 +75,8 @@ const MentorRegistrationPage: React.FC = () => { const [image, setImage] = useState(null); const [profilePic, setProfilePic] = useState(user?.image_url); const [currentStep, setCurrentStep] = useState(0); + const [isModalOpen, setIsModalOpen] = useState(false); + const [isSubmitting, setIsSubmitting] = useState(false); const handleNext = async (): Promise => { let fields = steps[currentStep].fields; @@ -115,12 +119,8 @@ const MentorRegistrationPage: React.FC = () => { } }, [watch('isPastMentor')]); - const onSubmit: SubmitHandler = async (data) => { - const { profilePic, ...application } = data; - await createMentorApplication(application as MentorApplication); - if (image) { - await updateProfile({ profile: null, image }); - } + const onSubmit: SubmitHandler = async () => { + setIsModalOpen(true); }; const handleProfilePicChange = (event: ChangeEvent) => { @@ -145,6 +145,31 @@ const MentorRegistrationPage: React.FC = () => { document.getElementById('profilePic')?.click(); }; + const handleModalAgree = async (data: { + agreed: boolean; + canCommit?: boolean; + consentGiven?: boolean; + }) => { + setIsModalOpen(false); + setIsSubmitting(true); + const formData = getValues(); + try { + const validatedData = MentorApplicationSchema.parse({ + ...formData, + ...data, + }); + await createMentorApplication(validatedData); + if (image) { + await updateProfile({ profile: null, image }); + } + } catch (error) { + console.error('Error submitting application:', error); + // Handle validation errors here if needed + } finally { + setIsSubmitting(false); + } + }; + return (
Become a Mentor
@@ -404,16 +429,9 @@ const MentorRegistrationPage: React.FC = () => { )}
- )} + {categoriesError !== null ? (
{ {categoriesError.message}
) : null} + {isApplicationError && applicationError instanceof AxiosError ? (
{ {applicationError.response?.data.message}
) : null} + {applicationSuccess ? (
{ you!
) : null} +
{ Previous )} + {currentStep < 2 && ( )} + {currentStep === 2 && !applicationSuccess && ( )} + {applicationSuccess && ( { )}
+ { + setIsModalOpen(false); + }} + onAgree={handleModalAgree} + isMentor={true} + guideUrl="https://docs.google.com/document/d/1uMMcGWJ35nblOj1zZ1XzJuYm-LOi1Lyj02yYRNsaOkY/" + />
); }; diff --git a/src/schemas.ts b/src/schemas.ts index 95d9b29e..0ba360d2 100644 --- a/src/schemas.ts +++ b/src/schemas.ts @@ -72,9 +72,6 @@ export const MentorApplicationSchema = z.object({ noOfMentees: z.number().min(0, { message: 'Number of mentees must be greater than or equal to 0', }), - canCommit: z.boolean().refine((val) => val, { - message: 'You must mention if you can commit', - }), mentoredYear: z .number({ invalid_type_error: 'Mentored year is required' }) .or(z.number().min(0)) @@ -101,3 +98,21 @@ export const MenteeCheckInSchema = z.object({ .url('Please provide a valid URL') .min(1, 'Please provide a media link'), }); + +export const mentorTermsAgreementModalSchema = z.object({ + agreed: z.boolean().refine((val) => val, { + message: 'You must agree to the ScholarX Mentor Guide 2024', + }), + canCommit: z.boolean().refine((val) => val, { + message: 'You must mention if you can commit', + }), +}); + +export const menteeTermsAgreementModalSchema = z.object({ + agreed: z.boolean().refine((val) => val, { + message: 'You must agree to the ScholarX Mentee Guide 2024', + }), + consentGiven: z.boolean().refine((val) => val, { + message: 'You must give consent to proceed', + }), +}); From bc302056460ba0f7d3206aeae77451e227047159 Mon Sep 17 00:00:00 2001 From: Madhawa Monarawila Date: Sun, 29 Sep 2024 10:01:04 +0530 Subject: [PATCH 3/5] Fix test issues --- src/pages/MenteeRegistration/index.tsx | 1 - src/pages/MentorRegistration/MentorRegistration.component.tsx | 1 - src/schemas.ts | 2 ++ 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/MenteeRegistration/index.tsx b/src/pages/MenteeRegistration/index.tsx index bde1dfc4..32992437 100644 --- a/src/pages/MenteeRegistration/index.tsx +++ b/src/pages/MenteeRegistration/index.tsx @@ -129,7 +129,6 @@ const MenteeRegistration: React.FC = () => { } } catch (error) { console.error('Error submitting application:', error); - // Handle validation errors here if needed } finally { setIsSubmitting(false); } diff --git a/src/pages/MentorRegistration/MentorRegistration.component.tsx b/src/pages/MentorRegistration/MentorRegistration.component.tsx index 456e9e28..616beb70 100644 --- a/src/pages/MentorRegistration/MentorRegistration.component.tsx +++ b/src/pages/MentorRegistration/MentorRegistration.component.tsx @@ -164,7 +164,6 @@ const MentorRegistrationPage: React.FC = () => { } } catch (error) { console.error('Error submitting application:', error); - // Handle validation errors here if needed } finally { setIsSubmitting(false); } diff --git a/src/schemas.ts b/src/schemas.ts index 0ba360d2..99cf861d 100644 --- a/src/schemas.ts +++ b/src/schemas.ts @@ -40,6 +40,7 @@ export const MenteeApplicationSchema = z.object({ submission: z .string() .url({ message: 'Please submit a valid video submission' }), + consentGiven: z.boolean().optional(), }); export const MentorApplicationSchema = z.object({ @@ -88,6 +89,7 @@ export const MentorApplicationSchema = z.object({ .url({ message: 'Invalid website URL' }) .optional() .or(z.literal('')), + canCommit: z.boolean().optional(), }); export const MenteeCheckInSchema = z.object({ From 5240a124a13dc691c4ecb753b10d1ef15255411a Mon Sep 17 00:00:00 2001 From: Madhawa Monarawila Date: Sun, 29 Sep 2024 11:24:37 +0530 Subject: [PATCH 4/5] Add minor fixes --- src/components/TermsAgreementModal/index.tsx | 9 +++------ src/schemas.ts | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/components/TermsAgreementModal/index.tsx b/src/components/TermsAgreementModal/index.tsx index 19f1ff59..82d3efa3 100644 --- a/src/components/TermsAgreementModal/index.tsx +++ b/src/components/TermsAgreementModal/index.tsx @@ -112,12 +112,12 @@ const TermsAgreementModal: React.FC = ({ className="form-checkbox h-4 w-4 text-blue-600 flex-shrink-0 mt-1" /> - I have read and agree to the ScholarX {guideType} Guide 2024 + I have read and agree to the ScholarX {guideType} Guide {errors.agreed && (

- {errors.agreed.message as string} + {errors.agreed.message}

)} @@ -135,10 +135,7 @@ const TermsAgreementModal: React.FC = ({ {(errors.canCommit ?? errors.consentGiven) && (

- { - (errors.canCommit?.message ?? - errors.consentGiven?.message) as string - } + {errors.canCommit?.message ?? errors.consentGiven?.message}

)}
diff --git a/src/schemas.ts b/src/schemas.ts index 99cf861d..fb5df085 100644 --- a/src/schemas.ts +++ b/src/schemas.ts @@ -103,7 +103,7 @@ export const MenteeCheckInSchema = z.object({ export const mentorTermsAgreementModalSchema = z.object({ agreed: z.boolean().refine((val) => val, { - message: 'You must agree to the ScholarX Mentor Guide 2024', + message: 'You must agree to the ScholarX Mentor Guide', }), canCommit: z.boolean().refine((val) => val, { message: 'You must mention if you can commit', @@ -112,7 +112,7 @@ export const mentorTermsAgreementModalSchema = z.object({ export const menteeTermsAgreementModalSchema = z.object({ agreed: z.boolean().refine((val) => val, { - message: 'You must agree to the ScholarX Mentee Guide 2024', + message: 'You must agree to the ScholarX Mentee Guide', }), consentGiven: z.boolean().refine((val) => val, { message: 'You must give consent to proceed', From 67dc9508de93338490088cdf1ad62de814471f8f Mon Sep 17 00:00:00 2001 From: Madhawa Monarawila <70215958+Madhawa97@users.noreply.github.com> Date: Sun, 29 Sep 2024 12:12:38 +0530 Subject: [PATCH 5/5] Update src/components/TermsAgreementModal/index.tsx Co-authored-by: Anjula Shanaka --- src/components/TermsAgreementModal/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/TermsAgreementModal/index.tsx b/src/components/TermsAgreementModal/index.tsx index 82d3efa3..52a56202 100644 --- a/src/components/TermsAgreementModal/index.tsx +++ b/src/components/TermsAgreementModal/index.tsx @@ -68,7 +68,7 @@ const TermsAgreementModal: React.FC = ({

- ScholarX {guideType} Guide 2024 + ScholarX {guideType} Guide