From ae33f27dfb8eb7d46e35f26a84b6a43ff3c3e2fc Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Sun, 7 Sep 2025 19:47:33 +0100 Subject: [PATCH] Added progress. --- .../Dashboard/common/WizardView.jsx | 51 ++++++++++++------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/src/components/Dashboard/common/WizardView.jsx b/src/components/Dashboard/common/WizardView.jsx index e07bc1a..66efe6b 100644 --- a/src/components/Dashboard/common/WizardView.jsx +++ b/src/components/Dashboard/common/WizardView.jsx @@ -1,7 +1,7 @@ import PropTypes from 'prop-types' import { useState } from 'react' import { useMediaQuery } from 'react-responsive' -import { Typography, Flex, Steps, Divider } from 'antd' +import { Typography, Flex, Steps, Divider, Progress } from 'antd' import NewObjectButtons from './NewObjectButtons' const { Title } = Typography @@ -14,13 +14,14 @@ const WizardView = ({ formValid, loading, sideBar = null, - submitText = 'Done' + submitText = 'Done', + progress = 0 }) => { const [currentStep, setCurrentStep] = useState(0) const isMobile = useMediaQuery({ maxWidth: 768 }) return ( - + {!isMobile && showSteps == true ? ( sideBar != null ? ( sideBar @@ -40,25 +41,40 @@ const WizardView = ({ ) : null} - - + + {title} -
+
{steps[currentStep].content}
- setCurrentStep((prev) => prev - 1)} - onNext={() => setCurrentStep((prev) => prev + 1)} - onSubmit={onSubmit} - formValid={formValid} - submitLoading={loading} - submitText={submitText} - /> + + {progress > 0 ? ( + + ) : null} + + setCurrentStep((prev) => prev - 1)} + onNext={() => setCurrentStep((prev) => prev + 1)} + onSubmit={onSubmit} + formValid={formValid} + submitLoading={loading} + submitText={submitText} + /> + ) @@ -72,7 +88,8 @@ WizardView.propTypes = { title: PropTypes.string, loading: PropTypes.bool, sideBar: PropTypes.node, - submitText: PropTypes.string + submitText: PropTypes.string, + progress: PropTypes.number } export default WizardView