diff --git a/app/dsoc/apply/[id]/page.tsx b/app/dsoc/apply/[id]/page.tsx index e8b76e7..0e8d8fa 100644 --- a/app/dsoc/apply/[id]/page.tsx +++ b/app/dsoc/apply/[id]/page.tsx @@ -34,6 +34,8 @@ interface Project { } type ApplicationFormValues = { + discordUsername: string; + discordJoined: boolean; whyThisProject: string; motivation: string; relevantExperience: string; @@ -67,6 +69,7 @@ export default function ApplyPage({ params }: { params: Promise<{ id: string }> const [success, setSuccess] = useState(false); const [currentStep, setCurrentStep] = useState(1); const [isMentee, setIsMentee] = useState(null); + const [showDiscordPrompt, setShowDiscordPrompt] = useState(true); const { register, handleSubmit, @@ -75,6 +78,8 @@ export default function ApplyPage({ params }: { params: Promise<{ id: string }> watch, } = useForm({ defaultValues: { + discordUsername: '', + discordJoined: false, whyThisProject: '', motivation: '', relevantExperience: '', @@ -95,9 +100,10 @@ export default function ApplyPage({ params }: { params: Promise<{ id: string }> }); const availabilityValue = watch('availability'); + const discordJoinedValue = watch('discordJoined'); const stepFields: Record = { - 1: ['whyThisProject', 'motivation'], + 1: ['discordUsername', 'discordJoined', 'whyThisProject', 'motivation'], 2: ['relevantExperience', 'technicalSkills', 'githubProfile', 'portfolioLinks'], 3: ['proposal', 'timeline', 'expectedLearnings'], 4: ['availability', 'timezone'], @@ -233,13 +239,19 @@ export default function ApplyPage({ params }: { params: Promise<{ id: string }> }); }; + const isStepAccessible = (stepId: number) => { + return stepId <= currentStep; + }; + if (loading) { return ( -
+
-
-
-

Loading application...

+
+
+
+

Loading application...

+
); @@ -314,6 +326,34 @@ export default function ApplyPage({ params }: { params: Promise<{ id: string }> return (
+ + {showDiscordPrompt && !discordJoinedValue && ( +
+
+

Join Discord First

+

+ Joining Discord is mandatory before applying. Please join the DSOC Discord and the project channel. +

+
+ + Join Discord + + +
+
+
+ )}
@@ -411,14 +451,19 @@ export default function ApplyPage({ params }: { params: Promise<{ id: string }>