🚸(frontend) visually differentiate user's reactions from others

Implement light color variant for reactions triggered by current user versus
standard color for other participants' reactions. Provides visual cue to help
users easily identify their own emoji reactions in the conversation flow.
This commit is contained in:
lebaudantoine
2025-05-05 23:09:13 +02:00
committed by aleb_the_flash
parent 2af9ec0d85
commit 2e8407ac7c

View File

@@ -15,6 +15,7 @@ export const INITIAL_POSITION = 200
interface FloatingReactionProps { interface FloatingReactionProps {
emoji: string emoji: string
name?: string name?: string
isLocal?: boolean
speed?: number speed?: number
scale?: number scale?: number
} }
@@ -22,6 +23,7 @@ interface FloatingReactionProps {
export function FloatingReaction({ export function FloatingReaction({
emoji, emoji,
name, name,
isLocal = false,
speed = 1, speed = 1,
scale = 1, scale = 1,
}: FloatingReactionProps) { }: FloatingReactionProps) {
@@ -86,8 +88,9 @@ export function FloatingReaction({
<Text <Text
variant="sm" variant="sm"
className={css({ className={css({
backgroundColor: 'primaryDark.100', backgroundColor: isLocal ? 'primary.100' : 'primaryDark.100',
color: 'white', color: isLocal ? 'black' : 'white',
fontWeight: 500,
textAlign: 'center', textAlign: 'center',
borderRadius: '20px', borderRadius: '20px',
paddingX: '0.5rem', paddingX: '0.5rem',
@@ -130,6 +133,7 @@ export function ReactionPortal({
speed={speed} speed={speed}
scale={scale} scale={scale}
name={participant?.isLocal ? t('you') : participant.name} name={participant?.isLocal ? t('you') : participant.name}
isLocal={participant?.isLocal}
/> />
</div>, </div>,
document.body document.body