From 93ca4a5da281a3d8d9cd3a7d8a5d5ac8e6bbe77c Mon Sep 17 00:00:00 2001 From: Renato Date: Thu, 20 Feb 2020 14:25:44 -0800 Subject: [PATCH 1/3] support any button type in WizardLayout --- docs/components/WizardLayoutView.jsx | 7 +++++++ src/WizardLayout/WizardLayout.tsx | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/components/WizardLayoutView.jsx b/docs/components/WizardLayoutView.jsx index f8ef647b0..a7294ecec 100644 --- a/docs/components/WizardLayoutView.jsx +++ b/docs/components/WizardLayoutView.jsx @@ -292,6 +292,13 @@ export default class WizardLayoutView extends React.PureComponent { defaultValue: "Next step", optional: true, }, + { + name: "nextStepButtonType", + type: "String", + description: "One of primary, secondary, destructive, link, linkPlain, plain", + defaultValue: "primary", + optional: true, + }, { name: "onNextStep", type: "Function", diff --git a/src/WizardLayout/WizardLayout.tsx b/src/WizardLayout/WizardLayout.tsx index 083b6b0fa..f14f8b422 100644 --- a/src/WizardLayout/WizardLayout.tsx +++ b/src/WizardLayout/WizardLayout.tsx @@ -19,6 +19,7 @@ export interface Props { hideSaveAndExit?: boolean; nextStepButtonDisabled?: boolean; nextStepButtonText?: string; + nextStepButtonType?: "primary" | "secondary" | "destructive" | "link" | "linkPlain" | "plain"; onNextStep: () => void; onPrevStep: () => void; onSaveAndExit?: () => void; @@ -44,6 +45,7 @@ const propTypes = { hidePreviousStepButton: PropTypes.bool, nextStepButtonDisabled: PropTypes.bool, nextStepButtonText: PropTypes.string, + nextStepButtonType: PropTypes.string, prevStepButtonDisabled: PropTypes.bool, prevStepButtonText: PropTypes.string, hideSaveAndExit: PropTypes.bool, @@ -95,6 +97,7 @@ export default class WizardLayout extends React.PureComponent { helpContent, nextStepButtonDisabled, nextStepButtonText, + nextStepButtonType, hidePreviousStepButton, hideSaveAndExit, onSaveAndExit, @@ -165,7 +168,7 @@ export default class WizardLayout extends React.PureComponent { /> )}