Merge branch 'feat/react-picker-titles-support-filter-by-emoji' into 'develop'
Fix #1014 add titles in react picker, support filtering by emoji itself Closes #1014 See merge request pleroma/pleroma-fe!1294
This commit is contained in:
commit
c655699935
3 changed files with 14 additions and 2 deletions
|
@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
### Added
|
### Added
|
||||||
|
- Mouseover titles for emojis in reaction picker
|
||||||
|
- Support to input emoji into the search box in reaction picker
|
||||||
- Added some missing unicode emoji
|
- Added some missing unicode emoji
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
@ -27,13 +27,21 @@ const ReactButton = {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
commonEmojis () {
|
commonEmojis () {
|
||||||
return ['👍', '😠', '👀', '😂', '🔥']
|
return [
|
||||||
|
{ displayText: 'thumbsup', replacement: '👍' },
|
||||||
|
{ displayText: 'angry', replacement: '😠' },
|
||||||
|
{ displayText: 'eyes', replacement: '👀' },
|
||||||
|
{ displayText: 'joy', replacement: '😂' },
|
||||||
|
{ displayText: 'fire', replacement: '🔥' }
|
||||||
|
]
|
||||||
},
|
},
|
||||||
emojis () {
|
emojis () {
|
||||||
if (this.filterWord !== '') {
|
if (this.filterWord !== '') {
|
||||||
const filterWordLowercase = this.filterWord.toLowerCase()
|
const filterWordLowercase = this.filterWord.toLowerCase()
|
||||||
let orderedEmojiList = []
|
let orderedEmojiList = []
|
||||||
for (const emoji of this.$store.state.instance.emoji) {
|
for (const emoji of this.$store.state.instance.emoji) {
|
||||||
|
if (emoji.replacement === this.filterWord) return [emoji]
|
||||||
|
|
||||||
const indexOfFilterWord = emoji.displayText.toLowerCase().indexOf(filterWordLowercase)
|
const indexOfFilterWord = emoji.displayText.toLowerCase().indexOf(filterWordLowercase)
|
||||||
if (indexOfFilterWord > -1) {
|
if (indexOfFilterWord > -1) {
|
||||||
if (!Array.isArray(orderedEmojiList[indexOfFilterWord])) {
|
if (!Array.isArray(orderedEmojiList[indexOfFilterWord])) {
|
||||||
|
|
|
@ -22,15 +22,17 @@
|
||||||
v-for="emoji in commonEmojis"
|
v-for="emoji in commonEmojis"
|
||||||
:key="emoji"
|
:key="emoji"
|
||||||
class="emoji-button"
|
class="emoji-button"
|
||||||
|
:title="emoji.displayText"
|
||||||
@click="addReaction($event, emoji, close)"
|
@click="addReaction($event, emoji, close)"
|
||||||
>
|
>
|
||||||
{{ emoji }}
|
{{ emoji.replacement }}
|
||||||
</span>
|
</span>
|
||||||
<div class="reaction-picker-divider" />
|
<div class="reaction-picker-divider" />
|
||||||
<span
|
<span
|
||||||
v-for="(emoji, key) in emojis"
|
v-for="(emoji, key) in emojis"
|
||||||
:key="key"
|
:key="key"
|
||||||
class="emoji-button"
|
class="emoji-button"
|
||||||
|
:title="emoji.displayText"
|
||||||
@click="addReaction($event, emoji.replacement, close)"
|
@click="addReaction($event, emoji.replacement, close)"
|
||||||
>
|
>
|
||||||
{{ emoji.replacement }}
|
{{ emoji.replacement }}
|
||||||
|
|
Loading…
Reference in a new issue