From 1c230028b018e5662f330d14a3cc2f2b8a941104 Mon Sep 17 00:00:00 2001 From: brenoepics Date: Thu, 17 Mar 2022 22:30:46 +0000 Subject: [PATCH 1/2] Fix send messages on android --- src/components/room/widgets/chat-input/ChatInputView.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/room/widgets/chat-input/ChatInputView.tsx b/src/components/room/widgets/chat-input/ChatInputView.tsx index e97c5550..f21fdc51 100644 --- a/src/components/room/widgets/chat-input/ChatInputView.tsx +++ b/src/components/room/widgets/chat-input/ChatInputView.tsx @@ -155,8 +155,9 @@ export const ChatInputView: FC<{}> = props => const value = (event.target as HTMLInputElement).value; - switch(event.code) + switch(event.key) { + case ' ': case 'Space': checkSpecialKeywordForInput(); return; From 88b8a4e91b3c07db5f8fa2c6b193d8e96995a69d Mon Sep 17 00:00:00 2001 From: robbis1111 Date: Thu, 17 Mar 2022 22:57:20 +0000 Subject: [PATCH 2/2] Added avatar to hotel view --- public/ui-config.json.example | 1 + src/components/hotel-view/HotelView.scss | 2 +- src/components/hotel-view/HotelView.tsx | 37 ++++++++++++++++++++++-- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/public/ui-config.json.example b/public/ui-config.json.example index 49774722..43902aab 100644 --- a/public/ui-config.json.example +++ b/public/ui-config.json.example @@ -14,6 +14,7 @@ "camera.publish.disabled": false, "hc.disabled": false, "hotelview": { + "show.avatar": true, "widgets": { "slot.1.widget": "promoarticle", "slot.1.conf": "", diff --git a/src/components/hotel-view/HotelView.scss b/src/components/hotel-view/HotelView.scss index 137cbcf1..3c389c5d 100644 --- a/src/components/hotel-view/HotelView.scss +++ b/src/components/hotel-view/HotelView.scss @@ -8,7 +8,7 @@ .avatar-image { bottom: 12px; - left: 63px; + left: 57px; position: absolute; z-index: 1; } diff --git a/src/components/hotel-view/HotelView.tsx b/src/components/hotel-view/HotelView.tsx index f446b0da..dbcb1afa 100644 --- a/src/components/hotel-view/HotelView.tsx +++ b/src/components/hotel-view/HotelView.tsx @@ -1,13 +1,39 @@ -import { RoomSessionEvent } from '@nitrots/nitro-renderer'; +import { FigureUpdateEvent, RoomSessionEvent, UserInfoDataParser, UserInfoEvent } from '@nitrots/nitro-renderer'; import { FC, useCallback, useState } from 'react'; import { GetConfiguration, GetConfigurationManager } from '../../api'; -import { UseRoomSessionManagerEvent } from '../../hooks'; +import { LayoutAvatarImageView } from '../../common'; +import { BatchUpdates, UseMessageEventHook, UseRoomSessionManagerEvent } from '../../hooks'; import { WidgetSlotView } from './views/widget-slot/WidgetSlotView'; - export const HotelView: FC<{}> = props => { const [isVisible, setIsVisible] = useState(true); const widgetSlotCount = 7; + const [ userFigure, setUserFigure ] = useState(null); + const [ userInfo, setUserInfo ] = useState(null); + + + const onUserInfoEvent = useCallback((event: UserInfoEvent) => + { + const parser = event.getParser(); + + BatchUpdates(() => + { + setUserInfo(parser.userInfo); + setUserFigure(parser.userInfo.figure); + }); + }, []); + + UseMessageEventHook(UserInfoEvent, onUserInfoEvent); + + const onUserFigureEvent = useCallback((event: FigureUpdateEvent) => + { + const parser = event.getParser(); + + setUserFigure(parser.figure); + }, []); + + UseMessageEventHook(FigureUpdateEvent, onUserFigureEvent); + const onRoomSessionEvent = useCallback((event: RoomSessionEvent) => { @@ -94,6 +120,11 @@ export const HotelView: FC<{}> = props =>
+ {GetConfiguration("hotelview")["show.avatar"] && ( +
+ +
+ )}
); }