Refactor icons in web UI to use Icon component (#9951)
* Refactor uses of icons to an Icon component in web UI * Refactor options passed to the Icon component * Make tests work with absolute component paths
This commit is contained in:
@ -3,6 +3,7 @@ import Motion from '../features/ui/util/optional_motion';
|
||||
import spring from 'react-motion/lib/spring';
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import Icon from 'mastodon/components/icon';
|
||||
|
||||
export default class IconButton extends React.PureComponent {
|
||||
|
||||
@ -86,7 +87,7 @@ export default class IconButton extends React.PureComponent {
|
||||
style={style}
|
||||
tabIndex={tabIndex}
|
||||
>
|
||||
<i className={`fa fa-fw fa-${icon}`} aria-hidden='true' />
|
||||
<Icon id={icon} fixedWidth aria-hidden='true' />
|
||||
</button>
|
||||
);
|
||||
}
|
||||
@ -104,7 +105,7 @@ export default class IconButton extends React.PureComponent {
|
||||
style={style}
|
||||
tabIndex={tabIndex}
|
||||
>
|
||||
<i style={{ transform: `rotate(${rotate}deg)` }} className={`fa fa-fw fa-${icon}`} aria-hidden='true' />
|
||||
<Icon id={icon} style={{ transform: `rotate(${rotate}deg)` }} fixedWidth aria-hidden='true' />
|
||||
</button>
|
||||
)}
|
||||
</Motion>
|
||||
|
Reference in New Issue
Block a user