From 73f4647ec59e4bdbd4f00bf7b2c981887e0b30ce Mon Sep 17 00:00:00 2001 From: Joywin Bennis <107112207+joywin2003@users.noreply.github.com> Date: Sun, 24 Nov 2024 19:29:28 +0530 Subject: [PATCH 1/4] fix: validate coupon code length and handle empty input in registration form --- src/components/common/registration-form.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/common/registration-form.tsx b/src/components/common/registration-form.tsx index 1d02a94..64f1bdd 100644 --- a/src/components/common/registration-form.tsx +++ b/src/components/common/registration-form.tsx @@ -220,6 +220,13 @@ export default function RegistrationForm() { const verifyCoupon = async () => { const couponCode = form.getValues("couponCode"); + if (!couponCode) { + return; + } + if (couponCode.length !== 10) { + toast.error("Invalid Coupon Code"); + return; + } try { const result = await getPrice(couponCode); if (!result.success) { @@ -535,7 +542,7 @@ export default function RegistrationForm() { Date: Sun, 24 Nov 2024 22:18:34 +0530 Subject: [PATCH 2/4] feat: add Dr. Lavina Marilla Noronha to speakers list and replace img tag with Next.js Image component --- src/components/common/speakers.tsx | 5 ++++- src/constants/index.ts | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/common/speakers.tsx b/src/components/common/speakers.tsx index 76f591b..03ec8d5 100644 --- a/src/components/common/speakers.tsx +++ b/src/components/common/speakers.tsx @@ -4,6 +4,7 @@ import gsap from "gsap"; import ScrollTrigger from "gsap/ScrollTrigger"; import { useGSAP } from "@gsap/react"; import { speakers } from "@/constants"; +import Image from "next/image"; export default function Component() { useGSAP(() => { @@ -40,10 +41,12 @@ export default function Component() { } items-stretch justify-between bg-black/40 rounded-2xl overflow-hidden shadow-xl border border-white border-opacity-20`} > - diff --git a/src/constants/index.ts b/src/constants/index.ts index 1551b86..964c6ce 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -63,4 +63,11 @@ export const speakers: Speaker[] = [ "Anish Shetty is a motorsport icon with over 206 podiums and 6 championships to his name, blazing trails on national and international platforms. As the first Asian to secure a podium in the eSC World Championship, he has consistently showcased excellence in racing. A multiple-time Indian National Motorcycle Racing and Rallying Champion, and the Royal Enfield Continental GT Cup Champion, Anish combines skill with endurance, earning the title of Fittest Man in Asia-2021 in the EF category. Founder of PRN Motorsport and a dedicated coach, he has trained over 1200+ participants, inspiring future racers through passion and perseverance.", img: `${tedxsjecAssetsPrefix}/speakers/cropped-Anish1.avif`, }, + { + id: 8, + name: " Dr Lavina Marilla Noronha", + profession: "Director of Ave Maria Palliative Care", + description:"Dr. Lavina Noronha, Director of Ave Maria Palliative Care, exemplifies humility and dedication. With an MPhil from NIMHANS and a Doctorate from the University of Illinois, she has served as an associate professor and director at Our Lady of the Lake University, USA, with extensive clinical experience in mental health, hospice, and crisis care. Her life changed when she returned to India realizing the lack of support for terminally ill patients. She founded Ave Maria Palliative Care, providing free, compassionate care to patients, regardless of their background, with a dedicated team and community support.", + img: `${tedxsjecAssetsPrefix}/speakers/dr-lavina-1.avif`, + }, ]; \ No newline at end of file From d2b9da4920a80e6b966510550a25ac623a273780 Mon Sep 17 00:00:00 2001 From: Joywin Bennis <107112207+joywin2003@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:35:37 +0530 Subject: [PATCH 3/4] changed the prices --- src/constants/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/constants/index.ts b/src/constants/index.ts index 964c6ce..0ebd14f 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -1,10 +1,10 @@ import { tedxsjecAssetsPrefix } from "@/lib/utils"; import { Speaker } from "@/types"; -export const basePrice = 1000; +export const basePrice = 980.39; export const initialdiscount = 0; -export const sjecStudentPrice = 750; -export const sjecFacultyPrice = 800; +export const sjecStudentPrice = 735.29; +export const sjecFacultyPrice = 784.31; export const speakers: Speaker[] = [ { id: 1, From 1a8df872927622dc220b14c1d981a5656d1b15eb Mon Sep 17 00:00:00 2001 From: Joywin Bennis <107112207+joywin2003@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:46:31 +0530 Subject: [PATCH 4/4] add the formula to display the right numbers --- src/components/common/registration-form.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/common/registration-form.tsx b/src/components/common/registration-form.tsx index 64f1bdd..4601fc4 100644 --- a/src/components/common/registration-form.tsx +++ b/src/components/common/registration-form.tsx @@ -529,7 +529,7 @@ export default function RegistrationForm() { Total Amount - ₹{pricing.finalPrice} + ₹{Math.round(pricing.finalPrice+ 0.02*pricing.finalPrice)}
₹{pricing.finalPrice}
₹{Math.round(pricing.finalPrice+ 0.02*pricing.finalPrice)}