From 0ac3b0824bcf8d0370fa1cfb5a810175c838ecc4 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 1 Sep 2022 13:07:22 -0500 Subject: [PATCH] Add header to desktop chats --- app/soapbox/features/chats/components/chat-box.tsx | 8 +++++--- app/soapbox/features/chats/index.tsx | 8 +++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/soapbox/features/chats/components/chat-box.tsx b/app/soapbox/features/chats/components/chat-box.tsx index 9553dec34..b1dab49a8 100644 --- a/app/soapbox/features/chats/components/chat-box.tsx +++ b/app/soapbox/features/chats/components/chat-box.tsx @@ -1,4 +1,5 @@ import { useMutation } from '@tanstack/react-query'; +import classNames from 'classnames'; import { OrderedSet as ImmutableOrderedSet } from 'immutable'; import React, { MutableRefObject, useEffect, useRef, useState } from 'react'; import { useIntl, defineMessages } from 'react-intl'; @@ -31,14 +32,15 @@ interface IChatBox { chat: IChat, onSetInputRef: (el: HTMLTextAreaElement) => void, autosize?: boolean, - inputRef?: MutableRefObject + inputRef?: MutableRefObject, + className?: string, } /** * Chat UI with just the messages and textarea. * Reused between floating desktop chats and fullscreen/mobile chats. */ -const ChatBox: React.FC = ({ chat, onSetInputRef, autosize, inputRef }) => { +const ChatBox: React.FC = ({ chat, onSetInputRef, autosize, inputRef, className }) => { const intl = useIntl(); const dispatch = useAppDispatch(); const chatMessageIds = useAppSelector(state => state.chat_message_lists.get(chat.id, ImmutableOrderedSet())); @@ -214,7 +216,7 @@ const ChatBox: React.FC = ({ chat, onSetInputRef, autosize, inputRef } }; return ( - +
diff --git a/app/soapbox/features/chats/index.tsx b/app/soapbox/features/chats/index.tsx index f064f8fae..507167461 100644 --- a/app/soapbox/features/chats/index.tsx +++ b/app/soapbox/features/chats/index.tsx @@ -8,6 +8,7 @@ import AccountSearch from 'soapbox/components/account_search'; import { Card, CardTitle, Stack } from '../../components/ui'; +import Chat from './components/chat'; import ChatBox from './components/chat-box'; import ChatList from './components/chat-list'; @@ -49,7 +50,12 @@ const ChatIndex: React.FC = () => {
{chat && ( - {}} /> + + {}} /> +
+ {}} /> +
+
)}