Adapt to FontAwesome v5.0.6 icon name changes (#15)

This commit is contained in:
AFR 2018-02-24 05:47:36 +07:00 committed by Franz Liedke
parent 4daec37f78
commit 3caa5e52e6
8 changed files with 17 additions and 17 deletions

View File

@ -29,7 +29,7 @@
"flarum-extension": { "flarum-extension": {
"title": "Subscriptions", "title": "Subscriptions",
"icon": { "icon": {
"name": "star", "name": "fa fa-star",
"backgroundColor": "#ffea7b", "backgroundColor": "#ffea7b",
"color": "#de8e00" "color": "#de8e00"
} }

View File

@ -10,7 +10,7 @@ export default function addSubscriptionBadge() {
case 'follow': case 'follow':
badge = Badge.component({ badge = Badge.component({
label: app.translator.trans('flarum-subscriptions.forum.badge.following_tooltip'), label: app.translator.trans('flarum-subscriptions.forum.badge.following_tooltip'),
icon: 'star', icon: 'fa fa-star',
type: 'following' type: 'following'
}); });
break; break;
@ -18,7 +18,7 @@ export default function addSubscriptionBadge() {
case 'ignore': case 'ignore':
badge = Badge.component({ badge = Badge.component({
label: app.translator.trans('flarum-subscriptions.forum.badge.ignoring_tooltip'), label: app.translator.trans('flarum-subscriptions.forum.badge.ignoring_tooltip'),
icon: 'eye-slash', icon: 'far fa-eye-slash',
type: 'ignoring' type: 'ignoring'
}); });
break; break;

View File

@ -9,9 +9,9 @@ export default function addSubscriptionControls() {
extend(DiscussionControls, 'userControls', function(items, discussion, context) { extend(DiscussionControls, 'userControls', function(items, discussion, context) {
if (app.session.user && !(context instanceof DiscussionPage)) { if (app.session.user && !(context instanceof DiscussionPage)) {
const states = { const states = {
none: {label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.follow_button'), icon: 'star', save: 'follow'}, none: {label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.follow_button'), icon: 'fa fa-star', save: 'follow'},
follow: {label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.unfollow_button'), icon: 'star-o', save: false}, follow: {label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.unfollow_button'), icon: 'far fa-star', save: false},
ignore: {label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.unignore_button'), icon: 'eye', save: false} ignore: {label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.unignore_button'), icon: 'fa fa-eye', save: false}
}; };
const subscription = discussion.subscription() || 'none'; const subscription = discussion.subscription() || 'none';

View File

@ -13,7 +13,7 @@ export default function addSubscriptionFilter() {
items.add('following', LinkButton.component({ items.add('following', LinkButton.component({
href: app.route('index.filter', params), href: app.route('index.filter', params),
children: app.translator.trans('flarum-subscriptions.forum.index.following_link'), children: app.translator.trans('flarum-subscriptions.forum.index.following_link'),
icon: 'star' icon: 'fa fa-star'
}), 50); }), 50);
} }
}); });

View File

@ -3,7 +3,7 @@ import username from 'flarum/helpers/username';
export default class NewPostNotification extends Notification { export default class NewPostNotification extends Notification {
icon() { icon() {
return 'star'; return 'fa fa-star';
} }
href() { href() {

View File

@ -10,19 +10,19 @@ export default class SubscriptionMenu extends Dropdown {
this.options = [ this.options = [
{ {
subscription: false, subscription: false,
icon: 'star-o', icon: 'far fa-star',
label: app.translator.trans('flarum-subscriptions.forum.sub_controls.not_following_button'), label: app.translator.trans('flarum-subscriptions.forum.sub_controls.not_following_button'),
description: app.translator.trans('flarum-subscriptions.forum.sub_controls.not_following_text') description: app.translator.trans('flarum-subscriptions.forum.sub_controls.not_following_text')
}, },
{ {
subscription: 'follow', subscription: 'follow',
icon: 'star', icon: 'fa fa-star',
label: app.translator.trans('flarum-subscriptions.forum.sub_controls.following_button'), label: app.translator.trans('flarum-subscriptions.forum.sub_controls.following_button'),
description: app.translator.trans('flarum-subscriptions.forum.sub_controls.following_text') description: app.translator.trans('flarum-subscriptions.forum.sub_controls.following_text')
}, },
{ {
subscription: 'ignore', subscription: 'ignore',
icon: 'eye-slash', icon: 'far fa-eye-slash',
label: app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_button'), label: app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_button'),
description: app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_text') description: app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_text')
} }
@ -34,18 +34,18 @@ export default class SubscriptionMenu extends Dropdown {
const subscription = discussion.subscription(); const subscription = discussion.subscription();
let buttonLabel = app.translator.trans('flarum-subscriptions.forum.sub_controls.follow_button'); let buttonLabel = app.translator.trans('flarum-subscriptions.forum.sub_controls.follow_button');
let buttonIcon = 'star-o'; let buttonIcon = 'far fa-star';
const buttonClass = 'SubscriptionMenu-button--' + subscription; const buttonClass = 'SubscriptionMenu-button--' + subscription;
switch (subscription) { switch (subscription) {
case 'follow': case 'follow':
buttonLabel = app.translator.trans('flarum-subscriptions.forum.sub_controls.following_button'); buttonLabel = app.translator.trans('flarum-subscriptions.forum.sub_controls.following_button');
buttonIcon = 'star'; buttonIcon = 'fa fa-star';
break; break;
case 'ignore': case 'ignore':
buttonLabel = app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_button'); buttonLabel = app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_button');
buttonIcon = 'eye-slash'; buttonIcon = 'far fa-eye-slash';
break; break;
default: default:
@ -85,7 +85,7 @@ export default class SubscriptionMenu extends Dropdown {
{Button.component(buttonProps)} {Button.component(buttonProps)}
<button className={'Dropdown-toggle Button Button--icon ' + buttonClass} data-toggle="dropdown"> <button className={'Dropdown-toggle Button Button--icon ' + buttonClass} data-toggle="dropdown">
{icon('caret-down', {className: 'Button-icon'})} {icon('fa fa-caret-down', {className: 'Button-icon'})}
</button> </button>
<ul className="Dropdown-menu dropdown-menu Dropdown-menu--right"> <ul className="Dropdown-menu dropdown-menu Dropdown-menu--right">

View File

@ -5,7 +5,7 @@ export default class SubscriptionMenuItem extends Component {
view() { view() {
return ( return (
<button className="SubscriptionMenuItem hasIcon" onclick={this.props.onclick}> <button className="SubscriptionMenuItem hasIcon" onclick={this.props.onclick}>
{this.props.active ? icon('check', {className: 'Button-icon'}) : ''} {this.props.active ? icon('fa fa-check', {className: 'Button-icon'}) : ''}
<span className="SubscriptionMenuItem-label"> <span className="SubscriptionMenuItem-label">
{icon(this.props.icon, {className: 'Button-icon'})} {icon(this.props.icon, {className: 'Button-icon'})}
<strong>{this.props.label}</strong> <strong>{this.props.label}</strong>

View File

@ -24,7 +24,7 @@ app.initializers.add('subscriptions', function() {
extend(NotificationGrid.prototype, 'notificationTypes', function(items) { extend(NotificationGrid.prototype, 'notificationTypes', function(items) {
items.add('newPost', { items.add('newPost', {
name: 'newPost', name: 'newPost',
icon: 'star', icon: 'fa fa-star',
label: app.translator.trans('flarum-subscriptions.forum.settings.notify_new_post_label') label: app.translator.trans('flarum-subscriptions.forum.settings.notify_new_post_label')
}); });
}); });