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

Test #34

Closed
wants to merge 28 commits into from
Closed

Test #34

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4b58a2b
Refactor package-lock.json to remove unnecessary license field
Vyshnav001 Oct 4, 2024
e716c81
Refactor invalidateCouponCode to include user session in coupon inval…
Vyshnav001 Oct 4, 2024
9997a7c
Refactor registration page layout to center content vertically
Vyshnav001 Oct 4, 2024
be5e684
refactor the registration page
Vyshnav001 Oct 4, 2024
8a90e6c
Merge branch 'main' of https://github.com/TEDx-SJEC/website into regi…
Vyshnav001 Oct 4, 2024
c08fe85
Refactor registration form to include file upload for photo and ID card
Vyshnav001 Oct 4, 2024
dc9bc52
Merge branch 'main' of https://github.com/TEDx-SJEC/website into regi…
Vyshnav001 Oct 4, 2024
a00a785
Merge branch 'main' of https://github.com/TEDx-SJEC/website into regi…
Vyshnav001 Oct 4, 2024
d0a689e
Update framer-motion package to version 11.11.1
Vyshnav001 Oct 4, 2024
99b3d6d
Add PaymentSuccessfulComponent
Vyshnav001 Oct 4, 2024
274c4d0
Fix issue with invalidating coupon code in Payment component
Vyshnav001 Oct 4, 2024
23a3c62
add : server action to submit the form
Vyshnav001 Oct 5, 2024
85ee617
add : component to show payment successful message
Vyshnav001 Oct 5, 2024
5e6fed1
feat : handle payment and form submission
Vyshnav001 Oct 5, 2024
1688f4e
add : component to show loading
Vyshnav001 Oct 5, 2024
8db0b87
comment some code
Vyshnav001 Oct 5, 2024
64d898c
refactored and added link to register
joywin2003 Oct 5, 2024
30f99ee
if unauthorized users tries to register, itll prompt to login
joywin2003 Oct 5, 2024
0b46f1f
Refactor header logo link to use Next.js Link component
joywin2003 Oct 5, 2024
8cc3eee
fix: the unwanted fluctualtion in image is resolved
joywin2003 Oct 5, 2024
dc8b04d
Refactor header menu animation and fix image layout
joywin2003 Oct 5, 2024
4aae291
Feat: updated the text glitch function
joywin2003 Oct 5, 2024
00be54f
Refactor header menu to use NavItem component
joywin2003 Oct 5, 2024
d23c9d1
Refactor social links component and use it in header menu
joywin2003 Oct 5, 2024
fa5ae54
Refactor: Rearrange components into a common folder for better organi…
joywin2003 Oct 5, 2024
e372b72
Refactor: Rearrange navbar components from header
joywin2003 Oct 5, 2024
eb9511e
Fix: resolved local build errors
joywin2003 Oct 5, 2024
212b44a
Refactor: used prettier to format the entire project
joywin2003 Oct 5, 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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
echo "TURSO_AUTH_TOKEN is set: ${{ env.TURSO_AUTH_TOKEN != '' }}"
echo "TURSO_DATABASE_URL is set: ${{ env.TURSO_DATABASE_URL != '' }}"
echo "RESEND_API_KEY" is set ${{ env.RESEND_API_KEY != '' }}
echo
echo
env:
NEXT_PUBLIC_SITE_URL: ${{ secrets.NEXT_PUBLIC_SITE_URL }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
Expand Down
159 changes: 83 additions & 76 deletions emails/user-registration-email-template.tsx
Original file line number Diff line number Diff line change
@@ -1,88 +1,95 @@
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 Talk Registration Successful!`;
export const TedxRegistrationEmail = ({
name,
registrationLink,
}: TedxRegistrationEmailProps) => {
const previewText = `TEDxSJEC Talk Registration Successful!`;

return (
<Html>
<Head />
<Preview>{previewText}</Preview>
<Tailwind>
<Body className="bg-white my-auto mx-auto font-sans px-4">
<Container className="border border-solid border-[#eaeaea] rounded my-[40px] mx-auto p-[20px] max-w-[465px]">
{/* Logo Section */}
<Section className="text-center">
<Img
src={`${tedxsjecAssetsPrefix}/logo/tedxsjec-logo.avif`} // Add the logo image URL here
alt="TEDxSJEC Logo"
className="mx-auto w-[150px] h-auto mb-[20px]"
/>
</Section>
{/* Heading Section */}
<Section className="mt-[32px] items-center">
<Heading className="text-black text-[24px] font-bold text-center p-0 my-[30px] mx-0">
<strong>TEDxSJEC Talk Registration Confirmed!</strong>
</Heading>
</Section>
<Text className="text-black text-[14px] leading-[24px]">
Dear {name ?? "Participant"},
</Text>
<Text className="text-black text-[14px] leading-[24px]">
We are excited to confirm your registration for TEDxSJEC Talk. <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>
{/* 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:
</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"
/>
</Section>
<Text className="text-black text-[14px] leading-[24px]">
We look forward to seeing you at TEDxSJEC! <br />
</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: [email protected]
</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>
</Container>
</Body>
</Tailwind>
</Html>
);
return (
<Html>
<Head />
<Preview>{previewText}</Preview>
<Tailwind>
<Body className="bg-white my-auto mx-auto font-sans px-4">
<Container className="border border-solid border-[#eaeaea] rounded my-[40px] mx-auto p-[20px] max-w-[465px]">
{/* Logo Section */}
<Section className="text-center">
<Img
src={`${tedxsjecAssetsPrefix}/logo/tedxsjec-logo.avif`}
alt="TEDxSJEC Logo"
className="mx-auto w-[150px] h-auto mb-[20px]"
/>
</Section>
{/* Heading Section */}
<Section className="mt-[32px] items-center">
<Heading className="text-black text-[24px] font-bold text-center p-0 my-[30px] mx-0">
<strong>TEDxSJEC Talk Registration Confirmed!</strong>
</Heading>
</Section>
<Text className="text-black text-[14px] leading-[24px]">
Dear {name ?? "Participant"},
</Text>
<Text className="text-black text-[14px] leading-[24px]">
We are excited to confirm your registration for TEDxSJEC Talk.{" "}
<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>
{/* 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:
</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"
/>
</Section>
<Text className="text-black text-[14px] leading-[24px]">
We look forward to seeing you at TEDxSJEC! <br />
</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: [email protected]
</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>
</Container>
</Body>
</Tailwind>
</Html>
);
};

export default TedxRegistrationEmail;
22 changes: 10 additions & 12 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
/** @type {import('next').NextConfig} */
const nextConfig = {

images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'tedx-sjec.github.io',
port: '',
pathname: '/**',
},
],
},

images: {
remotePatterns: [
{
protocol: "https",
hostname: "tedx-sjec.github.io",
port: "",
pathname: "/**",
},
],
},
};

export default nextConfig;
10 changes: 4 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"crypto": "^1.0.1",
"framer-motion": "^11.9.0",
"framer-motion": "^11.11.1",
"gsap": "^3.12.5",
"ioredis": "^5.4.1",
"jest": "^29.7.0",
Expand Down
26 changes: 15 additions & 11 deletions src/app/actions/invalidate-coupon.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
"use server";

import prisma from "@/server/db";

export async function invalidateCouponCode(couponCode: string) {
if (!couponCode) return;
const resp = await prisma.referral.update({
where: {
code: couponCode,
},
data: {
isUsed: true,
},
});
import { type Session as NextAuthSession } from "next-auth";
export async function invalidateCouponCode(
couponCode: string,
session: NextAuthSession,
) {
if (!couponCode) return;
const resp = await prisma.referral.update({
where: {
code: couponCode,
},
data: {
isUsed: true,
usedById: session.user.id,
},
});
}
27 changes: 27 additions & 0 deletions src/app/actions/submit-form.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"use server";

import { FormDataInterface } from "@/components/common/registration-form";
import { getServerSideSession } from "@/lib/get-server-session";
import prisma from "@/server/db";

export async function submitForm(data: FormDataInterface, amount: number) {
const session = await getServerSideSession();
if (!session) {
return;
}

return await prisma.form.create({
data: {
name: data.name,
usn: data.usn,
email: data.email,
contact: data.phone,
designation: data.designation,
paidAmount: amount,
photo: data.photo,
collegeIdCard: data.idCard,
createdById: session.user.id,
entityName: data.name,
},
});
}
4 changes: 2 additions & 2 deletions src/app/admin/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import Providers from "@/components/Layout/Provider";
import { AdminNavbar } from "@/components/Admin/Navbar/navbar";
import Providers from "@/components/layout/Provider";
import { AdminNavbar } from "@/components/admin/Navbar/navbar";
import { useSession } from "next-auth/react";

const inter = Inter({ subsets: ["latin"] });
Expand Down
2 changes: 1 addition & 1 deletion src/app/admin/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import { Coupon } from "@/components/Admin/code-generation-card";
import { Coupon } from "@/components/admin/code-generation-card";
import { useSession } from "next-auth/react";
export default function AdminPage() {
const { data: session } = useSession();
Expand Down
2 changes: 1 addition & 1 deletion src/app/admin/payment/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SearchableInfiniteScrollTable } from "@/components/searchable-infinite-scroll-table";
import { SearchableInfiniteScrollTable } from "@/components/common/searchable-infinite-scroll-table";
import React from "react";

export default async function Payments() {
Expand Down
Loading
Loading