diff --git a/components/landing-page/project/CreateProjectModal/LoadingScreen.tsx b/components/landing-page/project/CreateProjectModal/LoadingScreen.tsx new file mode 100644 index 000000000..661bf0fe9 --- /dev/null +++ b/components/landing-page/project/CreateProjectModal/LoadingScreen.tsx @@ -0,0 +1,29 @@ +'use client'; +import { motion } from 'framer-motion'; + +const LoadingScreen = () => { + return ( +
+
+ {[...Array(3)].map((_, index) => ( + + ))} +
+
+ ); +}; + +export default LoadingScreen; diff --git a/components/landing-page/project/CreateProjectModal/SuccessScreen.tsx b/components/landing-page/project/CreateProjectModal/SuccessScreen.tsx new file mode 100644 index 000000000..b5055a3a2 --- /dev/null +++ b/components/landing-page/project/CreateProjectModal/SuccessScreen.tsx @@ -0,0 +1,32 @@ +import { BoundlessButton } from '@/components/buttons'; +import Image from 'next/image'; + +const SuccessScreen = ({ onContinue }: { onContinue: () => void }) => { + return ( +
+
+ Green good mark +
+

Submission Successful!

+

+ Your project has been sent for admin review and will be processed + within 72 hours. You can track its status anytime on the{' '} + + Projects Page + +

+
+ + Continue +
+
+ ); +}; + +export default SuccessScreen; diff --git a/components/landing-page/project/CreateProjectModal/index.tsx b/components/landing-page/project/CreateProjectModal/index.tsx index 121049728..8f8341c10 100644 --- a/components/landing-page/project/CreateProjectModal/index.tsx +++ b/components/landing-page/project/CreateProjectModal/index.tsx @@ -7,6 +7,8 @@ import Details from './Details'; import Milestones from './Milestones'; import Team from './Team'; import Contact from './Contact'; +import LoadingScreen from './LoadingScreen'; +import SuccessScreen from './SuccessScreen'; const CreateProjectModal = ({ open, @@ -16,6 +18,8 @@ const CreateProjectModal = ({ setOpen: (open: boolean) => void; }) => { const [currentStep, setCurrentStep] = useState(1); + const [isLoading, setIsLoading] = useState(false); + const [showSuccess, setShowSuccess] = useState(false); const handleBack = () => { if (currentStep > 1) { @@ -24,19 +28,37 @@ const CreateProjectModal = ({ }; const handleContinue = () => { + if (showSuccess) return; // prevent clicks when success is showing + if (currentStep < 5) { - setCurrentStep(currentStep + 1); + setIsLoading(true); + setTimeout(() => { + setCurrentStep(prev => prev + 1); + setIsLoading(false); + }, 1000); } else { - // Handle final submission - // TODO: Implement project submission logic - // This could include API calls, form validation, etc. + // ✅ After final step, show success screen + setShowSuccess(true); } }; - // Placeholder for step validation - you can implement actual validation logic here + const handleReset = () => { + // reset all states to start fresh + setShowSuccess(false); + setCurrentStep(1); + setIsLoading(false); + }; + const isStepValid = true; const renderStepContent = () => { + if (isLoading) { + return ; + } + if (showSuccess) { + return ; + } + switch (currentStep) { case 1: return ; @@ -59,15 +81,19 @@ const CreateProjectModal = ({ open={open} setOpen={setOpen} > -
+ {!showSuccess &&
} +
{renderStepContent()}
-