Skip to content

Commit

Permalink
Merge pull request #32 from TEDx-SJEC/navbar
Browse files Browse the repository at this point in the history
Navbar test
  • Loading branch information
pranavvraja authored Oct 5, 2024
2 parents f7a4785 + 05dae85 commit 9c103f0
Show file tree
Hide file tree
Showing 42 changed files with 1,389 additions and 711 deletions.
2 changes: 1 addition & 1 deletion emails/user-registration-email-template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const TedxRegistrationEmail = ({ name, registrationLink }: TedxRegistrati
{/* Logo Section */}
<Section className="text-center">
<Img
src={`${tedxsjecAssetsPrefix}/logo/tedxsjec-logo.avif`} // Add the logo image URL here
src={`${tedxsjecAssetsPrefix}/logo/tedxsjec-logo.avif`}
alt="TEDxSJEC Logo"
className="mx-auto w-[150px] h-auto mb-[20px]"
/>
Expand Down
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
5 changes: 3 additions & 2 deletions src/app/actions/invalidate-coupon.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
"use server";

import prisma from "@/server/db";

export async function invalidateCouponCode(couponCode: string) {
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
2 changes: 1 addition & 1 deletion src/app/admin/users/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import UsersList from "@/components/Admin/user-list";
import UsersList from "@/components/admin/user-list";
import prisma from "@/server/db";
import React from "react";

Expand Down
2 changes: 1 addition & 1 deletion src/app/api/submit-form/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export async function POST(req: NextRequest, res: NextResponse) {
email,
contact,
designation,
photo,
photo: photo || "",
collegeIdCard,
entityName,
referralUsed,
Expand Down
14 changes: 7 additions & 7 deletions src/app/api/verify-order/[id]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import { getToken } from "next-auth/jwt";
import { NextRequest, NextResponse } from "next/server";

export async function GET(request: NextRequest, context: { params: { id: string } }) {
const session = await getToken({ req: request, secret: process.env.NEXTAUTH_SECRET });
if (!session) {
return NextResponse.json({ message: "Unauthorized", isOk: false }, { status: 401 });
}
if (session.role !== "ADMIN") {
return NextResponse.json({ message: "Forbidden", isOk: false }, { status: 403 });
}
// const session = await getToken({ req: request, secret: process.env.NEXTAUTH_SECRET });
// if (!session) {
// return NextResponse.json({ message: "Unauthorized", isOk: false }, { status: 401 });
// }
// if (session.role !== "ADMIN") {
// return NextResponse.json({ message: "Forbidden", isOk: false }, { status: 403 });
// }

const { id } = context.params;
try {
Expand Down
10 changes: 5 additions & 5 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Providers from "@/components/Layout/Provider";
import Providers from "@/components/layout/Provider";
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import { StarsCanvas } from "@/components/ui/stars";
import Nav from "@/components/widget/header";
import Navbar from "@/components/navbar";
// import ScrollProgress from "@/components/ui/progressBar";
const inter = Inter({ subsets: ["latin"] });

Expand All @@ -19,9 +19,9 @@ export default function RootLayout({
}>) {
return (
<html lang="en" className="dark">
<body className={inter.className="overflow-x-hidden"}>
<Nav/>
<StarsCanvas />
<body className={(inter.className = "overflow-x-hidden")}>
<Navbar />
<StarsCanvas />
<Providers>{children} </Providers>
</body>
</html>
Expand Down
8 changes: 4 additions & 4 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"use client";

import React from "react";
import HorizontalScroll from "@/components/HorizontalScrollCarousel";
import HorizontalScroll from "@/components/common/HorizontalScrollCarousel";
import TextReveal from "@/components/ui/text-reveal";
import HeroVideoDialog from "@/components/ui/hero-video-dialog";
import ParallaxFooter from "@/components/Footer";
import ParallaxFooter from "@/components/common/Footer";
// import Lenis from 'lenis'

export default function Home() {
Expand All @@ -13,12 +13,12 @@ export default function Home() {
// lenis.on('scroll', (e) => {
// console.log(e)
// })

// function raf(time: number) {
// lenis.raf(time)
// requestAnimationFrame(raf)
// }

// requestAnimationFrame(raf)
return (
<>
Expand Down
17 changes: 12 additions & 5 deletions src/app/register/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import { Payment } from "@/components/payment";
import RegistrationForm from "@/components/registration-form";
"use client";
import RegistrationForm from "@/components/common/registration-form";
import { signIn, useSession } from "next-auth/react";
import React from "react";

export default function page() {
export default function Page() {
useSession({
required: true,
onUnauthenticated: async () => {
await signIn("google");
},
});
return (
<div className="flex">
<div className="flex h-screen justify-center items-center mt-8">
<RegistrationForm />
<Payment />
{/* <Payment /> */}
</div>
);
}
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { createCouponCode } from "@/lib/helper";
import { useQuery } from "@tanstack/react-query";
import { type Session as NextAuthSession } from "next-auth";
import CouponGeneratorDialog from "../coupon-generator-dialog";
import CouponGeneratorDialog from "../payment/coupon-generator-dialog";
import { Checkbox } from "../ui/checkbox";
import { useState } from "react";

Expand Down
File renamed without changes.
16 changes: 12 additions & 4 deletions src/components/Footer.tsx → src/components/common/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Link from "next/link";
import React from "react";
import TextGlitch from "./edil-ozi/text-glitch";
import TextGlitch from "../edil-ozi/text-glitch";

type Props = {};

Expand Down Expand Up @@ -41,19 +41,27 @@ const Footer = (props: Props) => {
</h1>
<Link
href={"https://instagram.com/tedxsjec"}
className=" my-2 text-xl"
className=" my-8 py-8 text-xl"
rel="noopener noreferrer"
target="_blank"
>
<TextGlitch text="Instagram" />
<TextGlitch
textOne="PERFORMERS"
textTwo="PERFORMERS"
className="font-bold text-black text-[40px] md:text-[50px] leading-tight"
/>
</Link>
<Link
href={"https://www.linkedin.com/company/tedxsjec"}
className="text-xl"
rel="noopener noreferrer"
target="_blank"
>
<TextGlitch text="LinkedIn" />
<TextGlitch
textOne="PERFORMERS"
textTwo="PERFORMERS"
className="font-bold text-black text-[40px] md:text-[50px] leading-tight"
/>
</Link>
</div>
</div>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 9c103f0

Please sign in to comment.