parent
eee362b9e0
commit
8757ac7deb
8 changed files with 18 additions and 2 deletions
|
@ -7,6 +7,8 @@ import classNames from 'classnames';
|
|||
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
|
||||
import { isHideItem } from 'mastodon/initial_state';
|
||||
|
||||
import EmojiView from './emoji_view';
|
||||
|
||||
class EmojiReactionButton extends PureComponent {
|
||||
|
@ -41,12 +43,14 @@ class EmojiReactionButton extends PureComponent {
|
|||
'toggled': me,
|
||||
};
|
||||
|
||||
const countView = count !== undefined && <span className='count'>{count}</span>;
|
||||
|
||||
return (
|
||||
<button className={classNames(classList)} type='button' onClick={this.onClick}>
|
||||
<span className='emoji'>
|
||||
<EmojiView name={name} url={url} staticUrl={staticUrl} />
|
||||
</span>
|
||||
<span className='count'>{count}</span>
|
||||
{countView}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
@ -76,6 +80,8 @@ class StatusEmojiReactionsBar extends PureComponent {
|
|||
render () {
|
||||
const { emojiReactions, myReactionOnly } = this.props;
|
||||
|
||||
const isShowCount = !isHideItem('emoji_reaction_count');
|
||||
|
||||
const emojiButtons = Array.from(emojiReactions)
|
||||
.filter(emoji => emoji.get('count') !== 0)
|
||||
.filter(emoji => !myReactionOnly || emoji.get('me'))
|
||||
|
@ -83,7 +89,7 @@ class StatusEmojiReactionsBar extends PureComponent {
|
|||
<EmojiReactionButton
|
||||
key={index}
|
||||
name={emoji.get('name')}
|
||||
count={myReactionOnly ? 1 : emoji.get('count')}
|
||||
count={isShowCount ? (myReactionOnly ? 1 : emoji.get('count')) : undefined}
|
||||
me={emoji.get('me')}
|
||||
url={emoji.get('url')}
|
||||
staticUrl={emoji.get('static_url')}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* @typedef { 'blocking_quote'
|
||||
* | 'emoji_reaction_on_timeline'
|
||||
* | 'emoji_reaction_unavailable_server'
|
||||
* | 'emoji_reaction_count'
|
||||
* | 'favourite_menu'
|
||||
* | 'quote_in_home'
|
||||
* | 'quote_in_public'
|
||||
|
|
|
@ -259,6 +259,10 @@ module User::HasSettings
|
|||
settings['web.hide_emoji_reaction_unavailable_server']
|
||||
end
|
||||
|
||||
def setting_hide_emoji_reaction_count
|
||||
settings['web.hide_emoji_reaction_count']
|
||||
end
|
||||
|
||||
def setting_hide_favourite_menu
|
||||
settings['web.hide_favourite_menu']
|
||||
end
|
||||
|
|
|
@ -72,6 +72,7 @@ class UserSettings
|
|||
setting :hide_blocking_quote, default: true
|
||||
setting :hide_emoji_reaction_unavailable_server, default: false
|
||||
setting :hide_favourite_menu, default: false
|
||||
setting :hide_emoji_reaction_count, default: false
|
||||
end
|
||||
|
||||
namespace :notification_emails do
|
||||
|
|
|
@ -41,6 +41,7 @@ class InitialStateSerializer < ActiveModel::Serializer
|
|||
object_account_user.setting_hide_recent_emojis ? 'recent_emojis' : nil,
|
||||
object_account_user.setting_hide_blocking_quote ? 'blocking_quote' : nil,
|
||||
object_account_user.setting_hide_emoji_reaction_unavailable_server ? 'emoji_reaction_unavailable_server' : nil,
|
||||
object_account_user.setting_hide_emoji_reaction_count ? 'emoji_reaction_count' : nil,
|
||||
object_account_user.setting_show_emoji_reaction_on_timeline ? nil : 'emoji_reaction_on_timeline',
|
||||
object_account_user.setting_show_quote_in_home ? nil : 'quote_in_home',
|
||||
object_account_user.setting_show_quote_in_public ? nil : 'quote_in_public',
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
= ff.input :'web.enable_emoji_reaction', wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_enable_emoji_reaction'), hint: I18n.t('simple_form.hints.defaults.setting_enable_emoji_reaction')
|
||||
= ff.input :'web.show_emoji_reaction_on_timeline', wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_show_emoji_reaction_on_timeline')
|
||||
= ff.input :'web.hide_emoji_reaction_unavailable_server', wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_hide_emoji_reaction_unavailable_server')
|
||||
= ff.input :'web.hide_emoji_reaction_count', wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_hide_emoji_reaction_count')
|
||||
|
||||
%h4= t 'appearance.saved_posts'
|
||||
|
||||
|
|
|
@ -269,6 +269,7 @@ en:
|
|||
outside_only: Followings or followers only
|
||||
setting_expand_spoilers: Always expand posts marked with content warnings
|
||||
setting_hide_blocking_quote: Hide posts which have a quote written by the user you are blocking
|
||||
setting_hide_emoji_reaction_count: Hide stamp count
|
||||
setting_hide_emoji_reaction_unavailable_server: Hide stamp button from unavailable server
|
||||
setting_hide_favourite_menu: Hide favourite menu
|
||||
setting_hide_followers_count: Hide followers count
|
||||
|
|
|
@ -278,6 +278,7 @@ ja:
|
|||
setting_enable_emoji_reaction: スタンプ機能を使用する
|
||||
setting_expand_spoilers: 閲覧注意としてマークされた投稿を常に展開する
|
||||
setting_hide_blocking_quote: ブロックしたユーザーの投稿を引用した投稿を隠す
|
||||
setting_hide_emoji_reaction_count: 各スタンプの数を隠す
|
||||
setting_hide_emoji_reaction_unavailable_server: スタンプに対応していないと思われるサーバーの投稿からスタンプボタンを隠す
|
||||
setting_hide_favourite_menu: 右サイドメニューから「お気に入り」を隠す
|
||||
setting_hide_followers_count: フォロワー数を隠す
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue