mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-23 22:40:50 +01:00
chat bubble clicking
This commit is contained in:
parent
21082763ca
commit
49199361e5
@ -14,7 +14,7 @@ export const ChatWidgetMessageView: FC<ChatWidgetMessageViewProps> = props =>
|
|||||||
const [ isVisible, setIsVisible ] = useState(false);
|
const [ isVisible, setIsVisible ] = useState(false);
|
||||||
const elementRef = useRef<HTMLDivElement>();
|
const elementRef = useRef<HTMLDivElement>();
|
||||||
|
|
||||||
const onMouseDown = (event: MouseEvent<HTMLDivElement>) => ((event.shiftKey) && onChatClicked(chat));
|
const onMouseDown = (event: MouseEvent<HTMLDivElement>) => onChatClicked(chat);
|
||||||
|
|
||||||
useEffect(() =>
|
useEffect(() =>
|
||||||
{
|
{
|
||||||
@ -57,7 +57,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" style={ { visibility: (isVisible ? 'visible' : 'hidden') } } onMouseDown={ onMouseDown }>
|
<div ref={ elementRef } className="bubble-container" style={ { visibility: (isVisible ? 'visible' : 'hidden') } } onClick={ onMouseDown }>
|
||||||
{ (chat.styleId === 0) && <div className="user-container-bg" style={ { backgroundColor: chat.color } } /> }
|
{ (chat.styleId === 0) && <div className="user-container-bg" style={ { backgroundColor: chat.color } } /> }
|
||||||
<div className={ 'chat-bubble bubble-' + chat.styleId + ' type-' + chat.type }>
|
<div className={ 'chat-bubble bubble-' + chat.styleId + ' type-' + chat.type }>
|
||||||
<div className="user-container">
|
<div className="user-container">
|
||||||
|
@ -39,11 +39,6 @@
|
|||||||
// -webkit-animation-name: bounceIn;
|
// -webkit-animation-name: bounceIn;
|
||||||
// animation-name: bounceIn;
|
// animation-name: bounceIn;
|
||||||
|
|
||||||
&:hover,
|
|
||||||
&:active {
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.user-container-bg {
|
.user-container-bg {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -1px;
|
top: -1px;
|
||||||
|
@ -93,6 +93,7 @@ export const ChatWidgetView: FC<{}> = props =>
|
|||||||
|
|
||||||
const onChatClicked = useCallback((chat: ChatBubbleMessage) =>
|
const onChatClicked = useCallback((chat: ChatBubbleMessage) =>
|
||||||
{
|
{
|
||||||
|
console.log('ehre')
|
||||||
widgetHandler.processWidgetMessage(new RoomWidgetRoomObjectMessage(RoomWidgetRoomObjectMessage.GET_OBJECT_INFO, chat.senderId, chat.senderCategory));
|
widgetHandler.processWidgetMessage(new RoomWidgetRoomObjectMessage(RoomWidgetRoomObjectMessage.GET_OBJECT_INFO, chat.senderId, chat.senderCategory));
|
||||||
widgetHandler.processWidgetMessage(new RoomWidgetChatSelectAvatarMessage(RoomWidgetChatSelectAvatarMessage.MESSAGE_SELECT_AVATAR, chat.senderId, chat.username, chat.roomId));
|
widgetHandler.processWidgetMessage(new RoomWidgetChatSelectAvatarMessage(RoomWidgetChatSelectAvatarMessage.MESSAGE_SELECT_AVATAR, chat.senderId, chat.username, chat.roomId));
|
||||||
}, [ widgetHandler ]);
|
}, [ widgetHandler ]);
|
||||||
|
Loading…
Reference in New Issue
Block a user