add icon ui-component

This commit is contained in:
Florian Scholdei
2019-06-12 15:22:10 +02:00
parent bfd22aa507
commit bb38e9e2b9
2 changed files with 26 additions and 0 deletions

View 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)}/>
);
}
}

View File

@@ -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";