Skip to content

Commit ac62926

Browse files
committed
Updated linkcard to take icon type as prop per PR feedback
1 parent efb5c23 commit ac62926

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/molecules/link-card/link-card.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ const COMPONENT_CLASS = "c-link-card";
2222

2323
export interface LinkCardProps {
2424
children: any;
25+
iconType?: Icons;
2526
includeIcon?: boolean;
2627
label: string;
28+
onClick?: () => void;
2729
to?: any;
2830
type?: LinkCardTypes;
29-
onClick?: () => void;
3031
}
3132

3233
// #endregion Interfaces
@@ -40,14 +41,15 @@ const LinkCard: React.FC<LinkCardProps> = (props: LinkCardProps) => {
4041
if (props.includeIcon) {
4142
cssClassNames.push("-with-icon");
4243
}
43-
const cssClassNamesFlat = cssClassNames.join(" ");
4444

45+
const cssClassNamesFlat = cssClassNames.join(" ");
46+
const iconType = props.iconType ?? Icons.Lightbulb;
4547
const type = props.type ?? LinkCardTypes.Link;
4648

4749
const renderChildren = () => (
4850
<React.Fragment>
4951
{// if
50-
props.includeIcon && <Icon type={Icons.Lightbulb} />}
52+
props.includeIcon && <Icon type={iconType} />}
5153
<div className={`${COMPONENT_CLASS}__content`}>
5254
<Paragraph size={ParagraphSizes.Small}>
5355
{props.children}

0 commit comments

Comments
 (0)