mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-02-17 01:12:37 +01:00
Fix chat clicking
This commit is contained in:
parent
2cb2e59d01
commit
5fd0cdd21b
@ -1,4 +1,4 @@
|
|||||||
import { RoomChatSettings } from '@nitrots/nitro-renderer';
|
import { RoomChatSettings, RoomObjectCategory } from '@nitrots/nitro-renderer';
|
||||||
import { FC, useEffect, useMemo, useRef, useState } from 'react';
|
import { FC, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
import { ChatBubbleMessage, GetRoomEngine } from '../../../../api';
|
import { ChatBubbleMessage, GetRoomEngine } from '../../../../api';
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ export const ChatWidgetMessageView: FC<ChatWidgetMessageViewProps> = props =>
|
|||||||
useEffect(() => setIsVisible(chat.visible), [ chat.visible ]);
|
useEffect(() => setIsVisible(chat.visible), [ chat.visible ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div ref={ elementRef } className={ `bubble-container ${ isVisible ? 'visible' : 'invisible' }` } onClick={ event => GetRoomEngine().setSelectedAvatar(chat.roomId, chat.senderId) }>
|
<div ref={ elementRef } className={ `bubble-container ${ isVisible ? 'visible' : 'invisible' }` } onClick={ event => GetRoomEngine().selectRoomObject(chat.roomId, chat.senderId, RoomObjectCategory.UNIT) }>
|
||||||
{ (chat.styleId === 0) &&
|
{ (chat.styleId === 0) &&
|
||||||
<div className="user-container-bg" style={ { backgroundColor: chat.color } } /> }
|
<div className="user-container-bg" style={ { backgroundColor: chat.color } } /> }
|
||||||
<div className={ `chat-bubble bubble-${ chat.styleId } type-${ chat.type }` } style={ { maxWidth: getBubbleWidth } }>
|
<div className={ `chat-bubble bubble-${ chat.styleId } type-${ chat.type }` } style={ { maxWidth: getBubbleWidth } }>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user