Skip to content

Commit

Permalink
removed login workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
anuragnegi000 committed Sep 1, 2024
2 parents 8d55bc5 + 667d678 commit ec0e4e2
Show file tree
Hide file tree
Showing 20 changed files with 338 additions and 301 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ next-env.d.ts
pnpm-lock.yaml
bun.lockb
package-lock.json
yarn.lock
yarn.lock

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,25 @@
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-switch": "^1.1.0",
"@radix-ui/react-toast": "^1.2.1",
"@types/lodash": "^4.17.7",
"@uidotdev/usehooks": "^2.4.1",
"bcryptjs": "^2.4.3",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"dayjs": "^1.11.13",
"lodash": "^4.17.21",
"lucide-react": "^0.426.0",
"next": "14.2.5",
"next-auth": "^4.24.7",
"next-themes": "^0.3.0",
"nextjs-toploader": "^1.6.12",
"react": "^18",
"react-dom": "^18",
"react-hook-form": "^7.52.2",
"react-icons": "^5.2.1",
"tailwind-merge": "^2.4.0",
"tailwindcss-animate": "^1.0.7",
"vaul": "^0.9.1",
"zod": "^3.23.8",
"zod-error": "^1.5.0"
},
Expand Down
18 changes: 0 additions & 18 deletions src/actions/job.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
import { getJobFilters } from '@/services/jobs.services';
import { ServerActionReturnType } from '@/types/api.types';
import { getAllJobsAdditonalType, getJobType } from '@/types/jobs.types';
import { redirect } from 'next/navigation';

type additional = {
isVerifiedJob: boolean;
Expand Down Expand Up @@ -127,20 +126,3 @@ export const getJobById = withServerActionAsyncCatcher<
job,
}).serialize();
});

export const jobFilterQuery = async (
queries: JobQuerySchemaType,
baseUrl: string
) => {
const { page, sortby, location, salaryrange, search, workmode } =
JobQuerySchema.parse(queries);
const searchParams = new URLSearchParams({
page: page.toString(),
sortby,
...(search && { search: search.trim() }),
});
location?.map((location) => searchParams.append('location', location));
salaryrange?.map((range) => searchParams.append('salaryrange', range));
workmode?.map((mode) => searchParams.append('workmode', mode));
redirect(`${baseUrl}?${searchParams.toString()}`);
};
27 changes: 14 additions & 13 deletions src/app/jobs/page.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
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 {
JobQuerySchema,
JobQuerySchemaType,
} from '@/lib/validators/jobs.validator';
import { redirect } from 'next/navigation';
import { Suspense } from 'react';

