Skip to content

Commit

Permalink
Merge pull request #13 from Pradeep-Kumar-Rebbavarapu/main
Browse files Browse the repository at this point in the history
Company Cards , Each Company Section Completed
  • Loading branch information
harshtalati2410 authored Jan 4, 2024
2 parents df25ce8 + 57468db commit 9432908
Show file tree
Hide file tree
Showing 88 changed files with 6,526 additions and 774 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts
.env
17 changes: 17 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "src/app/globals.css",
"baseColor": "gray",
"cssVariables": false,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
}
2,942 changes: 2,437 additions & 505 deletions package-lock.json

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,48 @@
"lint": "next lint"
},
"dependencies": {
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-toast": "^1.1.5",
"@reduxjs/toolkit": "^2.0.1",
"@tanstack/react-table": "^8.11.2",
"axios": "^1.6.3",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"cmdk": "^0.2.0",
"csv-parser": "^3.0.0",
"framer-motion": "^10.16.4",
"js-cookie": "^3.0.5",
"jwt-decode": "^4.0.0",
"lucide-react": "^0.302.0",
"next": "latest",
"next-auth": "^4.23.2",
"papaparse": "^5.4.1",
"pdf-lib": "^1.17.1",
"react": "latest",
"react-dom": "latest",
"react-google-button": "^0.7.2",
"react-hot-toast": "^2.4.1",
"react-modal": "^3.16.1",
"react-redux": "^9.0.4",
"react-table": "^7.8.0",
"tailwind-merge": "^2.2.0",
"tailwindcss-animate": "^1.0.7",
"xlsx": "^0.18.5"
},
"devDependencies": {
"@types/js-cookie": "^3.0.6",
"@types/node": "latest",
"@types/papaparse": "^5.3.10",
"@types/react": "latest",
"@types/react-dom": "latest",
"@types/react-modal": "^3.16.3",
"autoprefixer": "latest",
"eslint": "latest",
"eslint-config-next": "latest",
Expand Down
15 changes: 15 additions & 0 deletions src/app/(routes)/admin/[adminId]/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use client';

import React, { Component } from 'react';

class Error extends Component {
render() {
return (
<div className="h-screen flex justify-center items-center text-center font-bold text-2xl">
Something went wrong!
</div>
);
}
}

export default Error;
12 changes: 12 additions & 0 deletions src/app/(routes)/admin/[adminId]/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
interface Props {
children: React.ReactNode;
}

const EachAdminLayout = ({ children }: Props) => {
return (<div>

{children}
</div>);
};

export default EachAdminLayout;
15 changes: 15 additions & 0 deletions src/app/(routes)/admin/[adminId]/loading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use client';

import React, { Component } from 'react';

class Loading extends Component {
render() {
return (
<div className="h-screen w-full text-center flex justify-center items-center font-bold">
Loading...
</div>
);
}
}

export default Loading;
71 changes: 65 additions & 6 deletions src/app/(routes)/admin/[adminId]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,81 @@
// //this is the page.tsx file that contains the page component for the admin/[adminId] route
"use client";
import { useRouter } from "next/router";
import {AllAdmins} from '../../../../dummyData/admin'
interface Props { }

interface Props {}

const AdminPage = ({
const AdminPage = async ({
params,
}: {
params: {
adminId: String;
};
}) => {
const EachAdminData = await fetchEachAdmin(params.adminId)


return (
<div>
<h1>Admin Page</h1>
<p>Static Admin ID: {params.adminId}</p>
<section className="text-gray-600 body-font">
<div className="container px-5 py-24 mx-auto">
<div className="text-center mb-20">
<h1 className="sm:text-3xl text-2xl font-medium text-center title-font text-gray-900 mb-4">{EachAdminData?.name}</h1>
</div>
<div className="flex flex-wrap lg:w-4/5 sm:mx-auto sm:mb-2 -mx-2">

<div className="p-2 sm:w-1/2 w-full">
<div className="bg-gray-800 rounded flex p-4 h-full items-center">
<svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3" className="text-white w-6 h-6 flex-shrink-0 mr-4" viewBox="0 0 24 24">
<path d="M22 11.08V12a10 10 0 11-5.93-9.14"></path>
<path d="M22 4L12 14.01l-3-3"></path>
</svg>
<span className="title-font text-white font-medium">{EachAdminData?.id}</span>
</div>
</div>

<div className="p-2 sm:w-1/2 w-full">
<div className="bg-gray-800 rounded flex p-4 h-full items-center">
<svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3" className="text-white w-6 h-6 flex-shrink-0 mr-4" viewBox="0 0 24 24">
<path d="M22 11.08V12a10 10 0 11-5.93-9.14"></path>
<path d="M22 4L12 14.01l-3-3"></path>
</svg>
<span className="title-font text-white font-medium">{EachAdminData?.email}</span>
</div>
</div>

<div className="p-2 sm:w-1/2 w-full">
<div className="bg-gray-800 rounded flex p-4 h-full items-center">
<svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3" className="text-white w-6 h-6 flex-shrink-0 mr-4" viewBox="0 0 24 24">
<path d="M22 11.08V12a10 10 0 11-5.93-9.14"></path>
<path d="M22 4L12 14.01l-3-3"></path>
</svg>
<span className="title-font text-white font-medium">{EachAdminData?.role}</span>
</div>
</div>

<div className="p-2 sm:w-1/2 w-full">
<div className="bg-gray-800 rounded flex p-4 h-full items-center">
<svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3" className="text-white w-6 h-6 flex-shrink-0 mr-4" viewBox="0 0 24 24">
<path d="M22 11.08V12a10 10 0 11-5.93-9.14"></path>
<path d="M22 4L12 14.01l-3-3"></path>
</svg>
<span className="title-font text-white font-medium">{EachAdminData?.contact}</span>
</div>
</div>

</div>

</div>
</section>
</div>
);
};

export default AdminPage;


const fetchEachAdmin = async (id: String) => {
// const res = await fetch('');
// const json = await res.json();
// return json
return AllAdmins.find((x)=>x.id == id)
}
15 changes: 15 additions & 0 deletions src/app/(routes)/admin/company/[companyId]/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use client';

import React, { Component } from 'react';

class Error extends Component {
render() {
return (
<div className="h-screen flex justify-center items-center text-center font-bold text-2xl">
Something went wrong!
</div>
);
}
}

export default Error;
13 changes: 13 additions & 0 deletions src/app/(routes)/admin/company/[companyId]/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
interface Props {
children: React.ReactNode;
}

const EachCompanyLayout = ({ children }: Props) => {
return (<div className="">

{children}
</div>);
};

export default EachCompanyLayout;

15 changes: 15 additions & 0 deletions src/app/(routes)/admin/company/[companyId]/loading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use client';

import React, { Component } from 'react';

class Loading extends Component {
render() {
return (
<div className="h-screen w-full text-center flex justify-center items-center font-bold">
Loading...
</div>
);
}
}

export default Loading;
72 changes: 72 additions & 0 deletions src/app/(routes)/admin/company/[companyId]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import JAFCard from "@/components/company/JAFCard";
import EachCompanyCard from "@/components/company/EachCompanyCard"
import { AllCompanies } from "@/dummyData/company"
import { fetchEachCompanyDetails } from "@/helpers/api";
import { cookies } from "next/headers";
interface Props {
params: {
companyId: String
}
}

interface CompanyData {
name: String;
id: String;
jafs: any;
ppoOffers: any;
recruiters: any;
}


export default async function EachCompanyPage({ params }: Props) {
const EachCompany = await fetchEachCompanyDetails(cookies().get('accessToken')?.value,params.companyId)
return (
<div>
<section className="text-gray-600 body-font">
<div className="container px-5 py-24 mx-auto">
<div className="flex flex-col text-center w-full mb-20">
<h2 className="text-xs text-indigo-500 tracking-widest font-medium title-font mb-1">12 Dec 2023</h2>
<h1 className="sm:text-4xl text-3xl font-bold title-font mb-4 text-gray-900">{EachCompany?.name}</h1>
</div>

{EachCompany?.jafs?.length === 0 ? (
<h1 className="sm:text-xl font-medium title-font mb-4 text-gray-900 text-center">No Jobs Listed Currently</h1>
) : (
<div className="flex flex-wrap">
<JAFCard />
</div>
)}

{EachCompany?.ppoOffers?.length === 0 ? (
<h1 className="sm:text-xl font-medium title-font mb-4 text-gray-900 text-center">No PPO Offers Currently</h1>
) : (
<div className="flex flex-wrap">
<JAFCard />
</div>
)}

{EachCompany?.recruiters?.length === 0 ? (
<h1 className="sm:text-xl font-medium title-font mb-4 text-gray-900 text-center">No Recruiters Currently</h1>
) : (
<div className="flex flex-wrap">
<JAFCard />
</div>
)}
<section className="text-gray-600 body-font">
<h1 className="text-center mt-10 mb-2">Sample Cards for Jobs , PPOs and Recruiters in company section</h1>
<div className="container px-5 mx-auto">
<div className="flex flex-wrap">
<JAFCard />
<JAFCard />
<JAFCard />
<JAFCard />
</div>
</div>
</section>
</div>
</section>
</div>
)
}


15 changes: 15 additions & 0 deletions src/app/(routes)/admin/company/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use client';

import React, { Component } from 'react';

class Error extends Component {
render() {
return (
<div className="h-screen flex justify-center items-center text-center font-bold text-2xl">
Something went wrong!
</div>
);
}
}

export default Error;
12 changes: 12 additions & 0 deletions src/app/(routes)/admin/company/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
interface Props {
children: React.ReactNode;
}

const CompanyLayout = ({ children }: Props) => {
return (<div>

{children}
</div>);
};

export default CompanyLayout;
15 changes: 15 additions & 0 deletions src/app/(routes)/admin/company/loading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use client';

import React, { Component } from 'react';

class Loading extends Component {
render() {
return (
<div className="h-screen w-full text-center flex justify-center items-center font-bold">
Loading...
</div>
);
}
}

export default Loading;
Loading

1 comment on commit 9432908

@vercel
Copy link

@vercel vercel bot commented on 9432908 Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.