Skip to content

Commit

Permalink
Merge pull request #79 from TEDx-SJEC/price
Browse files Browse the repository at this point in the history
Changed the prices and added the new speakers
  • Loading branch information
joywin2003 authored Nov 25, 2024
2 parents 511a19c + 1a8df87 commit 9ce58c3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
11 changes: 9 additions & 2 deletions src/components/common/registration-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -522,7 +529,7 @@ export default function RegistrationForm() {
<div className="space-y-4">
<div>
<Label>Total Amount</Label>
<p className="text-2xl font-bold">{pricing.finalPrice}</p>
<p className="text-2xl font-bold">{Math.round(pricing.finalPrice+ 0.02*pricing.finalPrice)}</p>
</div>
<FormField
control={form.control}
Expand All @@ -535,7 +542,7 @@ export default function RegistrationForm() {
<Input
placeholder="Enter coupon code"
{...field}
disabled={memberType !== "external"}
disabled={memberType !== "external" || isProcessing}
/>
</FormControl>
<Button
Expand Down
5 changes: 4 additions & 1 deletion src/components/common/speakers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down Expand Up @@ -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`}
>
<div className="w-full md:w-1/2 h-auto md:h-auto">
<img
<Image
className="w-full h-full object-cover"
src={speaker.img}
alt={speaker.name}
width={1920}
height={1080}
/>
</div>

Expand Down
13 changes: 10 additions & 3 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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`,
},
];

0 comments on commit 9ce58c3

Please sign in to comment.