Skip to content
This repository was archived by the owner on Mar 1, 2024. It is now read-only.

Commit ad208cc

Browse files
committed
feat(Icon): Add new flag shorthand prop
1 parent 25eaa87 commit ad208cc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/components/Icon/Icon.react.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ type Props = {|
1919
+name: string,
2020
+isAriaHidden?: boolean,
2121
/**
22-
* Use the built in payment icon set
22+
* Use the built-in payment icon set
2323
*/
2424
+payment?: boolean,
25+
/**
26+
* Use the built-in flag icon set
27+
*/
28+
+flag?: boolean,
2529
|};
2630

2731
/**
@@ -35,8 +39,9 @@ function Icon({
3539
link,
3640
isAriaHidden,
3741
payment,
42+
flag,
3843
}: Props): React.Node {
39-
const prefix = payment ? "payment" : prefixFromProps;
44+
const prefix = (payment && "payment") || (flag && "flag") || prefixFromProps;
4045
const classes = cn(
4146
{
4247
[prefix]: true,

0 commit comments

Comments
 (0)