Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #77

Merged
merged 35 commits into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
817a962
add new sjec_user schema
Vyshnav001 Nov 23, 2024
9f8a94a
Add isAllowedToAccess function to check if user is allowed to access
Vyshnav001 Nov 23, 2024
ffaab7e
Refactor initial user data retrieval in Users page component
Vyshnav001 Nov 23, 2024
4fa4cee
Refactor create-order route to improve error handling and receipt gen…
Vyshnav001 Nov 23, 2024
712a4c5
Refactor GET route in verify-order to improve authentication and auth…
Vyshnav001 Nov 23, 2024
cd05bca
Refactor user-list component to fix duplication issue
Vyshnav001 Nov 23, 2024
9cf65ae
add signIn callback
Vyshnav001 Nov 23, 2024
e2762b0
remove console.logs
Vyshnav001 Nov 23, 2024
c2c16ec
remove console.logs
Vyshnav001 Nov 23, 2024
7c77e18
fix file upload component
Vyshnav001 Nov 23, 2024
76ad2a5
add toast
Vyshnav001 Nov 23, 2024
be4de05
toast
Vyshnav001 Nov 23, 2024
fe2dd69
Merge branch 'main' of https://github.com/TEDx-SJEC/website into fixes
Vyshnav001 Nov 23, 2024
2c2af74
update email template
Vyshnav001 Nov 23, 2024
48fcd8e
Refactor authentication and authorization in verify-order route
Vyshnav001 Nov 23, 2024
b809535
Refactor time format in FullScreenCTA component
Vyshnav001 Nov 23, 2024
adf899d
Add privacy policy page
Vyshnav001 Nov 23, 2024
815c769
Add refund policy page
Vyshnav001 Nov 23, 2024
a5bb219
Add terms and conditions page
Vyshnav001 Nov 23, 2024
06db9ed
Refactor QR code validation and redirection in verify page
Vyshnav001 Nov 23, 2024
7a9d0d5
Refactor refund page component
Vyshnav001 Nov 23, 2024
e33f504
Refactor CTA section to update interactive workshops description
Vyshnav001 Nov 23, 2024
541b2cc
Refactor footer links to update privacy policy and terms of service URLs
Vyshnav001 Nov 23, 2024
6bad400
Refactor legal information pages
Vyshnav001 Nov 23, 2024
7431bbd
changed the duration of header
joywin2003 Nov 24, 2024
792ba63
minor: change in photo description
joywin2003 Nov 24, 2024
c5b4080
Refactor CTA section to update description and adjust hero section ma…
joywin2003 Nov 24, 2024
aa568dc
Refactor register button component for improved styling and usage in …
joywin2003 Nov 24, 2024
b535aeb
redesigned the privacy policy
joywin2003 Nov 24, 2024
59e93bd
refactor: move footer to layout and redesign the contact page and fil…
joywin2003 Nov 24, 2024
e33b5e8
style: redesigned privacy policy, refund and terms for improved read…
joywin2003 Nov 24, 2024
89d0727
refactor: adjust header height, footer margin, and logo dimensions fo…
joywin2003 Nov 24, 2024
25bf53e
refactor: adjust logo dimensions and header padding for improved layout
joywin2003 Nov 24, 2024
4b029c1
refactor: add back navigation button and adjust layout for privacy, r…
joywin2003 Nov 24, 2024
8dc2b9b
fix: add MCA email validation to auth options
joywin2003 Nov 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading