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.
This commit is contained in:
lucasgarfield 2024-04-23 14:07:49 +02:00 committed by Klara Simickova
parent 4189e9f31d
commit ddca8d7430

View file

@ -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
</Button>
@ -160,6 +163,7 @@ const CreateImageWizard = ({ startStepIndex = 1 }: CreateImageWizardProps) => {
footer={
<CustomWizardFooter
disableNext={targetEnvironments.length === 0}
disableBack={true}
/>
}
>