Skip to content

Commit

Permalink
Merge pull request #75 from TEDx-SJEC/contact
Browse files Browse the repository at this point in the history
update performers and speakers
  • Loading branch information
joywin2003 authored Nov 22, 2024
2 parents cdd543b + dda7da6 commit ccd8100
Show file tree
Hide file tree
Showing 36 changed files with 1,049 additions and 909 deletions.
33 changes: 18 additions & 15 deletions emails/user-registration-email-template.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
import { tedxsjecAssetsPrefix } from "@/lib/utils";
import {
Body,
Button,
Container,
Head,
Heading,
Hr,
Html,
Img,
Preview,
Section,
Text,
Body,
Button,
Container,
Head,
Heading,
Hr,
Html,
Img,
Preview,
Section,
Text,
} from "@react-email/components";
import { Tailwind } from "@react-email/tailwind";

interface TedxRegistrationEmailProps {
name?: string;
registrationLink: string;
name?: string;
registrationLink: string;
}

export const TedxRegistrationEmail = ({ name, registrationLink }: TedxRegistrationEmailProps) => {
const previewText = `TEDxSJEC 2024 Registration Successful!`;
export const TedxRegistrationEmail = ({
name,
registrationLink,
}: TedxRegistrationEmailProps) => {
const previewText = `TEDxSJEC 2024 Registration Successful!`;

return (
<Html>
Expand Down
2 changes: 1 addition & 1 deletion src/app/actions/get-price.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import prisma from "@/server/db";
import { basePrice, initialdiscount } from "@/constants";

export const getPrice = async (
couponCode?: string
couponCode?: string,
): Promise<{
success: boolean;
message?: string;
Expand Down
20 changes: 10 additions & 10 deletions src/app/actions/make-payment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ export async function makePayment({
});
const data = await resp.json();
if (data.isOk) {
toast.success("✅ Payment successful", {
description: "Your payment was successful",
});
window.location.href = "/";
} else {
toast.error("❌ Payment failed", {
description:
"Please try again. Contact support for help. " + data.error,
});
}
toast.success("✅ Payment successful", {
description: "Your payment was successful",
});
window.location.href = "/";
} else {
toast.error("❌ Payment failed", {
description:
"Please try again. Contact support for help. " + data.error,
});
}
},
notes: {
customerName: session?.user?.name,
Expand Down
12 changes: 8 additions & 4 deletions src/app/api/create-order/route.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { NextRequest, NextResponse } from "next/server";
import { razorpay } from "@/lib/razorpay";
import { randomUUID } from "crypto";

export async function POST(request: NextRequest) {
const { amount } = await request.json();
if (!amount || typeof amount !== "number" || amount <= 0) {
return NextResponse.json({ error: "Invalid amount" }, { status: 400 });
}
try {
const order = await razorpay.orders.create({
amount: amount * 100,
currency: "INR",
receipt: "receipt_" + Math.random().toString(36).substring(7),
receipt: `receipt_${Date.now()}_${randomUUID()}`,
});

return NextResponse.json(
Expand All @@ -16,17 +20,17 @@ export async function POST(request: NextRequest) {
},
{
status: 200,
},
}
);
} catch (error) {
console.log(error);
console.error("Razorpay order creation error:", error);
return NextResponse.json(
{
error: "Error creating order ",
},
{
status: 500,
},
}
);
}
}
2 changes: 1 addition & 1 deletion src/app/api/submit-form/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { RegistrationFormSchema, TRegistrationForm } from "@/utils/zod-schemas";
import prisma from "@/server/db";
import { getPrice } from "@/app/actions/get-price";
import getErrorMessage from "@/utils/getErrorMessage";
import {basePrice} from "@/constants";
import { basePrice } from "@/constants";

export async function GET() {
return NextResponse.json({ message: "Hello from the API!" });
Expand Down
13 changes: 13 additions & 0 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,16 @@ html.lenis body {
.lenis.lenis-scrolling iframe {
pointer-events: none !important;
}

::-webkit-scrollbar {
width: 0.1em;
}

::-webkit-scrollbar-track {
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
background-color: #e62b1e;
outline: 1px solid #e62b1e;
}
2 changes: 2 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import "./globals.css";
import TEDxStarsCanvas from "@/components/ui/stars";
import Nav from "@/components/widget/header";
import Script from "next/script";
import { ScrollProgressBar } from "@/components/common/scroll-progress";
const inter = Inter({ subsets: ["latin"] });
export const metadata: Metadata = {
title: "TEDxSJEC",
Expand Down Expand Up @@ -42,6 +43,7 @@ export default function RootLayout({
</head>
<body className={(inter.className = "overflow-x-hidden")}>
<div className="fixed top-0 w-full h-[100px] z-50 overflow-x-hidden backdrop-blur-md head-5 bg-black/5" />
<ScrollProgressBar />
<Nav />
<TEDxStarsCanvas />
<Providers>{children} </Providers>
Expand Down
7 changes: 3 additions & 4 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,19 @@ import Performers from "@/components/widget/performers";
import HeroHighlight from "@/components/widget/hero";
import Footer from "@/components/common/Footer-1";
import CTA from "@/components/common/cta-section-2";
import UnsplashGrid from "@/components/common/gridsplash";
export default function Home() {
// const [loading, setLoading] = useState(true);

// useEffect(() => {
// const timer = setTimeout(() => setLoading(false));
// const timer = setTimeout(() => setLoading(false));
// return () => clearTimeout(timer);
// }, []);

return (
<>
<div className="z-20 relative pt-20 overflow-x-clip 1">
<HeroHighlight />
<div className="h-full mt-20 mb-20" id="about">
<div className="h-full mt-20 mb-20 lg:mb-40" id="about">
<About />
</div>
<div id="speakers" className="">
Expand Down Expand Up @@ -57,7 +56,7 @@ export default function Home() {
</div>
<CTA />
</div>
<div id="contact">
<div id="contact" className="mt-10">
<Footer />
</div>
</div>
Expand Down
40 changes: 20 additions & 20 deletions src/app/refund/page.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
"use client"
"use client";

import Container from "@/components/shared/container";
import { Text } from "@/components/shared/text";
import {legalInfo} from "@/data/legal-info";
import { legalInfo } from "@/data/legal-info";
import { cn } from "@/lib/utils";

export default function Refund() {
return (
<Container className="mx-auto">
<div className="py-4 mx-6 sm:mx-12 space-y-4 pt-32 text-white">
<Text variant="h1" className={cn("text-5xl")}>
Refund Policy
</Text>
{legalInfo.Refund.map((refund, index) => (
<div key={index}>
<Text variant="h2" className={cn("text-2xl")}>
{refund.title}
</Text>
<p dangerouslySetInnerHTML={{ __html: refund.description }}></p>
</div>
))}
</div>
</Container>
);
}
return (
<Container className="mx-auto">
<div className="py-4 mx-6 sm:mx-12 space-y-4 pt-32 text-white">
<Text variant="h1" className={cn("text-5xl")}>
Refund Policy
</Text>
{legalInfo.Refund.map((refund, index) => (
<div key={index}>
<Text variant="h2" className={cn("text-2xl")}>
{refund.title}
</Text>
<p dangerouslySetInnerHTML={{ __html: refund.description }}></p>
</div>
))}
</div>
</Container>
);
}
13 changes: 3 additions & 10 deletions src/app/register/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,19 @@ import { tailChase } from "ldrs";
import { redirect } from "next/navigation";

export default function RegistrationPage() {
const {status} = useSession({
const { status } = useSession({
required: true,
onUnauthenticated: async () => {
await signIn("google");
await signIn("google");
},
});



if (typeof window !== "undefined") {
tailChase.register();
}

const [isLoading, setIsLoading] = useState(true);


useEffect(() => {
if (status === "loading") {
setIsLoading(true);
Expand All @@ -45,14 +42,10 @@ const {status} = useSession({
);
}





return (
<div className="flex min-h-screen flex-col items-center justify-center p-4">
<RegistrationForm />
<FABEmail/>
<FABEmail />
</div>
);
}
Loading

0 comments on commit ccd8100

Please sign in to comment.