mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 09:25:43 +01:00
expand Icon component and use it in HelpIcon, .is-icon class is redundant
This commit is contained in:
@@ -4,22 +4,26 @@ import classNames from "classnames";
|
||||
|
||||
type Props = {
|
||||
title?: string,
|
||||
name: string
|
||||
}
|
||||
name: string,
|
||||
color: string,
|
||||
className?: string
|
||||
};
|
||||
|
||||
export default class Icon extends React.Component<Props> {
|
||||
static defaultProps = {
|
||||
color: "grey-light"
|
||||
};
|
||||
|
||||
render() {
|
||||
const { title, name } = this.props;
|
||||
if(title) {
|
||||
const { title, name, color, className } = this.props;
|
||||
if (title) {
|
||||
return (
|
||||
<i title={title} className={classNames("is-icon", "fas", "fa-fw", "fa-" + name)}/>
|
||||
<i
|
||||
title={title}
|
||||
className={classNames("fas", "fa-fw", "fa-" + name, `has-text-${color}`, className)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<i className={classNames("is-icon", "fas", "fa-" + name)}/>
|
||||
);
|
||||
return <i className={classNames("fas", "fa-" + name, `has-text-${color}`)} />;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user