Merge branch 'upstream-hide-custom-emoji' into 'develop'

Add ability to hide custom emojis in picker

See merge request pleroma/pleroma-fe!1887
This commit is contained in:
HJ 2024-01-17 13:23:33 +00:00
commit b0d0a3faf6
5 changed files with 21 additions and 2 deletions

View File

@ -0,0 +1 @@
Allow hiding custom emojis in picker.

View File

@ -114,6 +114,7 @@ const EmojiPicker = {
groupsScrolledClass: 'scrolled-top', groupsScrolledClass: 'scrolled-top',
keepOpen: false, keepOpen: false,
customEmojiTimeout: null, customEmojiTimeout: null,
hideCustomEmojiInPicker: false,
// Lazy-load only after the first time `showing` becomes true. // Lazy-load only after the first time `showing` becomes true.
contentLoaded: false, contentLoaded: false,
groupRefs: {}, groupRefs: {},
@ -286,7 +287,7 @@ const EmojiPicker = {
return 0 return 0
}, },
allCustomGroups () { allCustomGroups () {
if (this.hideCustomEmoji) { if (this.hideCustomEmoji || this.hideCustomEmojiInPicker) {
return {} return {}
} }
const emojis = this.$store.getters.groupedCustomEmojis const emojis = this.$store.getters.groupedCustomEmojis

View File

@ -39,11 +39,16 @@ $emoji-picker-emoji-size: 32px;
} }
.keep-open, .keep-open,
.too-many-emoji { .too-many-emoji,
.hide-custom-emoji {
padding: 7px; padding: 7px;
line-height: normal; line-height: normal;
} }
.hide-custom-emoji {
padding-top: 0;
}
.too-many-emoji { .too-many-emoji {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@ -142,6 +142,17 @@
{{ $t('emoji.keep_open') }} {{ $t('emoji.keep_open') }}
</Checkbox> </Checkbox>
</div> </div>
<div
v-if="!hideCustomEmoji"
class="hide-custom-emoji"
>
<Checkbox
v-model="hideCustomEmojiInPicker"
@change="onShowing"
>
{{ $t('emoji.hide_custom_emoji') }}
</Checkbox>
</div>
</div> </div>
<div <div
v-if="showingStickers" v-if="showingStickers"

View File

@ -237,6 +237,7 @@
"search_emoji": "Search for an emoji", "search_emoji": "Search for an emoji",
"add_emoji": "Insert emoji", "add_emoji": "Insert emoji",
"custom": "Custom emoji", "custom": "Custom emoji",
"hide_custom_emoji": "Hide custom emojis",
"unpacked": "Unpacked emoji", "unpacked": "Unpacked emoji",
"unicode": "Unicode emoji", "unicode": "Unicode emoji",
"unicode_groups": { "unicode_groups": {