mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 22:15:45 +01:00
add icon ui-component
This commit is contained in:
25
scm-ui-components/packages/ui-components/src/Icon.js
Normal file
25
scm-ui-components/packages/ui-components/src/Icon.js
Normal file
@@ -0,0 +1,25 @@
|
||||
//@flow
|
||||
import React from "react";
|
||||
import classNames from "classnames";
|
||||
|
||||
type Props = {
|
||||
title?: string,
|
||||
name: string
|
||||
}
|
||||
|
||||
export default class Icon extends React.Component<Props> {
|
||||
|
||||
render() {
|
||||
const { title, name } = this.props;
|
||||
if(title) {
|
||||
return (
|
||||
<i title={title} className={classNames("is-icon", "fas", "fa-fw", "fa-" + name)}/>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<i className={classNames("is-icon", "fas", "fa-" + name)}/>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ export { validation, urls, repositories };
|
||||
export { default as DateFromNow } from "./DateFromNow.js";
|
||||
export { default as ErrorNotification } from "./ErrorNotification.js";
|
||||
export { default as ErrorPage } from "./ErrorPage.js";
|
||||
export { default as Icon } from "./Icon.js";
|
||||
export { default as Image } from "./Image.js";
|
||||
export { default as Loading } from "./Loading.js";
|
||||
export { default as Logo } from "./Logo.js";
|
||||
|
||||
Reference in New Issue
Block a user