Skip to content

Commit

Permalink
Merge pull request #77 from TEDx-SJEC/fixes
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
joywin2003 authored Nov 24, 2024
2 parents 6669528 + 8dc2b9b commit 575c92d
Show file tree
Hide file tree
Showing 32 changed files with 1,439 additions and 1,292 deletions.
109 changes: 61 additions & 48 deletions emails/user-registration-email-template.tsx
Original file line number Diff line number Diff line change
@@ -1,88 +1,101 @@
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 Confirmed!`;

return (
<Html>
<Head />
<Preview>{previewText}</Preview>
<Tailwind>
<Body className="bg-white my-auto mx-auto font-sans p-1">
<Container className="border border-solid border-[#eaeaea] rounded mx-auto p-[20px] max-w-[465px]">
<Body className="bg-white my-auto mx-auto font-sans p-4">
<Container className="border border-solid border-gray-300 rounded-lg mx-auto p-6 max-w-md shadow-lg">
{/* Logo Section */}
<Section className="text-center">
<Img
src={`${tedxsjecAssetsPrefix}/logo/main-logo.png`}
alt="TEDxSJEC Logo"
className="mx-auto w-[240px] h-[180px] mt-4"
className="mx-auto w-60 h-44 mt-4"
/>
</Section>

{/* Heading Section */}
<Section className="mt-[32px] items-center">
<Heading className="text-black text-[24px] font-bold text-center p-0 my-[20px] mx-0">
<strong>TEDxSJEC 2024 Registration Confirmed!</strong>
<Section className="mt-8 text-center">
<Heading className="text-black text-2xl font-extrabold mb-6">
🎉 Your TEDxSJEC 2024 Registration is Confirmed! 🎉
</Heading>
</Section>
<Text className="text-black text-[14px] leading-[24px]">
Dear {name ?? "Participant"},

<Text className="text-black text-base leading-6 mb-4">
Dear {name ?? "Valued Participant"},
</Text>
<Text className="text-black text-[14px] leading-[24px] justify-center">
We are excited to confirm your registration for TEDxSJEC 2024. <br />
You are all set to join us for an inspiring day filled with ideas worth sharing.
Please bring this email on the event day for a smooth entry process.

<Text className="text-gray-700 text-base leading-6 mb-6">
We’re thrilled to welcome you to TEDxSJEC 2024! Get ready for an extraordinary day
of inspiring talks, innovative ideas, and engaging conversations. Your journey
into a world of “ideas worth spreading” starts here.
</Text>

{/* QR Code Section */}
<Section className="text-center mt-[32px] mb-[32px]">
<Text className="text-center">
Below is your unique QR code for registration. Kindly keep it accessible on
event day for quick check-in:
<Section className="text-center my-8">
<Text className="text-gray-700 text-base mb-4">
Below is your unique QR code for event check-in. Please ensure you can access
it easily on the event day for a seamless entry process:
</Text>
<Img
className="mx-auto flex items-center justify-center py-4"
src={`https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${registrationLink}`}
alt="QR Code"
className="mx-auto"
/>
</Section>
<Text className="text-black text-[14px] leading-[24px]">
We look forward to seeing you at TEDxSJEC! <br />

<Text className="text-gray-700 text-base leading-6 mb-4">
We look forward to seeing you at TEDxSJEC 2024! If you have any questions or need
assistance, don’t hesitate to reach out to our support team.
</Text>
<Hr className="border border-solid border-[#eaeaea] my-[26px] mx-0 w-full" />
<Text className="text-[#666666] text-[12px] leading-[24px]">
Thanks & Regards, <br /> TEDxSJEC Team <br />
For any queries, feel free to contact us at:{" "}
<a href="mailto:[email protected]" className="text-[#0073e6] underline">

<Hr className="border border-solid border-gray-200 my-6" />

{/* Footer Section */}
<Text className="text-gray-500 text-sm leading-6 mb-4">
Thank you for being a part of TEDxSJEC 2024. If you have any questions, feel free
to reach out to us at:{" "}
<a href="mailto:[email protected]" className="text-blue-500 underline">
[email protected]
</a>
</Text>
<div className="flex flex-col items-center justify-center text-[12px] space-x-4">
<Button href="https://tedxsjec.in/privacy">Privacy Policy</Button>
&nbsp;|&nbsp;
<Button href="https://tedxsjec.in/refund">Refund Policy</Button>
&nbsp;|&nbsp;
<Button href="https://tedxsjec.in/terms">Terms and Conditions</Button>

<div className="flex justify-center space-x-2 text-sm text-gray-500">
<Button href="https://tedxsjec.in/privacy" className="text-blue-500 underline">
Privacy Policy
</Button>
<span>|</span>
<Button href="https://tedxsjec.in/refund" className="text-blue-500 underline">
Refund Policy
</Button>
<span>|</span>
<Button href="https://tedxsjec.in/terms" className="text-blue-500 underline">
Terms and Conditions
</Button>
</div>
</Container>
</Body>
Expand Down
Binary file modified prisma/dev.db
Binary file not shown.
Binary file modified prisma/dev.db-journal
Binary file not shown.
9 changes: 9 additions & 0 deletions prisma/migrations/20241123060552_sjec_user/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- CreateTable
CREATE TABLE "sjec_user" (
"id" TEXT NOT NULL PRIMARY KEY,
"name" TEXT NOT NULL,
"email" TEXT NOT NULL
);

-- CreateIndex
CREATE UNIQUE INDEX "sjec_user_email_key" ON "sjec_user"("email");
12 changes: 10 additions & 2 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ model Referral {
isUsed Boolean @default(false)
created_at DateTime @default(now())
createdBy User @relation("createdByUser", fields: [createdById], references: [id], onDelete: Cascade)
usedBy User? @relation("usedByUser", fields: [usedById], references: [id])
createdBy User @relation("createdByUser", fields: [createdById], references: [id], onDelete: Cascade)
usedBy User? @relation("usedByUser", fields: [usedById], references: [id])
forms Form[]
}

Expand Down Expand Up @@ -106,3 +106,11 @@ model Payment {
formId String? @map("form_id")
Form Form? @relation(fields: [formId], references: [id])
}

model SjecUser {
id String @id @default(cuid())
name String
email String @unique
@@map("sjec_user")
}
68 changes: 68 additions & 0 deletions src/app/(legal)/privacy/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
"use client";

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

export default function PrivacyPolicy() {
const router = useRouter();
return (
<Container className="mx-auto mt-24 md:mt-32 mb-1">
<div className="py-10 px-6 sm:px-12 md:px-20 lg:px-32 space-y-8 text-red-600 rounded-lg shadow-lg backdrop-blur-md">
<div className="flex items-center justify-start">
<button
className="text-red-600 hover:text-red-800 flex items-center space-x-2"
onClick={() => router.back()}
>
<svg
className="w-5 h-5"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M15 19l-7-7 7-7"
/>
</svg>
<span>Back</span>
</button>
</div>

<Text
variant="h1"
className={cn("text-4xl md:text-5xl font-bold text-center")}
>
Privacy Policy
</Text>

<div className="space-y-6">
{legalInfo.Privacy.map((privacy, index) => (
<div
key={index}
className=" border-gray-700 pb-2 mb-2 last:border-none last:pb-0 last:mb-0"
>
<Text
variant="h3"
className={cn(
"text-2xl md:text-3xl font-semibold mb-1 text-gray-200"
)}
>
{privacy.title}
</Text>

<p className="text-base md:text-lg text-gray-400 leading-7 md:leading-8 text-justify">
{privacy.description}
</p>
</div>
))}
</div>
</div>
</Container>
);
}
69 changes: 69 additions & 0 deletions src/app/(legal)/refund/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
"use client";

import Container from "@/components/shared/container";
import { Text } from "@/components/shared/text";
import { legalInfo } from "@/data/legal-info";
import { cn } from "@/lib/utils";
import Link from "next/link"; // To create a back link
import { useRouter } from "next/navigation";

export default function Refund() {
const router = useRouter();
return (
<Container className="mx-auto mt-24 md:mt-32 mb-1">
<div className="py-10 px-6 sm:px-12 md:px-20 lg:px-32 space-y-8 text-red-600 rounded-lg shadow-lg backdrop-blur-md">
<div className="flex items-center justify-start">
<button className="text-red-600 hover:text-red-800 flex items-center space-x-2"
onClick={() => router.back()}>
<svg
className="w-5 h-5"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M15 19l-7-7 7-7"
/>
</svg>
<span>Back</span>
</button>
</div>

{/* Title Section */}
<div className="text-center">
<Text variant="h1" className={cn("text-4xl md:text-5xl font-bold text-center")}>
Refund Policy
</Text>
</div>

{/* Policy Sections */}
<div className="space-y-6">
{legalInfo.Refund.map((refund, index) => (
<div
key={index}
className="border-gray-700 pb-2 mb-2 last:border-none last:pb-0 last:mb-0"
>
{/* Section Title */}
<Text
variant="h3"
className={cn("text-2xl md:text-3xl font-semibold mb-1 text-gray-200")}
>
{refund.title}
</Text>

{/* Section Description */}
<p
className="text-base md:text-lg text-gray-400 leading-7 md:leading-8 text-justify"
dangerouslySetInnerHTML={{ __html: refund.description }}
></p>
</div>
))}
</div>
</div>
</Container>
);
}
67 changes: 67 additions & 0 deletions src/app/(legal)/terms/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
"use client";

import Container from "@/components/shared/container";
import { Text } from "@/components/shared/text";
import { Button } from "@/components/ui/button";
import { legalInfo } from "@/data/legal-info";
import { cn } from "@/lib/utils";
import Link from "next/link";
import { useRouter } from "next/navigation";

export default function TermsAndConditions() {
const router = useRouter();
return (
<Container className="mx-auto mt-24 md:mt-32 mb-1">
<div className="py-10 px-6 sm:px-12 md:px-20 lg:px-32 space-y-8 text-red-600 rounded-lg shadow-lg backdrop-blur-md">
<div className="flex items-center justify-start">
<button
className="text-red-600 hover:text-red-800 flex items-center space-x-2"
onClick={() => router.back()}
>
<svg
className="w-5 h-5"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M15 19l-7-7 7-7"
/>
</svg>
<span>Back</span>
</button>
</div>
<Text
variant="h1"
className={cn("text-4xl md:text-5xl font-bold text-center")}
>
Terms and Conditions
</Text>
<div className="space-y-6">
{legalInfo.Terms.map((terms, index) => (
<div
key={index}
className="border-gray-700 pb-2 mb-2 last:border-none last:pb-0 last:mb-0"
>
<Text
variant="h3"
className={cn(
"text-2xl md:text-3xl font-semibold mb-1 text-gray-200"
)}
>
{terms.title}
</Text>
<p className="text-base md:text-lg text-gray-400 leading-7 md:leading-8 text-justify">
{terms.description}
</p>
</div>
))}
</div>
</div>
</Container>
);
}
2 changes: 1 addition & 1 deletion src/app/actions/invalidate-coupon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function invalidateCouponCode(
usedById: string;
};
}> {
console.log("coupon code = " + couponCode, "session = " + session.user.id);


if (!couponCode) {
return { success: false, message: "Coupon code is required" };
Expand Down
Loading

0 comments on commit 575c92d

Please sign in to comment.