mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-18 03:01:05 +01:00
expand Icon component and use it in HelpIcon, .is-icon class is redundant
This commit is contained in:
@@ -1,22 +1,24 @@
|
|||||||
//@flow
|
//@flow
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import injectSheet from "react-jss";
|
import injectSheet from "react-jss";
|
||||||
import classNames from "classnames";
|
import Icon from "./Icon";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
classes: any
|
classes: any
|
||||||
};
|
};
|
||||||
|
|
||||||
const styles = {
|
const styles = {
|
||||||
textinfo: {
|
textinfo: {
|
||||||
color: "#98d8f3 !important"
|
color: "#98d8f3 !important"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class HelpIcon extends React.Component<Props> {
|
class HelpIcon extends React.Component<Props> {
|
||||||
render() {
|
render() {
|
||||||
const { classes } = this.props;
|
const { classes } = this.props;
|
||||||
return <i className={classNames("fa fa-question-circle has-text-info", classes.textinfo)}></i>;
|
return (
|
||||||
|
<Icon className={classes.textinfo} name="question-circle" />
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,22 +4,26 @@ import classNames from "classnames";
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
title?: string,
|
title?: string,
|
||||||
name: string
|
name: string,
|
||||||
}
|
color: string,
|
||||||
|
className?: string
|
||||||
|
};
|
||||||
|
|
||||||
export default class Icon extends React.Component<Props> {
|
export default class Icon extends React.Component<Props> {
|
||||||
|
static defaultProps = {
|
||||||
|
color: "grey-light"
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { title, name } = this.props;
|
const { title, name, color, className } = this.props;
|
||||||
if(title) {
|
if (title) {
|
||||||
return (
|
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 (
|
return <i className={classNames("fas", "fa-" + name, `has-text-${color}`)} />;
|
||||||
<i className={classNames("is-icon", "fas", "fa-" + name)}/>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import classNames from "classnames";
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
className?: string,
|
className?: string,
|
||||||
color?: string,
|
color: string,
|
||||||
icon?: string,
|
icon?: string,
|
||||||
label: string,
|
label: string,
|
||||||
title?: string,
|
title?: string,
|
||||||
|
|||||||
@@ -819,10 +819,6 @@ form .field:not(.is-grouped) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.is-icon {
|
|
||||||
color: $grey-light;
|
|
||||||
}
|
|
||||||
|
|
||||||
// label with help-icon compensation
|
// label with help-icon compensation
|
||||||
.label-icon-spacing {
|
.label-icon-spacing {
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
|
|||||||
Reference in New Issue
Block a user