]> cat aescling's git repositories - mastodon.git/blob - app/javascript/flavours/glitch/components/icon.js
Merge branch 'master' into glitch-soc/merge-upstream
[mastodon.git] / app / javascript / flavours / glitch / components / icon.js
1 // Package imports.
2 import classNames from 'classnames';
3 import PropTypes from 'prop-types';
4 import React from 'react';
5
6 // This just renders a FontAwesome icon.
7 export default function Icon ({
8 className,
9 fullwidth,
10 icon,
11 }) {
12 const computedClass = classNames('icon', 'fa', { 'fa-fw': fullwidth }, `fa-${icon}`, className);
13 return icon ? (
14 <span
15 aria-hidden='true'
16 className={computedClass}
17 />
18 ) : null;
19 }
20
21 // Props.
22 Icon.propTypes = {
23 className: PropTypes.string,
24 fullwidth: PropTypes.bool,
25 icon: PropTypes.string,
26 };
This page took 0.068944 seconds and 4 git commands to generate.