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:
parent
4189e9f31d
commit
ddca8d7430
1 changed files with 4 additions and 0 deletions
|
|
@ -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}
|
||||
/>
|
||||
}
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue