Skip to content

Commit 0a2345f

Browse files
authored
Merge pull request #66 from TEDx-SJEC/footer
Footer
2 parents 0a0c758 + e8006f6 commit 0a2345f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3439
-2674
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
echo "TURSO_AUTH_TOKEN is set: ${{ env.TURSO_AUTH_TOKEN != '' }}"
3838
echo "TURSO_DATABASE_URL is set: ${{ env.TURSO_DATABASE_URL != '' }}"
3939
echo "RESEND_API_KEY" is set ${{ env.RESEND_API_KEY != '' }}
40-
echo
40+
echo
4141
env:
4242
NEXT_PUBLIC_SITE_URL: ${{ secrets.NEXT_PUBLIC_SITE_URL }}
4343
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
+83-76
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,95 @@
11
import { tedxsjecAssetsPrefix } from "@/lib/utils";
22
import {
3-
Body,
4-
Button,
5-
Container,
6-
Head,
7-
Heading,
8-
Hr,
9-
Html,
10-
Img,
11-
Preview,
12-
Section,
13-
Text,
3+
Body,
4+
Button,
5+
Container,
6+
Head,
7+
Heading,
8+
Hr,
9+
Html,
10+
Img,
11+
Preview,
12+
Section,
13+
Text,
1414
} from "@react-email/components";
1515
import { Tailwind } from "@react-email/tailwind";
1616

1717
interface TedxRegistrationEmailProps {
18-
name?: string;
19-
registrationLink: string;
18+
name?: string;
19+
registrationLink: string;
2020
}
2121

