From 36707fac24caa38cf8238ba439667ee955b09df4 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Fri, 16 Aug 2024 19:33:10 +0100 Subject: [PATCH] Voting and active timeline --- src/components/Projects/StartProjectModal.tsx | 2 +- .../Projects/StatusStepper/MilestoneStep.tsx | 14 +++++- .../Projects/StatusStepper/ProjectStepper.tsx | 46 +++++++++++++++++-- .../Projects/SubmitProjectModal.tsx | 18 ++++++-- 4 files changed, 69 insertions(+), 11 deletions(-) diff --git a/src/components/Projects/StartProjectModal.tsx b/src/components/Projects/StartProjectModal.tsx index 97a592af7..aeb5eac1f 100644 --- a/src/components/Projects/StartProjectModal.tsx +++ b/src/components/Projects/StartProjectModal.tsx @@ -160,7 +160,7 @@ export function StartProjectModal(props: StartProjectModalProps) { + + )}
@@ -202,15 +228,25 @@ export function ProjectStepper(props: ProjectStepperProps) { /> 1} /> 2} icon={Flag} - text={'5 upvotes'} + text={ + activeStep == 2 + ? `${projectStatus.upvotes} / 5 upvotes` + : `5 upvotes` + } /> 2} /> 3} icon={Flag} - text={'10 upvotes'} + text={ + activeStep == 3 + ? `${projectStatus.upvotes} / 10 upvotes` + : `10 upvotes` + } />
diff --git a/src/components/Projects/SubmitProjectModal.tsx b/src/components/Projects/SubmitProjectModal.tsx index 10f9cfbb3..3ccc8f537 100644 --- a/src/components/Projects/SubmitProjectModal.tsx +++ b/src/components/Projects/SubmitProjectModal.tsx @@ -1,4 +1,5 @@ import { CheckIcon, CopyIcon, X } from 'lucide-react'; +import { CheckIcon as ReactCheckIcon } from '../ReactIcons/CheckIcon.tsx'; import { Modal } from '../Modal'; import { type FormEvent, useState } from 'react'; import { httpPost } from '../../lib/http'; @@ -39,9 +40,9 @@ export function SubmitProjectModal(props: SubmitProjectModalProps) { const [repoUrl, setRepoUrl] = useState(defaultRepositoryUrl); const [verificationChecks, setVerificationChecks] = useState({ - repositoryExists: 'pending', - readmeExists: 'pending', - projectUrlExists: 'pending', + repositoryExists: defaultRepositoryUrl ? 'success' : 'pending', + readmeExists: defaultRepositoryUrl ? 'success' : 'pending', + projectUrlExists: defaultRepositoryUrl ? 'success' : 'pending', }); const projectUrl = `${import.meta.env.DEV ? 'http://localhost:3000' : 'https://roadmap.sh'}/projects/${projectId}`; @@ -192,6 +193,17 @@ export function SubmitProjectModal(props: SubmitProjectModalProps) { } }; + if (successMessage) { + return ( + +
+ +

{successMessage}

+
+
+ ); + } + return (