Skip to content

Commit

Permalink
Merge branch 'main' into feature/pagination-error
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekkumaroriginal authored Aug 26, 2024
2 parents 92dae40 + 3d2da33 commit 594b02f
Show file tree
Hide file tree
Showing 25 changed files with 743 additions and 240 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.1",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-popover": "^1.1.1",
"@radix-ui/react-radio-group": "^1.2.0",
"@radix-ui/react-scroll-area": "^1.1.0",
"@radix-ui/react-select": "^2.1.1",
Expand All @@ -35,6 +36,7 @@
"bcryptjs": "^2.4.3",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"dayjs": "^1.11.13",
"lucide-react": "^0.426.0",
"next": "14.2.5",
"next-auth": "^4.24.7",
Expand Down
5 changes: 3 additions & 2 deletions prisma/seed.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import { Currency, Role, WorkMode } from '@prisma/client';
import bcrypt from 'bcryptjs';
import prisma from '../src/config/prisma.config';
Expand Down Expand Up @@ -437,7 +438,7 @@ const jobs = [
async function seedUsers() {
try {
const hashedPassword = await bcrypt.hash('123456', 10);
const dbUsers = await Promise.all(
await Promise.all(
users.map(
async (u) =>
await prisma.user.upsert({
Expand All @@ -464,7 +465,7 @@ async function seedUsers() {

async function seedJobs() {
try {
const dbJobs = await Promise.all(
await Promise.all(
jobs.map(async (j) =>
prisma.job.upsert({
where: { id: j.id },
Expand Down
Binary file added public/companies.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions src/actions/job.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ export const getJobById = withServerActionAsyncCatcher<
}).serialize();
});

export const jobFilterQuery = async (queries: JobQuerySchemaType) => {
export const jobFilterQuery = async (
queries: JobQuerySchemaType,
baseUrl: string
) => {
const { page, sortby, location, salaryrange, search, workmode } =
JobQuerySchema.parse(queries);
const searchParams = new URLSearchParams({
Expand All @@ -144,5 +147,5 @@ export const jobFilterQuery = async (queries: JobQuerySchemaType) => {
location?.map((location) => searchParams.append('location', location));
salaryrange?.map((range) => searchParams.append('salaryrange', range));
workmode?.map((mode) => searchParams.append('workmode', mode));
redirect(`/jobs?${searchParams.toString()}`);
redirect(`${baseUrl}?${searchParams.toString()}`);
};
14 changes: 8 additions & 6 deletions src/app/(auth)/signin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import { FormContainer } from '@/layouts/form-container';

const LoginPage = () => {
return (
<FormContainer
heading={'Welcome back'}
description={'Please enter your details to sign in.'}
>
<Signin />
</FormContainer>
<div className="h-screen flex flex-col justify-center items-center">
<FormContainer
heading={'Welcome back'}
description={'Please enter your details to sign in.'}
>
<Signin />
</FormContainer>
</div>
);
};

Expand Down
40 changes: 40 additions & 0 deletions src/app/[...404]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from 'react';
import Link from 'next/link';
import { Poppins } from 'next/font/google';

//applying font from google
const fontOptions = Poppins({
subsets: ['latin'],
variable: '--font-poppins',
weight: ['400', '700'],
});

const Custom404Page = () => {
return (
<>
<div
className={`min-h-screen flex flex-col justify-center items-center px-2 py-2 lg:px-2 bg-white dark:bg-black ${fontOptions.className}`}
>
<h1 className="text-3xl font-bold tracking-tight text-center text-gray-900 dark:text-white sm:text-7xl mb-4">
Oops!
</h1>
<p className="text-red-800 dark:text-orange-400 font-bold text-4x mb-2 text-center">
We couldn’t find the page you’re looking for. <br />
404 - PAGE NOT FOUND
</p>
<p className="text-base text-gray-600 dark:text-gray-00 mb-8 text-center">
The page you are looking for was moved, removed, renamed, or might
never have existed.
</p>
<Link
href="/"
className="inline-flex items-center px-4 py-2 text-sm font-semibold text-white bg-black dark:bg-white dark:text-black rounded-full hover:bg-gray-800 dark:hover:bg-gray-200 transition-colors duration-200"
>
Visit the homepage
</Link>
</div>
</>
);
};

export default Custom404Page;
5 changes: 3 additions & 2 deletions src/app/jobs/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import AllJobs from '@/components/all-jobs';
import Loader from '@/components/loader';
import APP_PATHS from '@/config/path.config';
import JobFilters from '@/layouts/job-filters';
import JobsHeader from '@/layouts/jobs-header';
import {
Expand All @@ -13,9 +14,9 @@ const page = async ({ searchParams }: { searchParams: JobQuerySchemaType }) => {

return (
<div className="container flex gap-5 pt-5">
<JobFilters searchParams={validatedSearchParams} />
<JobFilters searchParams={validatedSearchParams} baseUrl={APP_PATHS.JOBS} />
<div className="grow">
<JobsHeader searchParams={validatedSearchParams} />
<JobsHeader searchParams={validatedSearchParams} baseUrl={APP_PATHS.JOBS} />
<Suspense
fallback={
<div className="flex justify-center items-center h-full gap-5 ">
Expand Down
20 changes: 16 additions & 4 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
import BackgroundSvg from '@/components/BackgroundSvg';
import HalfCircleGradient from '@/components/HalfCircleGradient';
import HeroSection from '@/components/hero-section';
import { JobLanding } from '@/components/job-landing';
import { JobQuerySchemaType } from '@/lib/validators/jobs.validator';

const HomePage = async () => {
const HomePage = async ({
searchParams,
}: {
searchParams: JobQuerySchemaType;
}) => {
return (
<>
<div>
<BackgroundSvg />
<div className="w-full">
<HalfCircleGradient position="top" />
<div className="w-full mt-14">
<HeroSection />
</div>
</>
<div>
<JobLanding searchParams={searchParams} />
</div>
<HalfCircleGradient position="bottom" />
</div>
);
};

Expand Down
Loading

0 comments on commit 594b02f

Please sign in to comment.