const page = async ({ searchParams }: { searchParams: JobQuerySchemaType }) => {
const validatedSearchParams = JobQuerySchema.parse(searchParams);

const parsedData = JobQuerySchema.safeParse(searchParams);
if (!(parsedData.success && parsedData.data)) {
console.error(parsedData.error);
redirect('/jobs');
}
const parsedSearchParams = parsedData.data;
return (
<div className="container flex gap-5 pt-5">
<JobFilters
searchParams={validatedSearchParams}
baseUrl={APP_PATHS.JOBS}
/>
<div className="container flex gap-5 pt-5 mt-10">
<div className="hidden sm:block border h-fit rounded-lg w-[310px] ">
<JobFilters searchParams={parsedSearchParams} />
</div>
<div className="grow">
<JobsHeader
searchParams={validatedSearchParams}
baseUrl={APP_PATHS.JOBS}
/>
<JobsHeader searchParams={parsedSearchParams} />
<Suspense
key={JSON.stringify(parsedSearchParams)}
fallback={
<div className="flex justify-center items-center h-full gap-5 ">
<Loader />
</div>
}
>
<AllJobs searchParams={validatedSearchParams} />
<AllJobs searchParams={parsedSearchParams} />
</Suspense>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Providers from '@/providers/providers';
import type { Metadata } from 'next';
import { Inter as FontSans } from 'next/font/google';
import './globals.css';
import TopLoader from '@/components/Toploader';

const fontSans = FontSans({
subsets: ['latin'],
Expand All @@ -29,6 +30,7 @@ export default async function RootLayout({
fontSans.variable
)}
>
<TopLoader />
<Providers>
<Header />
<main className="grow grid">{children}</main>
Expand Down
6 changes: 3 additions & 3 deletions src/components/HalfCircleGradient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ export default function HalfCircleGradient({ position }: { position: string }) {
return (
<div
className={cn(
'absolute left-1/2 transform -translate-x-1/2 w-[90%] blur-[130px] bg-no-repeat -z-10',
'absolute left-1/2 transform -translate-x-1/2 w-[100%] sm:w-[90%] blur-[130px] bg-no-repeat -z-10',
{
'-top-28 bg-gradient-to-b from-[#2563EB]/40 to-[#3672E3]/20 rounded-b-full h-[500px]':
'-top-52 sm:-top-32 bg-gradient-to-b from-[#2563EB]/40 to-[#3672E3]/20 rounded-b-full h-[420px]':
position === 'top',
'bottom-3 bg-gradient-to-t from-[#2563EB]/40 to-[#3672E3]/20 rounded-t-full h-[700px] overflow-hidden':
'sm:bottom-0 bg-gradient-to-t from-[#2563EB]/40 to-[#3672E3]/20 rounded-t-full h-[500px] overflow-hidden':
position === 'bottom',
}
)}
Expand Down
19 changes: 19 additions & 0 deletions src/components/Toploader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import NextTopLoader from 'nextjs-toploader';

export default function TopLoader() {
return (
<>
<NextTopLoader
color="#2299DD"
initialPosition={0.08}
crawlSpeed={200}
height={3}
crawl={true}
showSpinner={true}
easing="ease"
speed={200}
shadow="0 0 10px $2299DD, 0 0 5px #2299DD"
/>
</>
);
}
4 changes: 2 additions & 2 deletions src/components/all-jobs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ const AllJobs = async ({ searchParams }: PaginatorProps) => {
DEFAULT_PAGE;
const currentPage = parseInt(searchParams.page?.toString()) || DEFAULT_PAGE;
return (
<div className="bg-background py-4 grid gap-3">
<div className="bg-background py-4 grid gap-3 w-full">
{jobs.additional?.jobs.map((job) => {
return (
<Link key={job.id} href={`/jobs/${job.id}`}>
<div
className="w-full flex flex-col items-start gap-4 rounded-lg border p-3 text-left text-sm transition-all hover:bg-accent"
className="w-[94%] mx-auto flex flex-col items-start gap-4 rounded-lg border p-3 text-left text-sm transition-all hover:bg-accent"
key={job.id}
>
<div className="flex w-full flex-col gap-2">
Expand Down
6 changes: 3 additions & 3 deletions src/components/hero-section.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { GITHUB_REPO } from '@/lib/constant/app.constant';
import Link from 'next/link';
import Icon from './ui/icon';
import { MarqueeDemo } from './infinitescroll';
import { LogoMarquee } from './infinitescroll';

const HeroSection = () => {
return (
<>
<section className="relative max-sm:pt-10 container">
<section className="relative sm:py-10 container">
<div className="flex flex-col gap-4 items-center justify-center py-8 md:py-12 md:pb-8 lg:py-12 lg:pb-10">
<Link
href={GITHUB_REPO}
Expand Down Expand Up @@ -35,7 +35,7 @@ const HeroSection = () => {
</div>
</div>
</div>
<MarqueeDemo />
<LogoMarquee />
</section>
</>
);
Expand Down
131 changes: 24 additions & 107 deletions src/components/infinitescroll.tsx
Original file line number Diff line number Diff line change
@@ -1,115 +1,32 @@
import React from 'react';
import Marquee from './ui/Marquee';
import Image from 'next/image';
// import Marquee from "@/components/magicui/marquee";

const reviews = [
{
name: 'Jack',
username: '@jack',
body: "I've never seen anything like this before. It's amazing. I love it.",
img: 'https://avatar.vercel.sh/jack',
},
{
name: 'Jill',
username: '@jill',
body: "I don't know what to say. I'm speechless. This is amazing.",
img: 'https://avatar.vercel.sh/jill',
},
{
name: 'John',
username: '@john',
body: "I'm at a loss for words. This is amazing. I love it.",
img: 'https://avatar.vercel.sh/john',
},
{
name: 'Jane',
username: '@jane',
body: "I'm at a loss for words. This is amazing. I love it.",
img: 'https://avatar.vercel.sh/jane',
},
{
name: 'Jenny',
username: '@jenny',
body: "I'm at a loss for words. This is amazing. I love it.",
img: 'https://avatar.vercel.sh/jenny',
},
{
name: 'James',
username: '@james',
body: "I'm at a loss for words. This is amazing. I love it.",
img: 'https://avatar.vercel.sh/james',
},
];
import Marquee from './ui/Marquee';

const imageList = [
{
id: 1,
src: './microsoft.svg',
},
{
id: 2,
src: './solana.svg',
},
{
id: 3,
src: './google.svg',
},
const logos = [
{ src: '/microsoft.svg', alt: 'Microsoft', width: 190, height: 50 },
{ src: '/google.svg', alt: 'Google', width: 140, height: 25 },
{ src: '/solana.svg', alt: 'Solana', width: 180, height: 50 },
// Add more logos here
];

const firstRow = reviews.slice(0, reviews.length / 2);

const ReviewCard = ({}) => {
export function LogoMarquee() {
return (
<div className="flex flex-row items-center justify-evenly overflow-hidden md:shadow-xl">
{imageList.concat(imageList).map((item, index) => {
return (
<Image
className="ml-10"
src={item.src}
alt="companies"
width={200}
height={100}
key={index}
/>
);
})}
</div>
);
};

export function MarqueeDemo() {
return (
<div className="w-screen relative flex flex-row h-[200px] w-full flex-col items-center justify-center overflow-hidden md:w-full">
<Marquee pauseOnHover className="[--duration:50s]">
{firstRow.map((review) => (
<ReviewCard key={review.username} {...review} />
))}
</Marquee>

{/* <div className="pointer-events-none absolute inset-y-0 left-0 w-1/3 bg-gradient-to-r from-white dark:from-background"></div>
<div className="pointer-events-none absolute inset-y-0 right-0 w-1/3 bg-gradient-to-l from-white dark:from-background"></div> */}
<div className="relative flex items-center justify-center ">
<div className="mt-14 sm:mt-24 mb-10 relative flex mx-auto w-[80vw] sm:w-[75vw] items-center justify-center overflow-hidden ">
<Marquee className="[--duration:20s]">
{logos.map((logo) => (
<div key={logo.alt} className="px-4 flex items-center">
<Image
src={logo.src}
alt={logo.alt}
width={logo.width}
height={logo.height}
/>
</div>
))}
</Marquee>
<div className="pointer-events-none absolute inset-y-0 left-0 w-1/3 bg-gradient-to-r dark:from-neutral-950"></div>
<div className="pointer-events-none absolute inset-y-0 right-0 w-1/3 bg-gradient-to-l dark:from-neutral-950"></div>
</div>
</div>
);
}

// <figure
// className={cn(
// 'relative w-64 cursor-pointer overflow-hidden rounded-xl border p-4',
// // light styles
// 'border-gray-950/[.1] bg-gray-950/[.01] hover:bg-gray-950/[.05]',
// // dark styles
// 'dark:border-gray-50/[.1] dark:bg-gray-50/[.10] dark:hover:bg-gray-50/[.15]'
// )}
// >
// {imageList.concat(imageList).map((item, index) => (
// <Image
// className="ml-10"
// src={item.src}
// alt="companies"
// width={200}
// height={100}
// key={index}
// />
// ))}
// </figure>
Loading

0 comments on commit ec0e4e2

Please sign in to comment.