From af019da6e7b24b37fa481212b1c334577bf27e97 Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 12 Jan 2022 23:54:53 -0500 Subject: [PATCH] Update RoomToolsWidgetView --- .../room-tools/RoomToolsWidgetView.tsx | 37 +++++-------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/src/views/room/widgets/room-tools/RoomToolsWidgetView.tsx b/src/views/room/widgets/room-tools/RoomToolsWidgetView.tsx index d9e9b6e8..1828d809 100644 --- a/src/views/room/widgets/room-tools/RoomToolsWidgetView.tsx +++ b/src/views/room/widgets/room-tools/RoomToolsWidgetView.tsx @@ -2,6 +2,8 @@ import { RoomLikeRoomComposer } from '@nitrots/nitro-renderer'; import classNames from 'classnames'; import { FC, useCallback, useState } from 'react'; import { LocalizeText, RoomWidgetZoomToggleMessage } from '../../../../api'; +import { Base } from '../../../../common/Base'; +import { Column } from '../../../../common/Column'; import { NavigatorEvent } from '../../../../events'; import { ChatHistoryEvent } from '../../../../events/chat-history/ChatHistoryEvent'; import { dispatchUiEvent } from '../../../../hooks/events'; @@ -10,11 +12,9 @@ import { useRoomContext } from '../../context/RoomContext'; export const RoomToolsWidgetView: FC<{}> = props => { - const { widgetHandler = null } = useRoomContext(); - - const [ isExpended, setIsExpanded ] = useState(false); const [ isZoomedIn, setIsZoomedIn ] = useState(false); const [ isLiked, setIsLiked ] = useState(false); + const { widgetHandler = null } = useRoomContext(); const handleToolClick = useCallback((action: string) => { @@ -29,7 +29,6 @@ export const RoomToolsWidgetView: FC<{}> = props => return; case 'chat_history': dispatchUiEvent(new ChatHistoryEvent(ChatHistoryEvent.TOGGLE_CHAT_HISTORY)); - //setIsExpanded(false); close this ?? return; case 'like_room': if(isLiked) return; @@ -44,27 +43,11 @@ export const RoomToolsWidgetView: FC<{}> = props => }, [ isZoomedIn, isLiked, widgetHandler ]); return ( -
-
-
handleToolClick('settings') }> - { LocalizeText('room.settings.button.text') } -
-
handleToolClick('zoom') }> - { LocalizeText('room.zoom.button.text') } -
-
handleToolClick('chat_history') }> - { LocalizeText('room.chathistory.button.text') } -
-
handleToolClick('like_room') }> - { LocalizeText('room.like.button.text') } -
-
handleToolClick('toggle_room_link') }> - { LocalizeText('navigator.embed.caption') } -
-
-
setIsExpanded(value => !value)}> - -
-
+ + handleToolClick('settings') } /> + handleToolClick('zoom') } className={ 'icon ' + classNames({ 'icon-zoom-less': !isZoomedIn, 'icon-zoom-more': isZoomedIn }) } /> + handleToolClick('chat_history') } className="icon icon-chat-history" /> + { !isLiked && handleToolClick('like_room') } className="icon icon-like-room" /> } + ); -}; +}