0
0
Fork 0

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:
Eugen Rochko 2019-02-01 00:14:05 +01:00 committed by GitHub
parent 3383ed7573
commit 1f95190202
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 147 additions and 82 deletions

View file

@ -7,6 +7,7 @@ import { injectIntl, FormattedMessage } from 'react-intl';
import Permalink from '../../../components/permalink';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { HotKeys } from 'react-hotkeys';
import Icon from 'mastodon/components/icon';
const notificationForScreenReader = (intl, message, timestamp) => {
const output = [message];
@ -105,7 +106,7 @@ class Notification extends ImmutablePureComponent {
<div className='notification notification-follow focusable' tabIndex='0' aria-label={notificationForScreenReader(intl, intl.formatMessage({ id: 'notification.follow', defaultMessage: '{name} followed you' }, { name: account.get('acct') }), notification.get('created_at'))}>
<div className='notification__message'>
<div className='notification__favourite-icon-wrapper'>
<i className='fa fa-fw fa-user-plus' />
<Icon id='user-plus' fixedWidth />
</div>
<span title={notification.get('created_at')}>
@ -140,7 +141,7 @@ class Notification extends ImmutablePureComponent {
<div className='notification notification-favourite focusable' tabIndex='0' aria-label={notificationForScreenReader(intl, intl.formatMessage({ id: 'notification.favourite', defaultMessage: '{name} favourited your status' }, { name: notification.getIn(['account', 'acct']) }), notification.get('created_at'))}>
<div className='notification__message'>
<div className='notification__favourite-icon-wrapper'>
<i className='fa fa-fw fa-star star-icon' />
<Icon id='star' className='star-icon' fixedWidth />
</div>
<span title={notification.get('created_at')}>
@ -162,7 +163,7 @@ class Notification extends ImmutablePureComponent {
<div className='notification notification-reblog focusable' tabIndex='0' aria-label={notificationForScreenReader(intl, intl.formatMessage({ id: 'notification.reblog', defaultMessage: '{name} boosted your status' }, { name: notification.getIn(['account', 'acct']) }), notification.get('created_at'))}>
<div className='notification__message'>
<div className='notification__favourite-icon-wrapper'>
<i className='fa fa-fw fa-retweet' />
<Icon id='retweet' fixedWidth />
</div>
<span title={notification.get('created_at')}>