♻️(frontend) replace UTF emoji characters with designer-created images
Replace UTF character-based emoji with custom image assets designed by our UX/UI team. Enhances cross-platform compatibility of reactions that were previously inconsistent between operating systems. Specifically addresses issue where emoji sent from Mac weren't properly displayed on all client systems.
BIN
src/frontend/public/assets/reactions/clapping-hands.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
src/frontend/public/assets/reactions/face-with-open-mouth.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
src/frontend/public/assets/reactions/face-with-tears-of-joy.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
src/frontend/public/assets/reactions/party-popper.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
src/frontend/public/assets/reactions/red-heart.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
src/frontend/public/assets/reactions/thumbs-down.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
src/frontend/public/assets/reactions/thumbs-up.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
@@ -11,7 +11,7 @@ import { useNotificationSound } from '@/features/notifications/hooks/useSoundNot
|
|||||||
import { ToastProvider, toastQueue } from './components/ToastProvider'
|
import { ToastProvider, toastQueue } from './components/ToastProvider'
|
||||||
import { WaitingParticipantNotification } from './components/WaitingParticipantNotification'
|
import { WaitingParticipantNotification } from './components/WaitingParticipantNotification'
|
||||||
import {
|
import {
|
||||||
EMOJIS,
|
Emoji,
|
||||||
Reaction,
|
Reaction,
|
||||||
} from '@/features/rooms/livekit/components/controls/ReactionsToggle'
|
} from '@/features/rooms/livekit/components/controls/ReactionsToggle'
|
||||||
import {
|
import {
|
||||||
@@ -50,7 +50,7 @@ export const MainNotificationToast = () => {
|
|||||||
}, [room, triggerNotificationSound])
|
}, [room, triggerNotificationSound])
|
||||||
|
|
||||||
const handleEmoji = (emoji: string, participant: Participant) => {
|
const handleEmoji = (emoji: string, participant: Participant) => {
|
||||||
if (!emoji || !EMOJIS.includes(emoji)) return
|
if (!emoji || !Object.values(Emoji).includes(emoji as Emoji)) return
|
||||||
const id = instanceIdRef.current++
|
const id = instanceIdRef.current++
|
||||||
setReactions((prev) => [
|
setReactions((prev) => [
|
||||||
...prev,
|
...prev,
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ export function FloatingReaction({
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={css({
|
className={css({
|
||||||
fontSize: '3rem',
|
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
@@ -69,17 +68,20 @@ export function FloatingReaction({
|
|||||||
style={{
|
style={{
|
||||||
left: left,
|
left: left,
|
||||||
bottom: INITIAL_POSITION + deltaY,
|
bottom: INITIAL_POSITION + deltaY,
|
||||||
transform: `scale(${scale})`,
|
|
||||||
opacity: opacity,
|
opacity: opacity,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span
|
<img
|
||||||
|
src={`/assets/reactions/${emoji}.png`}
|
||||||
|
alt={''}
|
||||||
className={css({
|
className={css({
|
||||||
lineHeight: '57px',
|
height: '50px',
|
||||||
})}
|
})}
|
||||||
>
|
style={{
|
||||||
{emoji}
|
transform: `scale(${scale})`,
|
||||||
</span>
|
transformOrigin: 'center bottom',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
{name && (
|
{name && (
|
||||||
<Text
|
<Text
|
||||||
variant="sm"
|
variant="sm"
|
||||||
|
|||||||
@@ -15,7 +15,15 @@ import { Participant } from 'livekit-client'
|
|||||||
import useRateLimiter from '@/hooks/useRateLimiter'
|
import useRateLimiter from '@/hooks/useRateLimiter'
|
||||||
|
|
||||||
// eslint-disable-next-line react-refresh/only-export-components
|
// eslint-disable-next-line react-refresh/only-export-components
|
||||||
export const EMOJIS = ['👍', '👎', '👏', '❤️', '😂', '😮', '🎉']
|
export enum Emoji {
|
||||||
|
THUMBS_UP = 'thumbs-up',
|
||||||
|
THUMBS_DOWN = 'thumbs-down',
|
||||||
|
CLAP = 'clapping-hands',
|
||||||
|
HEART = 'red-heart',
|
||||||
|
LAUGHING = 'face-with-tears-of-joy',
|
||||||
|
SURPRISED = 'face-with-open-mouth',
|
||||||
|
CELEBRATION = 'party-popper',
|
||||||
|
}
|
||||||
|
|
||||||
export interface Reaction {
|
export interface Reaction {
|
||||||
id: number
|
id: number
|
||||||
@@ -112,10 +120,10 @@ export const ReactionsToggle = () => {
|
|||||||
<div
|
<div
|
||||||
className={css({
|
className={css({
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
top: -55,
|
top: -63,
|
||||||
left: -114,
|
left: -139,
|
||||||
borderRadius: '8px',
|
borderRadius: '8px',
|
||||||
padding: '0.25rem',
|
padding: '0.35rem',
|
||||||
backgroundColor: 'primaryDark.50',
|
backgroundColor: 'primaryDark.50',
|
||||||
opacity: opacity,
|
opacity: opacity,
|
||||||
transition: 'opacity 0.2s ease',
|
transition: 'opacity 0.2s ease',
|
||||||
@@ -129,24 +137,29 @@ export const ReactionsToggle = () => {
|
|||||||
<RACToolbar
|
<RACToolbar
|
||||||
className={css({
|
className={css({
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
gap: '0.5rem',
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{EMOJIS.map((emoji, index) => (
|
{Object.values(Emoji).map((emoji, index) => (
|
||||||
<Button
|
<Button
|
||||||
key={index}
|
key={index}
|
||||||
onPress={() => debouncedSendReaction(emoji)}
|
onPress={() => debouncedSendReaction(emoji)}
|
||||||
aria-label={t('send', { emoji })}
|
aria-label={t('send', { emoji })}
|
||||||
variant="primaryTextDark"
|
variant="primaryTextDark"
|
||||||
size="sm"
|
size="sm"
|
||||||
|
square
|
||||||
data-attr={`send-reaction-${emoji}`}
|
data-attr={`send-reaction-${emoji}`}
|
||||||
>
|
>
|
||||||
<span
|
<img
|
||||||
|
src={`/assets/reactions/${emoji}.png`}
|
||||||
|
alt=""
|
||||||
className={css({
|
className={css({
|
||||||
fontSize: '20px',
|
minHeight: '28px',
|
||||||
|
minWidth: '28px',
|
||||||
|
pointerEvents: 'none',
|
||||||
|
userSelect: 'none',
|
||||||
})}
|
})}
|
||||||
>
|
/>
|
||||||
{emoji}
|
|
||||||
</span>
|
|
||||||
</Button>
|
</Button>
|
||||||
))}
|
))}
|
||||||
</RACToolbar>
|
</RACToolbar>
|
||||||
|
|||||||