22-
export const TedxRegistrationEmail = ({ name, registrationLink }: TedxRegistrationEmailProps) => {
23-
const previewText = `TEDxSJEC Talk Registration Successful!`;
22+
export const TedxRegistrationEmail = ({
23+
name,
24+
registrationLink,
25+
}: TedxRegistrationEmailProps) => {
26+
const previewText = `TEDxSJEC Talk Registration Successful!`;
2427

25-
return (
26-
<Html>
27-
<Head />
28-
<Preview>{previewText}</Preview>
29-
<Tailwind>
30-
<Body className="bg-white my-auto mx-auto font-sans px-4">
31-
<Container className="border border-solid border-[#eaeaea] rounded my-[40px] mx-auto p-[20px] max-w-[465px]">
32-
{/* Logo Section */}
33-
<Section className="text-center">
34-
<Img
35-
src={`${tedxsjecAssetsPrefix}/logo/tedxsjec-logo.avif`}
36-
alt="TEDxSJEC Logo"
37-
className="mx-auto w-[150px] h-auto mb-[20px]"
38-
/>
39-
</Section>
40-
{/* Heading Section */}
41-
<Section className="mt-[32px] items-center">
42-
<Heading className="text-black text-[24px] font-bold text-center p-0 my-[30px] mx-0">
43-
<strong>TEDxSJEC Talk Registration Confirmed!</strong>
44-
</Heading>
45-
</Section>
46-
<Text className="text-black text-[14px] leading-[24px]">
47-
Dear {name ?? "Participant"},
48-
</Text>
49-
<Text className="text-black text-[14px] leading-[24px]">
50-
We are excited to confirm your registration for TEDxSJEC Talk. <br />
51-
You are all set to join us for an inspiring day filled with ideas worth sharing.
52-
Please bring this email on the event day for a smooth entry process.
53-
</Text>
54-
{/* QR Code Section */}
55-
<Section className="text-center mt-[32px] mb-[32px]">
56-
<Text className="text-center">
57-
Below is your unique QR code for registration. Kindly keep it accessible on
58-
event day for quick check-in:
59-
</Text>
60-
<Img
61-
className="mx-auto flex items-center justify-center py-4"
62-
src={`https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${registrationLink}`}
63-
alt="QR Code"
64-
/>
65-
</Section>
66-
<Text className="text-black text-[14px] leading-[24px]">
67-
We look forward to seeing you at TEDxSJEC! <br />
68-
</Text>
69-
<Hr className="border border-solid border-[#eaeaea] my-[26px] mx-0 w-full" />
70-
<Text className="text-[#666666] text-[12px] leading-[24px]">
71-
Thanks & Regards, <br /> TEDxSJEC Team <br />
72-
For any queries, feel free to contact us at: tedxsjec@sjec.ac.in
73-
</Text>
74-
<div className="flex flex-col items-center justify-center text-[12px] space-x-4">
75-
<Button href="https://tedxsjec.in/privacy">Privacy Policy</Button>
76-
&nbsp;|&nbsp;
77-
<Button href="https://tedxsjec.in/refund">Refund Policy</Button>
78-
&nbsp;|&nbsp;
79-
<Button href="https://tedxsjec.in/terms">Terms and Conditions</Button>
80-
</div>
81-
</Container>
82-
</Body>
83-
</Tailwind>
84-
</Html>
85-
);
28+
return (
29+
<Html>
30+
<Head />
31+
<Preview>{previewText}</Preview>
32+
<Tailwind>
33+
<Body className="bg-white my-auto mx-auto font-sans px-4">
34+
<Container className="border border-solid border-[#eaeaea] rounded my-[40px] mx-auto p-[20px] max-w-[465px]">
35+
{/* Logo Section */}
36+
<Section className="text-center">
37+
<Img
38+
src={`${tedxsjecAssetsPrefix}/logo/tedxsjec-logo.avif`}
39+
alt="TEDxSJEC Logo"
40+
className="mx-auto w-[150px] h-auto mb-[20px]"
41+
/>
42+
</Section>
43+
{/* Heading Section */}
44+
<Section className="mt-[32px] items-center">
45+
<Heading className="text-black text-[24px] font-bold text-center p-0 my-[30px] mx-0">
46+
<strong>TEDxSJEC Talk Registration Confirmed!</strong>
47+
</Heading>
48+
</Section>
49+
<Text className="text-black text-[14px] leading-[24px]">
50+
Dear {name ?? "Participant"},
51+
</Text>
52+
<Text className="text-black text-[14px] leading-[24px]">
53+
We are excited to confirm your registration for TEDxSJEC Talk.{" "}
54+
<br />
55+
You are all set to join us for an inspiring day filled with ideas
56+
worth sharing. Please bring this email on the event day for a
57+
smooth entry process.
58+
</Text>
59+
{/* QR Code Section */}
60+
<Section className="text-center mt-[32px] mb-[32px]">
61+
<Text className="text-center">
62+
Below is your unique QR code for registration. Kindly keep it
63+
accessible on event day for quick check-in:
64+
</Text>
65+
<Img
66+
className="mx-auto flex items-center justify-center py-4"
67+
src={`https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${registrationLink}`}
68+
alt="QR Code"
69+
/>
70+
</Section>
71+
<Text className="text-black text-[14px] leading-[24px]">
72+
We look forward to seeing you at TEDxSJEC! <br />
73+
</Text>
74+
<Hr className="border border-solid border-[#eaeaea] my-[26px] mx-0 w-full" />
75+
<Text className="text-[#666666] text-[12px] leading-[24px]">
76+
Thanks & Regards, <br /> TEDxSJEC Team <br />
77+
For any queries, feel free to contact us at: tedxsjec@sjec.ac.in
78+
</Text>
79+
<div className="flex flex-col items-center justify-center text-[12px] space-x-4">
80+
<Button href="https://tedxsjec.in/privacy">Privacy Policy</Button>
81+
&nbsp;|&nbsp;
82+
<Button href="https://tedxsjec.in/refund">Refund Policy</Button>
83+
&nbsp;|&nbsp;
84+
<Button href="https://tedxsjec.in/terms">
85+
Terms and Conditions
86+
</Button>
87+
</div>
88+
</Container>
89+
</Body>
90+
</Tailwind>
91+
</Html>
92+
);
8693
};
8794

8895
export default TedxRegistrationEmail;

src/app/actions/invalidate-coupon.ts

+15-15
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
import prisma from "@/server/db";
44
import { type Session as NextAuthSession } from "next-auth";
5-
export async function invalidateCouponCode(couponCode: string, session: NextAuthSession) {
6-
console.log("coupon code = "+couponCode , "session = " + session.user.id)
7-
if (!couponCode) return;
8-
return await prisma.referral.update({
9-
where:{
10-
code:couponCode,
11-
},
12-
data:{
13-
isUsed:true,
14-
usedById:session.user.id
15-
}
16-
17-
})
18-
19-
5+
export async function invalidateCouponCode(
6+
couponCode: string,
7+
session: NextAuthSession,
8+
) {
9+
console.log("coupon code = " + couponCode, "session = " + session.user.id);
10+
if (!couponCode) return;
11+
return await prisma.referral.update({
12+
where: {
13+
code: couponCode,
14+
},
15+
data: {
16+
isUsed: true,
17+
usedById: session.user.id,
18+
},
19+
});
2020
}

src/app/actions/submit-form.ts

+19-19
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@ import prisma from "@/server/db";
55
import { FormDataInterface } from "@/types";
66

77
export async function submitForm(data: FormDataInterface, amount: number) {
8-
const session = await getServerSideSession();
9-
if (!session) {
10-
return;
11-
}
8+
const session = await getServerSideSession();
9+
if (!session) {
10+
return;
11+
}
1212

13-
return await prisma.form.create({
14-
data: {
15-
name: data.name,
16-
usn: data.usn,
17-
email: data.email,
18-
foodPreference:data.foodPreference,
19-
contact: data.phone,
20-
designation: data.designation,
21-
paidAmount: amount,
22-
photo: data.photo,
23-
collegeIdCard: data.idCard,
24-
createdById: session.user.id,
25-
entityName: data.entityName,
26-
},
27-
});
13+
return await prisma.form.create({
14+
data: {
15+
name: data.name,
16+
usn: data.usn,
17+
email: data.email,
18+
foodPreference: data.foodPreference,
19+
contact: data.phone,
20+
designation: data.designation,
21+
paidAmount: amount,
22+
photo: data.photo,
23+
collegeIdCard: data.idCard,
24+
createdById: session.user.id,
25+
entityName: data.entityName,
26+
},
27+
});
2828
}

src/app/admin/layout.tsx

+32-22
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,42 @@ import { useSession } from "next-auth/react";
1010
const inter = Inter({ subsets: ["latin"] });
1111

1212
export default function RootLayout({
13-
children,
13+
children,
1414
}: Readonly<{
15-
children: React.ReactNode;
15+
children: React.ReactNode;
1616
}>) {
17-
const { data: session } = useSession({
18-
required: true,
19-
});
17+
const { data: session } = useSession({
18+
required: true,
19+
});
2020

21-
if (!session) {
22-
return <div className="w-screen h-screen flex justify-center items-center">Unauthorized</div>;
23-
}
24-
25-
if (session.user.role !== "ADMIN") {
26-
return <div className="w-screen h-screen flex justify-center items-center">Forbidden</div>;
27-
}
21+
if (!session) {
22+
return (
23+
<div className="w-screen h-screen flex justify-center items-center">
24+
Unauthorized
25+
</div>
26+
);
27+
}
2828

29+
if (session.user.role !== "ADMIN") {
2930
return (
30-
<html lang="en">
31-
<body className={inter.className}>
32-
<Providers>
33-
<div className="flex h-screen overflow-hidden">
34-
<AdminNavbar />
35-
<main className="flex-1 overflow-auto bg-indigo-50">{children}</main>
36-
</div>
37-
</Providers>
38-
</body>
39-
</html>
31+
<div className="w-screen h-screen flex justify-center items-center">
32+
Forbidden
33+
</div>
4034
);
35+
}
36+
37+
return (
38+
<html lang="en">
39+
<body className={inter.className}>
40+
<Providers>
41+
<div className="flex h-screen overflow-hidden">
42+
<AdminNavbar />
43+
<main className="flex-1 overflow-auto bg-indigo-50">
44+
{children}
45+
</main>
46+
</div>
47+
</Providers>
48+
</body>
49+
</html>
50+
);
4151
}

0 commit comments

Comments
 (0)