From 0f81a0f5ed72ae75bdbf0bb027d745581c41b79f Mon Sep 17 00:00:00 2001 From: Bill Date: Fri, 11 Mar 2022 23:01:23 -0500 Subject: [PATCH] Update messenger --- src/common/layout/LayoutItemCountView.tsx | 2 +- src/components/toolbar/ToolbarView.tsx | 2 +- .../views/messenger/FriendsMessengerView.scss | 14 +++ .../views/messenger/FriendsMessengerView.tsx | 98 ++++++++++--------- 4 files changed, 68 insertions(+), 48 deletions(-) diff --git a/src/common/layout/LayoutItemCountView.tsx b/src/common/layout/LayoutItemCountView.tsx index 03877bdb..54478a29 100644 --- a/src/common/layout/LayoutItemCountView.tsx +++ b/src/common/layout/LayoutItemCountView.tsx @@ -8,7 +8,7 @@ interface LayoutItemCountViewProps extends BaseProps export const LayoutItemCountView: FC = props => { - const { count = 0, position = 'aboslute', classNames = [], children = null, ...rest } = props; + const { count = 0, position = 'absolute', classNames = [], children = null, ...rest } = props; const getClassNames = useMemo(() => { diff --git a/src/components/toolbar/ToolbarView.tsx b/src/components/toolbar/ToolbarView.tsx index bbb5ee6a..06a69731 100644 --- a/src/components/toolbar/ToolbarView.tsx +++ b/src/components/toolbar/ToolbarView.tsx @@ -223,7 +223,7 @@ export const ToolbarView: FC = props => } { ((chatIconType === CHAT_ICON_SHOWING) || (chatIconType === CHAT_ICON_UNREAD)) && - handleToolbarItemClick(ToolbarViewItems.FRIEND_CHAT_ITEM) } /> } + handleToolbarItemClick(ToolbarViewItems.FRIEND_CHAT_ITEM) } /> } diff --git a/src/views/friends/views/messenger/FriendsMessengerView.scss b/src/views/friends/views/messenger/FriendsMessengerView.scss index b36cfbc0..1cb17642 100644 --- a/src/views/friends/views/messenger/FriendsMessengerView.scss +++ b/src/views/friends/views/messenger/FriendsMessengerView.scss @@ -2,6 +2,20 @@ width: $messenger-width; height: $messenger-height; + .layout-grid-item { + height: 50px; + } + + .friend-head { + width: 50px; + height: 45px; + overflow: hidden; + + .avatar-image { + margin-top: 90px; + } + } + .open-chat-entry { position: relative; border: 2px solid; diff --git a/src/views/friends/views/messenger/FriendsMessengerView.tsx b/src/views/friends/views/messenger/FriendsMessengerView.tsx index fa42040b..080f7af7 100644 --- a/src/views/friends/views/messenger/FriendsMessengerView.tsx +++ b/src/views/friends/views/messenger/FriendsMessengerView.tsx @@ -1,7 +1,8 @@ +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { FollowFriendMessageComposer, ILinkEventTracker, NewConsoleMessageEvent, RoomInviteEvent, SendMessageComposer as SendMessageComposerPacket } from '@nitrots/nitro-renderer'; import { FC, KeyboardEvent, useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { AddEventLinkTracker, GetSessionDataManager, GetUserProfile, LocalizeText, PlaySound, RemoveLinkEventTracker, SendMessageComposer, SoundNames } from '../../../../api'; -import { Base, Button, ButtonGroup, Column, Flex, Grid, LayoutAvatarImageView, LayoutBadgeImageView, LayoutItemCountView, NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../../common'; +import { Base, Button, ButtonGroup, Column, Flex, Grid, LayoutAvatarImageView, LayoutBadgeImageView, LayoutGridItem, LayoutItemCountView, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../../../common'; import { FriendsMessengerIconEvent } from '../../../../events'; import { BatchUpdates, DispatchUiEvent, UseMessageEventHook } from '../../../../hooks'; import { MessengerThread } from '../../common/MessengerThread'; @@ -253,61 +254,66 @@ export const FriendsMessengerView: FC<{}> = props => setIsVisible(false)} /> - - - {LocalizeText('toolbar.icon.label.messenger')} - - {visibleThreads && (visibleThreads.length > 0) && visibleThreads.map((thread, index) => - { - const messageThreadIndex = messageThreads.indexOf(thread); + + + { LocalizeText('toolbar.icon.label.messenger') } + + { visibleThreads && (visibleThreads.length > 0) && visibleThreads.map((thread, index) => + { + const messageThreadIndex = messageThreads.indexOf(thread); - return ( - setActiveThreadIndex(messageThreadIndex)}> - {thread.unread && - - } -
- - {thread.participant.id > 0 && } - {thread.participant.id <= 0 && } - -
- {thread.participant.name} -
- ); - })} + return ( + setActiveThreadIndex(messageThreadIndex) }> + { thread.unread && + } + + + { (thread.participant.id > 0) && + } + { (thread.participant.id <= 0) && + } + + { thread.participant.name } + + + ); + })}
- - {(activeThreadIndex >= 0) && + + { (activeThreadIndex >= 0) && <> - {LocalizeText('messenger.window.separator', ['FRIEND_NAME'], [messageThreads[activeThreadIndex].participant.name])} - - - + + + - - - - - - + + + + - - setMessageText(event.target.value)} onKeyDown={onKeyDown} /> - - } + }