mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 15:05:44 +01:00
add onClick prop
This commit is contained in:
@@ -7,7 +7,8 @@ type Props = {
|
|||||||
color?: string,
|
color?: string,
|
||||||
icon?: string,
|
icon?: string,
|
||||||
label: string,
|
label: string,
|
||||||
title?: string
|
title?: string,
|
||||||
|
onClick?: () => void
|
||||||
};
|
};
|
||||||
|
|
||||||
class Tag extends React.Component<Props> {
|
class Tag extends React.Component<Props> {
|
||||||
@@ -16,7 +17,7 @@ class Tag extends React.Component<Props> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { icon, label, title, color, className } = this.props;
|
const { className, color, icon, label, title, onClick } = this.props;
|
||||||
let showIcon = null;
|
let showIcon = null;
|
||||||
if (icon) {
|
if (icon) {
|
||||||
showIcon = (
|
showIcon = (
|
||||||
@@ -30,6 +31,7 @@ class Tag extends React.Component<Props> {
|
|||||||
<span
|
<span
|
||||||
className={classNames("tag", `is-${color}`, className)}
|
className={classNames("tag", `is-${color}`, className)}
|
||||||
title={title}
|
title={title}
|
||||||
|
onClick={onClick}
|
||||||
>
|
>
|
||||||
{showIcon}
|
{showIcon}
|
||||||
{label}
|
{label}
|
||||||
|
|||||||
Reference in New Issue
Block a user