From bf80d3f05236dea139d8ad1d455b1d698f931e34 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Thu, 12 Sep 2024 12:24:35 +0100 Subject: [PATCH] Stop project functionality --- .../Projects/StatusStepper/ProjectStepper.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/Projects/StatusStepper/ProjectStepper.tsx b/src/components/Projects/StatusStepper/ProjectStepper.tsx index cc332490f..28bd51181 100644 --- a/src/components/Projects/StatusStepper/ProjectStepper.tsx +++ b/src/components/Projects/StatusStepper/ProjectStepper.tsx @@ -1,4 +1,4 @@ -import { Flag, Play, Send, Share, X } from 'lucide-react'; +import { Flag, Play, Send, Share, Square, StopCircle, X } from 'lucide-react'; import { useEffect, useRef, useState } from 'react'; import { cn } from '../../../lib/classname.ts'; import { useStickyStuck } from '../../../hooks/use-sticky-stuck.tsx'; @@ -13,6 +13,7 @@ import { showLoginPopup } from '../../../lib/popup.ts'; import { SubmitProjectModal } from '../SubmitProjectModal.tsx'; import { useCopyText } from '../../../hooks/use-copy-text.ts'; import { CheckIcon } from '../../ReactIcons/CheckIcon.tsx'; +import { pageProgressMessage } from '../../../stores/page.ts'; type ProjectStatusResponse = { id?: string; @@ -93,7 +94,12 @@ export function ProjectStepper(props: ProjectStepperProps) { return; } - window.location.reload(); + pageProgressMessage.set('Update project status'); + setActiveStep(0); + loadProjectStatus().finally(() => { + pageProgressMessage.set(''); + setIsStoppingProject(false); + }); }; useEffect(() => { @@ -210,13 +216,13 @@ export function ProjectStepper(props: ProjectStepperProps) { {projectStatus?.startedAt && !projectStatus?.submittedAt && ( )}