From 54aa02462ed12db7abd00f5f92288e3de030b08f Mon Sep 17 00:00:00 2001 From: Mahrukh Raheel Date: Thu, 27 Feb 2025 10:52:35 +0500 Subject: [PATCH] changed Job Desc & Apply Form pages design --- jobboard-sanity/schemaTypes/job.js | 8 +++++ src/pages/Apply.jsx | 48 +++++++++++++++++++++--------- src/pages/JobDetails.jsx | 33 ++++++++++++-------- 3 files changed, 62 insertions(+), 27 deletions(-) diff --git a/jobboard-sanity/schemaTypes/job.js b/jobboard-sanity/schemaTypes/job.js index c535bd5..a901ee9 100644 --- a/jobboard-sanity/schemaTypes/job.js +++ b/jobboard-sanity/schemaTypes/job.js @@ -17,6 +17,14 @@ export default { maxLength: 96, }, }, + { + name: "postedDate", + title: "Date Posted", + type: "date", + options: { + dateFormat: "YYYY-MM-DD", + }, + }, { name: 'summary', title: 'Summary', diff --git a/src/pages/Apply.jsx b/src/pages/Apply.jsx index 211c45a..3a7ecea 100644 --- a/src/pages/Apply.jsx +++ b/src/pages/Apply.jsx @@ -1,5 +1,5 @@ -import { useParams } from "react-router-dom"; -import { useState } from "react"; +import { useParams, Link } from "react-router-dom"; +import { useState, useEffect } from "react"; import PhoneInput from "react-phone-input-2"; import "react-phone-input-2/lib/style.css"; import { createClient } from '@supabase/supabase-js' @@ -22,6 +22,12 @@ const Apply = () => { resume: null, }); + const [jobTitle, setJobTitle] = useState(""); + + useEffect(() => { + setJobTitle(slug.replace(/-/g, " ")); + }, [slug]); + const requirePermitExpiry = ["Work Permit", "Study Permit"].includes(formData.immigrationStatus); const handleChange = (e) => { @@ -80,8 +86,21 @@ const Apply = () => { }; return ( -
-

Apply for {slug.replace(/-/g, " ")}

+
+
+
+

Apply For

+ + 💼 {jobTitle.charAt(0).toUpperCase() + jobTitle.slice(1)} + +
+
+ + {/* Application Form */} +
{ placeholder="Enter Full Name" required onChange={handleChange} - className="w-full p-2 border rounded-md" + className="w-full p-2 border border-gray-400 rounded-md" /> @@ -100,7 +119,7 @@ const Apply = () => { placeholder="Enter Email address" required onChange={handleChange} - className="w-full p-2 border rounded-md" + className="w-full p-2 border border-gray-400 rounded-md" /> @@ -109,8 +128,8 @@ const Apply = () => { enableSearch={true} value={formData.phone} onChange={handlePhoneChange} - inputClass="w-full p-2 border rounded-md" - containerClass="w-full" + inputClass="w-full p-2 border rounded-md border-gray-400" + containerClass="w-[250px] md:w-full" /> @@ -120,7 +139,7 @@ const Apply = () => { placeholder="Address" required onChange={handleChange} - className="w-full p-2 border rounded-md" + className="w-full p-2 border border-gray-400 rounded-md" /> @@ -128,7 +147,7 @@ const Apply = () => { name="relocation" required onChange={handleChange} - className="w-full p-2 border rounded-md" + className="w-full p-2 border border-gray-400 rounded-md" > @@ -142,7 +161,7 @@ const Apply = () => { placeholder="Preferred Start Date" required onChange={handleChange} - className="w-full p-2 border rounded-md" + className="w-full p-2 border-gray-400 rounded-md" /> @@ -152,7 +171,7 @@ const Apply = () => { placeholder="Immigration Status" required onChange={handleChange} - className="w-full p-2 border rounded-md" + className="w-full p-2 border border-gray-400 rounded-md" > @@ -169,7 +188,7 @@ const Apply = () => { placeholder="Work Permit Expiry (if applicable)" onChange={handleChange} required - className={"w-full p-2 border rounded-md" + (!requirePermitExpiry ? "bg-gray-400" : "")} + className={"w-full p-2 border border-gray-400 rounded-md" + (!requirePermitExpiry ? "bg-gray-400" : "")} disabled={!requirePermitExpiry} /> @@ -179,7 +198,7 @@ const Apply = () => { accept=".pdf,.doc,.docx" required onChange={handleFileChange} - className="w-full p-2 border rounded-md" + className="w-full p-2 border border-gray-400 rounded-md" />
+
); }; diff --git a/src/pages/JobDetails.jsx b/src/pages/JobDetails.jsx index dcbbd93..1c7dbf8 100644 --- a/src/pages/JobDetails.jsx +++ b/src/pages/JobDetails.jsx @@ -27,24 +27,31 @@ const JobDetails = () => { } return ( -
- {/* Back to Open Positions & Apply Now Button */} -
- - ← Back to Open Positions - - - Apply Now - +
+
+
+
+

{job.title}

+ {job.postedDate && ( +

Date Posted: {new Date(job.postedDate).toDateString()}

+ )} +
+ + Apply Now + +
-

{job.title}

- -
+
+ />{/* Back to Open Positions */} +
+ + ← Back to Open Positions + +
);