From 641db4d3df3a78f75bb5b70e09c7a648f0a0085b Mon Sep 17 00:00:00 2001 From: pranavvraja Date: Thu, 12 Dec 2024 19:16:17 +0530 Subject: [PATCH 1/3] disabled buttons --- src/components/common/cta-section-2.tsx | 17 +++++++++-------- src/components/common/scrolling-banner.tsx | 2 +- src/components/navbar/register-button.tsx | 3 ++- src/components/widget/header.tsx | 3 ++- src/components/widget/hero.tsx | 3 ++- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/components/common/cta-section-2.tsx b/src/components/common/cta-section-2.tsx index 82e0171..6b06fb5 100644 --- a/src/components/common/cta-section-2.tsx +++ b/src/components/common/cta-section-2.tsx @@ -87,22 +87,23 @@ export default function FullScreenCTA() { -
-

+ {/*

*/} + {/*

Limited spots available!
- Register now - to secure your spot.
-

+ + Register now to secure your spot.
+
+

*/} - + {/* - -
+ */} + {/*
*/} ); diff --git a/src/components/common/scrolling-banner.tsx b/src/components/common/scrolling-banner.tsx index 81439f1..01f2d27 100644 --- a/src/components/common/scrolling-banner.tsx +++ b/src/components/common/scrolling-banner.tsx @@ -3,7 +3,7 @@ import { motion } from "framer-motion"; export default function ScrollingBanner() { - const sentence = " Registrations close soon • "; + const sentence = " Registrations closed • "; const repeatCount = 20; // Increase this number to add more repetitions return ( diff --git a/src/components/navbar/register-button.tsx b/src/components/navbar/register-button.tsx index 701e3d4..912f25f 100644 --- a/src/components/navbar/register-button.tsx +++ b/src/components/navbar/register-button.tsx @@ -8,9 +8,10 @@ const RegisterButton = () => { ); diff --git a/src/components/widget/header.tsx b/src/components/widget/header.tsx index 5881235..52dfe95 100644 --- a/src/components/widget/header.tsx +++ b/src/components/widget/header.tsx @@ -207,8 +207,9 @@ const Nav = () => { className="bg-red-600 hover:bg-red-700 text-xl text-white py-6 px-4 transition-all duration-300 transform hover:scale-105" onClick={handleRegisterClick} size="lg" + disabled > - Register Now + Registrations Closed diff --git a/src/components/widget/hero.tsx b/src/components/widget/hero.tsx index 785d7db..3fbc6d6 100644 --- a/src/components/widget/hero.tsx +++ b/src/components/widget/hero.tsx @@ -141,10 +141,11 @@ export default function HeroHighlight() {
From 9c940a141c111bf24a657902bfd05484c6bef518 Mon Sep 17 00:00:00 2001 From: pranavvraja Date: Thu, 12 Dec 2024 19:18:32 +0530 Subject: [PATCH 2/3] disabled buttons --- src/components/navbar/register-button.tsx | 18 +++++++++--------- src/components/widget/header.tsx | 2 +- src/components/widget/hero.tsx | 18 +++++++++--------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/components/navbar/register-button.tsx b/src/components/navbar/register-button.tsx index 912f25f..613e49c 100644 --- a/src/components/navbar/register-button.tsx +++ b/src/components/navbar/register-button.tsx @@ -5,15 +5,15 @@ import { Button } from "../ui/button"; const RegisterButton = () => { return ( - - - + // + + // ); }; diff --git a/src/components/widget/header.tsx b/src/components/widget/header.tsx index 52dfe95..f37b978 100644 --- a/src/components/widget/header.tsx +++ b/src/components/widget/header.tsx @@ -205,7 +205,7 @@ const Nav = () => {
  • - + {/* */} + + {/* */}
    From 2edf2bef548fe44ea4f565e01f40d46f9263d93f Mon Sep 17 00:00:00 2001 From: pranavvraja Date: Thu, 12 Dec 2024 19:21:12 +0530 Subject: [PATCH 3/3] disabled reg page --- src/app/register/page.tsx | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/app/register/page.tsx b/src/app/register/page.tsx index d55e9e4..fb246e6 100644 --- a/src/app/register/page.tsx +++ b/src/app/register/page.tsx @@ -8,6 +8,7 @@ import { tailChase } from "ldrs"; import { redirect } from "next/navigation"; export default function RegistrationPage() { + const { data: session } = useSession(); const { status } = useSession({ required: true, onUnauthenticated: async () => { @@ -42,6 +43,32 @@ export default function RegistrationPage() { ); } + if (!session) { + return ( +
    +
    +

    Unauthorized

    +

    + You need to log in to access this page. +

    +
    +
    + ); + } + + if (session.user.role !== "ADMIN" && session.user.role !== "COORDINATOR") { + return ( +
    +
    +

    Forbidden

    +

    + You do not have the required permissions to view this page. +

    +
    +
    + ); + } + return (