Skip to content

Commit

Permalink
feat(Reactions): Change to animated emojis
Browse files Browse the repository at this point in the history
Signed-off-by: DorraJaouad <[email protected]>
  • Loading branch information
DorraJaouad committed Oct 26, 2023
1 parent bca5b73 commit bb2aa62
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 1 deletion.
Binary file added img/emojis/Clap.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/emojis/Concerned.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/emojis/Heart.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/emojis/Joy.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/emojis/Party.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/emojis/Star-struck.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/emojis/Surprised.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/emojis/Thinking-face.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/emojis/Thumbs-down.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/emojis/Thumbs-up.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 32 additions & 1 deletion src/components/CallView/shared/ReactionToaster.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@
:key="toast.seed"
class="toast"
:style="styled(toast.name, toast.seed)">
<span class="toast__reaction">
<img v-if="toast.reactionURL"
class="toast__reaction-img"
:src="toast.reactionURL"
:alt="toast.reaction"
width="34"
height="34">
<span v-else class="toast__reaction">
{{ toast.reaction }}
</span>
<span class="toast__name">
Expand All @@ -43,13 +49,27 @@ import Hex from 'crypto-js/enc-hex.js'
import SHA1 from 'crypto-js/sha1.js'

import { subscribe, unsubscribe } from '@nextcloud/event-bus'
import { imagePath } from '@nextcloud/router'

import usernameToColor from '@nextcloud/vue/dist/Functions/usernameToColor.js'

import TransitionWrapper from '../../TransitionWrapper.vue'

import { useGuestNameStore } from '../../../stores/guestName.js'

const reactions = {
'❀️': 'Heart.gif',
'πŸŽ‰': 'Party.gif',
'πŸ‘': 'Clap.gif',
'πŸ‘': 'Thumbs-up.gif',
'πŸ‘Ž': 'Thumbs-down.gif',
'πŸ˜‚': 'Joy.gif',
'🀩': 'Star-struck.gif',
'πŸ€”': 'Thinking-face.gif',
'😲': 'Surprised.gif',
'πŸ˜₯': 'Concerned.gif',
}

export default {
name: 'ReactionToaster',

Expand Down Expand Up @@ -153,6 +173,7 @@ export default {
this.reactionsQueue.push({
id: model.attributes.peerId,
reaction,
reactionURL: this.getReactionURL(reaction),
name: isLocalModel
? this.$store.getters.getDisplayName() || t('spreed', 'Guest')
: this.getParticipantName(model),
Expand Down Expand Up @@ -186,6 +207,12 @@ export default {
return this.guestNameStore.getGuestName(this.token, Hex.stringify(SHA1(peerId)))
},

getReactionURL(emoji) {
return reactions[emoji]
? imagePath('spreed', 'emojis/' + reactions[emoji])
: undefined
},

styled(name, seed) {
const color = usernameToColor(name)

Expand Down Expand Up @@ -229,6 +256,10 @@ export default {
& {
font-size: 150%;
}
&-img {
width: 30px;
height: 30px;
}
}
}

Expand Down

0 comments on commit bb2aa62

Please sign in to comment.