feat(preferences): option to hide account hover card (#1431)

This commit is contained in:
wheat 2023-01-24 15:46:33 -05:00 committed by GitHub
parent 4e97c31caf
commit 46a8472001
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 1 deletions

View file

@ -8,13 +8,15 @@ const props = defineProps<{
}>()
const account = props.account || (props.handle ? useAccountByHandle(props.handle!) : undefined)
const userSettings = useUserSettings()
defineOptions({
inheritAttrs: false,
})
</script>
<template>
<VMenu v-if="!disabled && account" placement="bottom-start" :delay="{ show: 500, hide: 100 }" v-bind="$attrs" :close-on-content-click="false">
<VMenu v-if="!disabled && account && !getPreferences(userSettings, 'hideAccountHoverCard')" placement="bottom-start" :delay="{ show: 500, hide: 100 }" v-bind="$attrs" :close-on-content-click="false">
<slot />
<template #popper>
<AccountHoverCard v-if="account" :account="account" />

View file

@ -12,6 +12,7 @@ export interface PreferencesSettings {
hideFavoriteCount: boolean
hideFollowerCount: boolean
hideTranslation: boolean
hideAccountHoverCard: boolean
grayscaleMode: boolean
enableAutoplay: boolean
experimentalVirtualScroller: boolean
@ -64,6 +65,7 @@ export const DEFAULT__PREFERENCES_SETTINGS: PreferencesSettings = {
hideFavoriteCount: false,
hideFollowerCount: false,
hideTranslation: false,
hideAccountHoverCard: false,
grayscaleMode: false,
enableAutoplay: true,
experimentalVirtualScroller: true,

View file

@ -362,6 +362,7 @@
"enable_autoplay": "Enable Autoplay",
"github_cards": "GitHub Cards",
"grayscale_mode": "Grayscale mode",
"hide_account_hover_card": "Hide account hover card",
"hide_boost_count": "Hide boost count",
"hide_favorite_count": "Hide favorite count",
"hide_follower_count": "Hide follower count",

View file

@ -39,6 +39,12 @@ const userSettings = useUserSettings()
>
{{ $t('settings.preferences.hide_translation') }}
</SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'hideAccountHoverCard')"
@click="togglePreferences('hideAccountHoverCard')"
>
{{ $t('settings.preferences.hide_account_hover_card') }}
</SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'grayscaleMode')"
@click="togglePreferences('grayscaleMode')"