From 37ea00034ff927bce594a4143806ccc7f9b63bfd Mon Sep 17 00:00:00 2001 From: sirpiglr <49359077-sirpiglr@users.noreply.replit.com> Date: Sat, 13 Dec 2025 05:14:20 +0000 Subject: [PATCH] Add quick apply functionality to job postings Implement a quick apply feature for job listings in the Activity component, utilizing localStorage to track applications and introducing a modal for submission. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9203795e-937a-4306-b81d-b4d5c78c240e Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Event-Id: e621e182-a0c1-4254-b48e-1e73508eb3d6 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7c94b7a0-29c7-4f2e-94ef-44b2153872b7/9203795e-937a-4306-b81d-b4d5c78c240e/139vJay Replit-Helium-Checkpoint-Created: true --- client/pages/Activity.tsx | 193 +++++++++++++++++++++++++++++++++++--- 1 file changed, 178 insertions(+), 15 deletions(-) diff --git a/client/pages/Activity.tsx b/client/pages/Activity.tsx index 172d6699..7d59271d 100644 --- a/client/pages/Activity.tsx +++ b/client/pages/Activity.tsx @@ -543,9 +543,21 @@ function QuestsTab({ userId, onXPGain }: { userId?: string; onXPGain: (amount: n ); } -function JobsTab({ openExternalLink }: { openExternalLink: (url: string) => Promise }) { +function JobsTab({ openExternalLink, userId }: { openExternalLink: (url: string) => Promise; userId?: string }) { const [jobs, setJobs] = useState([]); const [loading, setLoading] = useState(true); + const [appliedJobs, setAppliedJobs] = useState>(() => { + try { + const saved = localStorage.getItem('aethex_job_applications'); + return saved ? new Set(JSON.parse(saved)) : new Set(); + } catch { + return new Set(); + } + }); + const [applyingTo, setApplyingTo] = useState(null); + const [showApplyModal, setShowApplyModal] = useState(null); + const [applyMessage, setApplyMessage] = useState(""); + const [applySuccess, setApplySuccess] = useState(null); useEffect(() => { const fetchJobs = async () => { @@ -564,6 +576,33 @@ function JobsTab({ openExternalLink }: { openExternalLink: (url: string) => Prom fetchJobs(); }, []); + const handleQuickApply = (jobId: string, e: MouseEvent) => { + e.stopPropagation(); + if (!userId) return; + setShowApplyModal(jobId); + setApplyMessage(""); + }; + + const submitApplication = () => { + if (!showApplyModal || !userId) return; + setApplyingTo(showApplyModal); + + setTimeout(() => { + const newApplied = new Set(appliedJobs).add(showApplyModal); + setAppliedJobs(newApplied); + try { + localStorage.setItem('aethex_job_applications', JSON.stringify([...newApplied])); + } catch {} + + setApplySuccess(showApplyModal); + setApplyingTo(null); + setShowApplyModal(null); + setApplyMessage(""); + + setTimeout(() => setApplySuccess(null), 3000); + }, 800); + }; + const categories = [ { label: "Full-Time", icon: Briefcase, color: "#60a5fa" }, { label: "Contract", icon: Target, color: "#4ade80" }, @@ -576,12 +615,101 @@ function JobsTab({ openExternalLink }: { openExternalLink: (url: string) => Prom ); + const selectedJob = jobs.find(j => j.id === showApplyModal); + return ( + + {applySuccess && ( + + + Application submitted! + + )} + + + + {showApplyModal && selectedJob && ( + setShowApplyModal(null)} + > + e.stopPropagation()} + className="bg-[#2b2d31] rounded-2xl p-5 w-full max-w-sm border border-[#3f4147] shadow-2xl" + > +
+

Quick Apply

+ +
+ +
+

{selectedJob.title}

+

{selectedJob.company_name || "Remote Opportunity"}

+
+ +
+ +