Skip to content

Commit 70da853

Browse files
committed
fix(pf4): use link variant for cancel button
1 parent b291e65 commit 70da853

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

packages/pf4-component-mapper/src/files/form-template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Button as PF4Button, ActionGroup, Form, TextContent, Text, TextVariants
88
import './form-template.scss';
99

1010
export const Button = ({ label, bsStyle, children, disabled, buttonType, ...props }) => (
11-
<PF4Button variant={bsStyle || 'secondary'} isDisabled={disabled} {...props}>
11+
<PF4Button variant={buttonType === 'cancel' ? 'link' : bsStyle || 'secondary'} isDisabled={disabled} {...props}>
1212
{label}
1313
{children}
1414
</PF4Button>

packages/pf4-component-mapper/src/tests/__snapshots__/form-template-common.test.js.snap

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ exports[`FormTemplate PF4 Common should add missing buttons if not defined in bu
251251
<Component
252252
onClick={[MockFunction]}
253253
type="button"
254-
variant="secondary"
254+
variant="link"
255255
>
256256
<ComponentWithOuia
257257
component={[Function]}
@@ -264,7 +264,7 @@ exports[`FormTemplate PF4 Common should add missing buttons if not defined in bu
264264
"isDisabled": undefined,
265265
"onClick": [MockFunction],
266266
"type": "button",
267-
"variant": "secondary",
267+
"variant": "link",
268268
}
269269
}
270270
consumerContext={null}
@@ -278,12 +278,12 @@ exports[`FormTemplate PF4 Common should add missing buttons if not defined in bu
278278
}
279279
}
280280
type="button"
281-
variant="secondary"
281+
variant="link"
282282
>
283283
<button
284284
aria-disabled={null}
285285
aria-label={null}
286-
className="pf-c-button pf-m-secondary"
286+
className="pf-c-button pf-m-link"
287287
disabled={false}
288288
onClick={[MockFunction]}
289289
tabIndex={null}
@@ -505,7 +505,7 @@ exports[`FormTemplate PF4 Common should render all controls and with default lab
505505
<Component
506506
onClick={[MockFunction]}
507507
type="button"
508-
variant="secondary"
508+
variant="link"
509509
>
510510
<ComponentWithOuia
511511
component={[Function]}
@@ -518,7 +518,7 @@ exports[`FormTemplate PF4 Common should render all controls and with default lab
518518
"isDisabled": undefined,
519519
"onClick": [MockFunction],
520520
"type": "button",
521-
"variant": "secondary",
521+
"variant": "link",
522522
}
523523
}
524524
consumerContext={null}
@@ -532,12 +532,12 @@ exports[`FormTemplate PF4 Common should render all controls and with default lab
532532
}
533533
}
534534
type="button"
535-
variant="secondary"
535+
variant="link"
536536
>
537537
<button
538538
aria-disabled={null}
539539
aria-label={null}
540-
className="pf-c-button pf-m-secondary"
540+
className="pf-c-button pf-m-link"
541541
disabled={false}
542542
onClick={[MockFunction]}
543543
tabIndex={null}
@@ -727,7 +727,7 @@ exports[`FormTemplate PF4 Common should render buttons in correct order 1`] = `
727727
<Component
728728
onClick={[MockFunction]}
729729
type="button"
730-
variant="secondary"
730+
variant="link"
731731
>
732732
<ComponentWithOuia
733733
component={[Function]}
@@ -740,7 +740,7 @@ exports[`FormTemplate PF4 Common should render buttons in correct order 1`] = `
740740
"isDisabled": undefined,
741741
"onClick": [MockFunction],
742742
"type": "button",
743-
"variant": "secondary",
743+
"variant": "link",
744744
}
745745
}
746746
consumerContext={null}
@@ -754,12 +754,12 @@ exports[`FormTemplate PF4 Common should render buttons in correct order 1`] = `
754754
}
755755
}
756756
type="button"
757-
variant="secondary"
757+
variant="link"
758758
>
759759
<button
760760
aria-disabled={null}
761761
aria-label={null}
762-
className="pf-c-button pf-m-secondary"
762+
className="pf-c-button pf-m-link"
763763
disabled={false}
764764
onClick={[MockFunction]}
765765
tabIndex={null}

0 commit comments

Comments
 (0)