mirror of
https://github.com/flarum/framework.git
synced 2025-01-20 15:33:20 +08:00
Adapt to FontAwesome v5.0.6 icon name changes (#15)
This commit is contained in:
parent
4daec37f78
commit
3caa5e52e6
|
@ -29,7 +29,7 @@
|
|||
"flarum-extension": {
|
||||
"title": "Subscriptions",
|
||||
"icon": {
|
||||
"name": "star",
|
||||
"name": "fa fa-star",
|
||||
"backgroundColor": "#ffea7b",
|
||||
"color": "#de8e00"
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ export default function addSubscriptionBadge() {
|
|||
case 'follow':
|
||||
badge = Badge.component({
|
||||
label: app.translator.trans('flarum-subscriptions.forum.badge.following_tooltip'),
|
||||
icon: 'star',
|
||||
icon: 'fa fa-star',
|
||||
type: 'following'
|
||||
});
|
||||
break;
|
||||
|
@ -18,7 +18,7 @@ export default function addSubscriptionBadge() {
|
|||
case 'ignore':
|
||||
badge = Badge.component({
|
||||
label: app.translator.trans('flarum-subscriptions.forum.badge.ignoring_tooltip'),
|
||||
icon: 'eye-slash',
|
||||
icon: 'far fa-eye-slash',
|
||||
type: 'ignoring'
|
||||
});
|
||||
break;
|
||||
|
|
|
@ -9,9 +9,9 @@ export default function addSubscriptionControls() {
|
|||
extend(DiscussionControls, 'userControls', function(items, discussion, context) {
|
||||
if (app.session.user && !(context instanceof DiscussionPage)) {
|
||||
const states = {
|
||||
none: {label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.follow_button'), icon: 'star', save: 'follow'},
|
||||
follow: {label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.unfollow_button'), icon: 'star-o', save: false},
|
||||
ignore: {label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.unignore_button'), icon: 'eye', save: false}
|
||||
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: 'far fa-star', 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';
|
||||
|
|
|
@ -13,7 +13,7 @@ export default function addSubscriptionFilter() {
|
|||
items.add('following', LinkButton.component({
|
||||
href: app.route('index.filter', params),
|
||||
children: app.translator.trans('flarum-subscriptions.forum.index.following_link'),
|
||||
icon: 'star'
|
||||
icon: 'fa fa-star'
|
||||
}), 50);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -3,7 +3,7 @@ import username from 'flarum/helpers/username';
|
|||
|
||||
export default class NewPostNotification extends Notification {
|
||||
icon() {
|
||||
return 'star';
|
||||
return 'fa fa-star';
|
||||
}
|
||||
|
||||
href() {
|
||||
|
|
|
@ -10,19 +10,19 @@ export default class SubscriptionMenu extends Dropdown {
|
|||
this.options = [
|
||||
{
|
||||
subscription: false,
|
||||
icon: 'star-o',
|
||||
icon: 'far fa-star',
|
||||
label: app.translator.trans('flarum-subscriptions.forum.sub_controls.not_following_button'),
|
||||
description: app.translator.trans('flarum-subscriptions.forum.sub_controls.not_following_text')
|
||||
},
|
||||
{
|
||||
subscription: 'follow',
|
||||
icon: 'star',
|
||||
icon: 'fa fa-star',
|
||||
label: app.translator.trans('flarum-subscriptions.forum.sub_controls.following_button'),
|
||||
description: app.translator.trans('flarum-subscriptions.forum.sub_controls.following_text')
|
||||
},
|
||||
{
|
||||
subscription: 'ignore',
|
||||
icon: 'eye-slash',
|
||||
icon: 'far fa-eye-slash',
|
||||
label: app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_button'),
|
||||
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();
|
||||
|
||||
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;
|
||||
|
||||
switch (subscription) {
|
||||
case 'follow':
|
||||
buttonLabel = app.translator.trans('flarum-subscriptions.forum.sub_controls.following_button');
|
||||
buttonIcon = 'star';
|
||||
buttonIcon = 'fa fa-star';
|
||||
break;
|
||||
|
||||
case 'ignore':
|
||||
buttonLabel = app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_button');
|
||||
buttonIcon = 'eye-slash';
|
||||
buttonIcon = 'far fa-eye-slash';
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -85,7 +85,7 @@ export default class SubscriptionMenu extends Dropdown {
|
|||
{Button.component(buttonProps)}
|
||||
|
||||
<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>
|
||||
|
||||
<ul className="Dropdown-menu dropdown-menu Dropdown-menu--right">
|
||||
|
|
|
@ -5,7 +5,7 @@ export default class SubscriptionMenuItem extends Component {
|
|||
view() {
|
||||
return (
|
||||
<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">
|
||||
{icon(this.props.icon, {className: 'Button-icon'})}
|
||||
<strong>{this.props.label}</strong>
|
||||
|
|
|
@ -24,7 +24,7 @@ app.initializers.add('subscriptions', function() {
|
|||
extend(NotificationGrid.prototype, 'notificationTypes', function(items) {
|
||||
items.add('newPost', {
|
||||
name: 'newPost',
|
||||
icon: 'star',
|
||||
icon: 'fa fa-star',
|
||||
label: app.translator.trans('flarum-subscriptions.forum.settings.notify_new_post_label')
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user