Skip to content

Commit

Permalink
company registration sub-project
Browse files Browse the repository at this point in the history
  • Loading branch information
puneetkumarbajaj committed Feb 18, 2024
1 parent b7fdc76 commit 716e9b8
Show file tree
Hide file tree
Showing 21 changed files with 1,393 additions and 62 deletions.
2 changes: 1 addition & 1 deletion app/login/recruiter_login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const RecruiterLoginPage: React.FC = () => {
};

const handleSignupClick = () => {
router.push('/student/signup');
router.push('/recruiter/registeration');
};

const handleUsernameChange = (event: React.ChangeEvent<HTMLInputElement>) => {
Expand Down
82 changes: 82 additions & 0 deletions app/recruiter/registeration/additional/additional-form.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
"use client";
import React, { useState } from 'react';
import Link from 'next/link';
import {useFieldArray, useForm} from 'react-hook-form';
import {zodResolver} from '@hookform/resolvers/zod';
import {z} from 'zod';
import { toast } from '@/components/ui/use-toast';
import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from '@/components/ui/form';
import { Input } from '@/components/ui/input';
import { cn } from '@/lib/utils';
import { Button } from '@/components/ui/button';
import { useRouter } from 'next/navigation';

const AdditionalFormSchema = z.object({
purpose: z
.string()
.optional()
,
hearAboutUs: z
.string()
.optional()
,
});

type AdditionalFormValues = z.infer<typeof AdditionalFormSchema>;

function AdditionalForm() {

const route = useRouter();

const form = useForm<AdditionalFormValues>({
resolver: zodResolver(AdditionalFormSchema),
mode: 'onChange',
});

function onSubmit() {
route.push('/recruiter/registeration/contact');
}

return (
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)} className='space-y-8'>
<FormField
control={form.control}
name = 'purpose'
render={({ field }) => (
<FormItem>
<FormLabel>What is your purpose of joining this platform</FormLabel>
<FormControl>
<Input placeholder='We want to make hiring process easier' {...field} />
</FormControl>
<FormDescription>
This is the purpose of your company joining this platform
</FormDescription>
<FormMessage/>
</FormItem>
)}
/>

<FormField
control={form.control}
name = 'hearAboutUs'
render={({ field }) => (
<FormItem>
<FormLabel>How did you hear about Us</FormLabel>
<FormControl>
<Input placeholder='Word of mouth in the market' {...field} />
</FormControl>
<FormDescription>
This is how you heard about us
</FormDescription>
<FormMessage/>
</FormItem>
)}
/>
<Button type="submit">Submit</Button>
</form>
</Form>
);
};

export default AdditionalForm;
17 changes: 17 additions & 0 deletions app/recruiter/registeration/additional/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Separator } from "@/components/ui/separator"
import AdditionalForm from "./additional-form"

export default function AdditionalFormPage() {
return (
<div className="space-y-6">
<div>
<h3 className="text-lg font-medium">Additional Information</h3>
<p className="text-sm text-muted-foreground">
Enter Necessary Additional Information
</p>
</div>
<Separator />
<AdditionalForm />
</div>
)
}
59 changes: 0 additions & 59 deletions app/recruiter/registeration/company_registration.tsx

This file was deleted.

44 changes: 44 additions & 0 deletions app/recruiter/registeration/components/sidebar-nav.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
"use client"

import Link from "next/link"
import { usePathname } from "next/navigation"

import { cn } from "@/lib/utils"
import { buttonVariants } from "@/components/ui/button"

interface SidebarNavProps extends React.HTMLAttributes<HTMLElement> {
items: {
href: string
title: string
}[]
}

export function SidebarNav({ className, items, ...props }: SidebarNavProps) {
const pathname = usePathname()

return (
<nav
className={cn(
"flex space-x-2 lg:flex-col lg:space-x-0 lg:space-y-1",
className
)}
{...props}
>
{items.map((item) => (
<Link
key={item.href}
href={item.href}
className={cn(
buttonVariants({ variant: "ghost" }),
pathname === item.href
? "bg-muted hover:bg-muted"
: "hover:bg-transparent hover:underline",
"justify-start"
)}
>
{item.title}
</Link>
))}
</nav>
)
}
105 changes: 105 additions & 0 deletions app/recruiter/registeration/contact/contact-form.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
"use client";
import React, { useState } from 'react';
import Link from 'next/link';
import {useFieldArray, useForm} from 'react-hook-form';
import {zodResolver} from '@hookform/resolvers/zod';
import {z} from 'zod';
import { toast } from '@/components/ui/use-toast';
import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from '@/components/ui/form';
import { Input } from '@/components/ui/input';
import { cn } from '@/lib/utils';
import { Button } from '@/components/ui/button';
import { useRouter } from 'next/navigation';

const contactFormSchema = z.object({
officialEmailAddress: z
.string({
required_error: 'Official email is required',
})
.email()
,
phoneNumber: z
.string({
required_error: 'Phone number is required',
})
,
hqAddress: z
.string({
required_error: 'Official Address is required',
}),
});

type ContactFormValues = z.infer<typeof contactFormSchema>;

function ContactForm() {

const route = useRouter();

const form = useForm<ContactFormValues>({
resolver: zodResolver(contactFormSchema),
mode: 'onChange',
});

function onSubmit() {
route.push('/recruiter/registeration/contact');
}

return (
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)} className='space-y-8'>
<FormField
control={form.control}
name = 'officialEmailAddress'
render={({ field }) => (
<FormItem>
<FormLabel>Official Email Address to HR Department</FormLabel>
<FormControl>
<Input placeholder='[email protected]' {...field} />
</FormControl>
<FormDescription>
This is the official email address to reach the HR department of your company
</FormDescription>
<FormMessage/>
</FormItem>
)}
/>

<FormField
control={form.control}
name = 'phoneNumber'
render={({ field }) => (
<FormItem>
<FormLabel>A Phone number to reach if additional verification is needed</FormLabel>
<FormControl>
<Input placeholder='(123)-456-7890' {...field} />
</FormControl>
<FormDescription>
This is the phone number to reach if additional verification is needed
</FormDescription>
<FormMessage/>
</FormItem>
)}
/>
<FormField
control={form.control}
name = 'hqAddress'
render={({ field }) => (
<FormItem>
<FormLabel>Official Address of the company headquarters</FormLabel>
<FormControl>
<Input placeholder='9993 Hodkiewicz Ranch Suite 735' {...field} />
</FormControl>
<FormDescription>
This is the official address of the company headquarters
</FormDescription>
<FormMessage/>
</FormItem>
)}
/>
<Button type="submit">Next</Button>
</form>
</Form>
);
};

export default ContactForm;
17 changes: 17 additions & 0 deletions app/recruiter/registeration/contact/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Separator } from "@/components/ui/separator"
import ContactForm from "./contact-form"

export default function ContactFormPage() {
return (
<div className="space-y-6">
<div>
<h3 className="text-lg font-medium">Contact Information</h3>
<p className="text-sm text-muted-foreground">
Enter Necessary Contact Information
</p>
</div>
<Separator />
<ContactForm />
</div>
)
}
14 changes: 14 additions & 0 deletions app/recruiter/registeration/hangtight/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Separator } from "@/components/ui/separator"

export default function AdditionalFormPage() {
return (
<div className="space-y-6">
<div>
<h3 className="text-lg font-medium">Thank you for your application!</h3>
<p className="text-sm text-muted-foreground">
Hang tight while our team reviews your application and you will be notified of the next steps.
</p>
</div>
</div>
)
}
Loading

0 comments on commit 716e9b8

Please sign in to comment.