From d94b0396f8dc46b290319559574fc771c5441d2f Mon Sep 17 00:00:00 2001
From: "Builder.io"
Date: Sun, 19 Oct 2025 00:52:23 +0000
Subject: [PATCH] Render inline sign-in prompt for mentor apply instead of
redirect
cgen-84d620fa24fc48609c1ea8dde4b2ffd5
---
client/pages/community/MentorApply.tsx | 237 +++++++++++++------------
1 file changed, 128 insertions(+), 109 deletions(-)
diff --git a/client/pages/community/MentorApply.tsx b/client/pages/community/MentorApply.tsx
index bbd83714..59a7e053 100644
--- a/client/pages/community/MentorApply.tsx
+++ b/client/pages/community/MentorApply.tsx
@@ -16,11 +16,12 @@ import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Switch } from "@/components/ui/switch";
import { Textarea } from "@/components/ui/textarea";
-import { useNavigate } from "react-router-dom";
+import { useLocation, useNavigate } from "react-router-dom";
export default function MentorApply() {
- const { user, loading } = useAuth();
+ const { user } = useAuth();
const navigate = useNavigate();
+ const location = useLocation();
const [bio, setBio] = useState("");
const [expertise, setExpertise] = useState([]);
const [expertiseInput, setExpertiseInput] = useState("");
@@ -28,15 +29,7 @@ export default function MentorApply() {
const [hourlyRate, setHourlyRate] = useState("");
const [submitting, setSubmitting] = useState(false);
- useEffect(() => {
- if (!loading && !user) {
- aethexToast.info({
- title: "Sign in required",
- description: "Please sign in to apply as a mentor",
- });
- navigate("/login");
- }
- }, [user, loading, navigate]);
+ // Show inline sign-in prompt instead of redirecting away
const addExpertise = () => {
const parts = expertiseInput
@@ -102,111 +95,137 @@ export default function MentorApply() {
-
-
- Mentor profile
-
- Tell mentees how you can help and set your availability.
-
-
-
-