Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/react-core/src/components/Wizard/Wizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ export interface WizardProps extends React.HTMLProps<HTMLDivElement> {
startAtStep?: number;
/** Aria-label for the Nav */
navAriaLabel?: string;
/** Can remove the default padding around the main body content by setting this to false */
hasBodyPadding?: boolean;
/** Can remove the default padding around the main body content by setting this to true */
hasNoBodyPadding?: boolean;
/** (Use to control the footer) Passing in a footer component lets you control the buttons yourself */
footer?: React.ReactNode;
/** (Unused if footer is controlled) Callback function to save at the end of the wizard, if not specified uses onClose */
Expand Down Expand Up @@ -112,7 +112,7 @@ export class Wizard extends React.Component<WizardProps, WizardState> {
cancelButtonText: 'Cancel',
closeButtonAriaLabel: 'Close',
navAriaLabel: 'Steps',
hasBodyPadding: true,
hasNoBodyPadding: false,
onBack: null as WizardStepFunctionType,
onNext: null as WizardStepFunctionType,
onGoToStep: null as WizardStepFunctionType,
Expand Down Expand Up @@ -349,7 +349,7 @@ export class Wizard extends React.Component<WizardProps, WizardState> {
cancelButtonText = 'Cancel',
closeButtonAriaLabel = 'Close',
navAriaLabel,
hasBodyPadding,
hasNoBodyPadding,
footer,
isCompactNav,
appendTo,
Expand Down Expand Up @@ -480,7 +480,7 @@ export class Wizard extends React.Component<WizardProps, WizardState> {
nav={nav}
steps={steps}
activeStep={activeStep}
hasBodyPadding={hasBodyPadding}
hasNoBodyPadding={hasNoBodyPadding}
>
{footer || (
<WizardFooterInternal
Expand Down
10 changes: 5 additions & 5 deletions packages/react-core/src/components/Wizard/WizardBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import { css } from '@patternfly/react-styles';
export interface WizardBodyProps {
/** Anything that can be rendered in the Wizard body */
children: any;
/** Set to false to remove the default body padding */
hasBodyPadding: boolean;
/** Set to true to remove the default body padding */
hasNoBodyPadding: boolean;
}

export const WizardBody: React.FunctionComponent<WizardBodyProps> = ({
children,
hasBodyPadding = true
hasNoBodyPadding = false
}: WizardBodyProps) => (
<main className={css(styles.wizardMain, !hasBodyPadding && styles.modifiers.noPadding)}>
<div className={css(styles.wizardMainBody)}>{children}</div>
<main className={css(styles.wizardMain)}>
<div className={css(styles.wizardMainBody, hasNoBodyPadding && styles.modifiers.noPadding)}>{children}</div>
</main>
);
8 changes: 4 additions & 4 deletions packages/react-core/src/components/Wizard/WizardToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export interface WizardToggleProps {
activeStep: WizardStep;
/** The WizardFooter */
children: React.ReactNode;
/** Set to false to remove body padding */
hasBodyPadding: boolean;
/** Set to true to remove body padding */
hasNoBodyPadding: boolean;
/** If the nav is open */
isNavOpen: boolean;
/** Callback function for when the nav is toggled */
Expand All @@ -32,7 +32,7 @@ export const WizardToggle: React.FunctionComponent<WizardToggleProps> = ({
steps,
activeStep,
children,
hasBodyPadding = true,
hasNoBodyPadding = false,
'aria-label': ariaLabel = 'Wizard Toggle'
}: WizardToggleProps) => {
let activeStepIndex;
Expand Down Expand Up @@ -76,7 +76,7 @@ export const WizardToggle: React.FunctionComponent<WizardToggleProps> = ({
<div className={css(styles.wizardOuterWrap)}>
<div className={css(styles.wizardInnerWrap)}>
{nav(isNavOpen)}
<WizardBody hasBodyPadding={hasBodyPadding}>{activeStep.component}</WizardBody>
<WizardBody hasNoBodyPadding={hasNoBodyPadding}>{activeStep.component}</WizardBody>
</div>
{children}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ exports[`WizardToggle should match snapshot (auto-generated) 1`] = `
className="pf-c-wizard__inner-wrap"
>
<WizardBody
hasBodyPadding={true}
hasNoBodyPadding={false}
/>
</div>
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ exports[`Wizard should match snapshot 1`] = `
"name": "A",
}
}
hasBodyPadding={true}
hasNoBodyPadding={false}
isNavOpen={false}
nav={[Function]}
onNavToggle={[Function]}
Expand Down