Skip to content

Commit

Permalink
Recruiter signup (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
Princekumarofficial authored Aug 31, 2024
1 parent cdd0cc9 commit cec0cdb
Show file tree
Hide file tree
Showing 17 changed files with 634 additions and 136 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"formik-wizard-form": "^2.1.0",
"framer-motion": "^10.16.4",
"js-cookie": "^3.0.5",
"jsonwebtoken": "^9.0.2",
"jwt-decode": "^4.0.0",
"lucide-react": "^0.302.0",
"material-icons": "^1.13.12",
Expand Down
Binary file added public/images/iiti_bg.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions src/app/(authroutes)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import "../globals.css";
import { Providers } from "@/store/provider";
import { Suspense } from "react";

interface Props {
children: React.ReactNode;
}

const AuthLayout = async ({ children }: Props) => {
return (
<div className="flex-auto flex h-[92vh] ">
<Providers>
<div className="flex-auto flex h-[92vh] ">
{/* sidebar and main content share this space */}
<Suspense fallback={<>Loading...</>}></Suspense>
<Providers>
<div className="w-screen min-h-screen h-max bg-[url(/images/iiti_bg.JPG)] bg-cover bg-fixed bg-center bg-no-repeat absolute">
<div className="w-full min-h-full h-max bg-gradient-to-b from-black/40 to-black/90 bg-opacity-50 absolute">
{children}
</div>
</div>
</Providers>
</div>
</Providers>
</div>
);
};

export default AuthLayout;
8 changes: 8 additions & 0 deletions src/app/(authroutes)/recruiter/signup/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import RecruiterSignup from "@/components/loginForms/recruiterSignup";
import React from "react";

const Signup = () => {
return <RecruiterSignup />;
};

export default Signup;
File renamed without changes.
25 changes: 25 additions & 0 deletions src/app/(routes)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import "../globals.css";
import Sidebar from "@/components/Sidebar";
import MainContent from "@/components/MainContent";
import { Providers } from "@/store/provider";
import { Suspense } from "react";

interface Props {
children: React.ReactNode;
}

const RouteLayout = async ({ children }: Props) => {
return (
<div className="flex-auto flex h-[92vh] ">
{/* sidebar and main content share this space */}
<Suspense fallback={<>Loading...</>}>
<Sidebar />
</Suspense>
<MainContent>
<Providers>{children}</Providers>
</MainContent>
</div>
);
};

export default RouteLayout;
33 changes: 2 additions & 31 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
import MenuButton from "@/components/MenuButton";
import "./globals.css";
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import Link from "next/link";
import { ToggleProvider } from "@/contextProviders/ToggleProvider";
import Sidebar from "@/components/Sidebar";
import MainContent from "@/components/MainContent";
import NavButtonGroup from "@/components/NavButtonGroup";
import NextAuthProvider from "@/contextProviders/sessionProvider";
import { Toaster } from "react-hot-toast";
import { Providers } from "@/store/provider";
import { Suspense } from "react";

const inter = Inter({ subsets: ["latin"] });

Expand All @@ -21,42 +14,20 @@ export const metadata: Metadata = {

interface Props {
children: React.ReactNode;
auth: React.ReactNode;
}

const RootLayout = async ({ children, auth }: Props) => {
const RootLayout = async ({ children }: Props) => {
const className = inter.className;

return (
<html lang="en">
<body className={className}>
<ToggleProvider>
<div className="flex flex-col h-screen">
{/* <nav className="shadow-xl bg-gray-900">
<div className="max-w-7xl mx-auto px-2 sm:px-4 flex justify-between items-center h-[8vh]">
<div className="flex-shrink-0 flex items-center">
<Link href="/" className="text-white font-bold text-2xl">
<div className="hidden sm:block mx-2">TPC</div>
</Link>
</div>
<NavButtonGroup />
</div>
</nav> */}
{/* Page Content */}
<Toaster />

<NextAuthProvider>
<div className="flex-auto flex h-[92vh] ">
{/* sidebar and main content share this space */}
<Suspense fallback={<>Loading...</>}>
<Sidebar />
</Suspense>
<MainContent>
<Providers>{children}</Providers>
</MainContent>
</div>
{auth}
</NextAuthProvider>
<NextAuthProvider>{children}</NextAuthProvider>
</div>
</ToggleProvider>
</body>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Calendar/context/ContextWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { selectedDayEvent } from "./GlobalContext";
import { fetchEvents } from "@/helpers/api";
import toast from "react-hot-toast";
import Cookies from "js-cookie";
import jwt from "jsonwebtoken";
import { jwtDecode } from "jwt-decode";
import { fetchStudentEvents } from "@/helpers/student/api";

export const labelsClasses = new Map([
Expand Down Expand Up @@ -65,7 +65,7 @@ export default function ContextWrapper(props: any) {

if (accessToken) {
try {
const decoded = jwt.decode(accessToken);
const decoded: any = jwtDecode(accessToken);
user = decoded ? { role: decoded.role } : null;
} catch (error) {
console.error("JWT decoding error:", error);
Expand Down
Loading

0 comments on commit cec0cdb

Please sign in to comment.