Skip to content

Commit

Permalink
Refactor: used prettier to format the entire project
Browse files Browse the repository at this point in the history
  • Loading branch information
joywin2003 committed Oct 5, 2024
1 parent eb9511e commit 212b44a
Show file tree
Hide file tree
Showing 35 changed files with 1,434 additions and 1,298 deletions.
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`}
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;
25 changes: 14 additions & 11 deletions src/app/actions/invalidate-coupon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@

import prisma from "@/server/db";
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,
},
});
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,
},
});
}
36 changes: 18 additions & 18 deletions src/app/actions/submit-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ 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;
}
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,
},
});
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,
},
});
}
Loading

0 comments on commit 212b44a

Please sign in to comment.