feat: hide reply count (#1439)

* feat: hide reply count

* fix(i18n): rearrange strings

* style: new line
This commit is contained in:
Evan Boehs 2023-01-26 07:41:43 -05:00 committed by GitHub
parent 75c4fa54d7
commit d26510a766
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 2 deletions

View file

@ -37,13 +37,13 @@ const reply = () => {
<div flex-1> <div flex-1>
<StatusActionButton <StatusActionButton
:content="$t('action.reply')" :content="$t('action.reply')"
:text="status.repliesCount || ''" :text="!getPreferences(userSettings, 'hideReplyCount') && status.repliesCount || ''"
color="text-blue" hover="text-blue" group-hover="bg-blue/10" color="text-blue" hover="text-blue" group-hover="bg-blue/10"
icon="i-ri:chat-1-line" icon="i-ri:chat-1-line"
:command="command" :command="command"
@click="reply" @click="reply"
> >
<template v-if="status.repliesCount" #text> <template v-if="status.repliesCount && !getPreferences(userSettings, 'hideReplyCount')" #text>
<CommonLocalizedNumber <CommonLocalizedNumber
keypath="action.reply_count" keypath="action.reply_count"
:count="status.repliesCount" :count="status.repliesCount"

View file

@ -9,6 +9,7 @@ export type ColorMode = 'light' | 'dark' | 'system'
export interface PreferencesSettings { export interface PreferencesSettings {
hideBoostCount: boolean hideBoostCount: boolean
hideReplyCount: boolean
hideFavoriteCount: boolean hideFavoriteCount: boolean
hideFollowerCount: boolean hideFollowerCount: boolean
hideTranslation: boolean hideTranslation: boolean
@ -62,6 +63,7 @@ export function getDefaultUserSettings(locales: string[]): UserSettings {
export const DEFAULT__PREFERENCES_SETTINGS: PreferencesSettings = { export const DEFAULT__PREFERENCES_SETTINGS: PreferencesSettings = {
hideBoostCount: false, hideBoostCount: false,
hideReplyCount: false,
hideFavoriteCount: false, hideFavoriteCount: false,
hideFollowerCount: false, hideFollowerCount: false,
hideTranslation: false, hideTranslation: false,

View file

@ -368,6 +368,7 @@
"hide_boost_count": "Hide boost count", "hide_boost_count": "Hide boost count",
"hide_favorite_count": "Hide favorite count", "hide_favorite_count": "Hide favorite count",
"hide_follower_count": "Hide follower count", "hide_follower_count": "Hide follower count",
"hide_reply_count": "Hide reply count",
"hide_translation": "Hide translation", "hide_translation": "Hide translation",
"label": "Preferences", "label": "Preferences",
"title": "Experimental Features", "title": "Experimental Features",

View file

@ -27,6 +27,12 @@ const userSettings = useUserSettings()
> >
{{ $t('settings.preferences.hide_favorite_count') }} {{ $t('settings.preferences.hide_favorite_count') }}
</SettingsToggleItem> </SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'hideReplyCount')"
@click="togglePreferences('hideReplyCount')"
>
{{ $t('settings.preferences.hide_reply_count') }}
</SettingsToggleItem>
<SettingsToggleItem <SettingsToggleItem
:checked="getPreferences(userSettings, 'hideFollowerCount')" :checked="getPreferences(userSettings, 'hideFollowerCount')"
@click="togglePreferences('hideFollowerCount')" @click="togglePreferences('hideFollowerCount')"