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

Commit

Permalink
feat(Tag): Add onDelete and addOnOnClick EventHandlers
Browse files Browse the repository at this point in the history
fix #248
  • Loading branch information
Greg-Hamel committed Jun 27, 2018
1 parent fa0afcf commit c2c648d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/Tag/Tag.react.js
Expand Up @@ -20,6 +20,8 @@ type PropsForAll = {|
+addOn?: React.Node,
+addOnIcon?: string,
+addOnColor?: string,
+onDelete?: Function,
+addOnOnClick?: Function,
|};

type DefaultProps = {|
Expand Down Expand Up @@ -58,6 +60,8 @@ function Tag(props: Props): React.Node {
onPointerLeave,
onFocus,
onBlur,
onDelete,
addOnOnClick,
} = props;

const classes = cn(
Expand Down Expand Up @@ -90,11 +94,11 @@ function Tag(props: Props): React.Node {
)}
{children}
{(addOn || addOnIcon) && (
<TagAddOn icon={addOnIcon} color={addOnColor}>
<TagAddOn icon={addOnIcon} color={addOnColor} onClick={addOnOnClick}>
{addOn}
</TagAddOn>
)}
{remove && <TagAddOn link icon="x" />}
{remove && <TagAddOn onClick={onDelete} link icon="x" />}
</React.Fragment>
);

Expand Down

0 comments on commit c2c648d

Please sign in to comment.