From ddca8d74307ee443a0bda1de08fabb3c5d34353c Mon Sep 17 00:00:00 2001 From: lucasgarfield Date: Tue, 23 Apr 2024 14:07:49 +0200 Subject: [PATCH] V2 Wizard: Disable back on first step (HMS-2781) Disables the back button on the first step of the wizard. Disabling the back button (as opposed to hiding it) is how the wizard works in the Patternfly official examples. --- src/Components/CreateImageWizardV2/CreateImageWizard.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Components/CreateImageWizardV2/CreateImageWizard.tsx b/src/Components/CreateImageWizardV2/CreateImageWizard.tsx index 6ef27e58..39183510 100644 --- a/src/Components/CreateImageWizardV2/CreateImageWizard.tsx +++ b/src/Components/CreateImageWizardV2/CreateImageWizard.tsx @@ -58,10 +58,12 @@ import { resolveRelPath } from '../../Utilities/path'; import { ImageBuilderHeader } from '../sharedComponents/ImageBuilderHeader'; type CustomWizardFooterPropType = { + disableBack?: boolean; disableNext: boolean; }; export const CustomWizardFooter = ({ + disableBack: disableBack, disableNext: disableNext, }: CustomWizardFooterPropType) => { const { goToNextStep, goToPrevStep, close } = useWizardContext(); @@ -79,6 +81,7 @@ export const CustomWizardFooter = ({ ouiaId="wizard-back-btn" variant="secondary" onClick={goToPrevStep} + isDisabled={disableBack} > Back @@ -160,6 +163,7 @@ const CreateImageWizard = ({ startStepIndex = 1 }: CreateImageWizardProps) => { footer={ } >