diff --git a/app/soapbox/features/chats/chat-room.tsx b/app/soapbox/features/chats/chat-room.tsx index 7762fc216..9c0ab3956 100644 --- a/app/soapbox/features/chats/chat-room.tsx +++ b/app/soapbox/features/chats/chat-room.tsx @@ -60,6 +60,7 @@ const ChatRoom: React.FC = ({ params }) => { ); diff --git a/app/soapbox/features/chats/components/chat-box.tsx b/app/soapbox/features/chats/components/chat-box.tsx index 668c323ca..0baabb43b 100644 --- a/app/soapbox/features/chats/components/chat-box.tsx +++ b/app/soapbox/features/chats/components/chat-box.tsx @@ -25,13 +25,14 @@ const fileKeyGen = (): number => Math.floor((Math.random() * 0x10000)); interface IChatBox { chatId: string, onSetInputRef: (el: HTMLTextAreaElement) => void, + autosize?: boolean, } /** * Chat UI with just the messages and textarea. * Reused between floating desktop chats and fullscreen/mobile chats. */ -const ChatBox: React.FC = ({ chatId, onSetInputRef }) => { +const ChatBox: React.FC = ({ chatId, onSetInputRef, autosize }) => { const intl = useIntl(); const dispatch = useAppDispatch(); const chatMessageIds = useAppSelector(state => state.chat_message_lists.get(chatId, ImmutableOrderedSet())); @@ -167,7 +168,7 @@ const ChatBox: React.FC = ({ chatId, onSetInputRef }) => { return (
- + {renderAttachment()} {isUploading && ( diff --git a/app/soapbox/features/chats/components/chat-message-list.tsx b/app/soapbox/features/chats/components/chat-message-list.tsx index d6dd5ac63..935a3707d 100644 --- a/app/soapbox/features/chats/components/chat-message-list.tsx +++ b/app/soapbox/features/chats/components/chat-message-list.tsx @@ -66,10 +66,12 @@ interface IChatMessageList { chatId: string, /** Message IDs to render. */ chatMessageIds: ImmutableOrderedSet, + /** Whether to make the chatbox fill the height of the screen. */ + autosize?: boolean, } /** Scrollable list of chat messages. */ -const ChatMessageList: React.FC = ({ chatId, chatMessageIds }) => { +const ChatMessageList: React.FC = ({ chatId, chatMessageIds, autosize }) => { const intl = useIntl(); const dispatch = useAppDispatch(); @@ -306,7 +308,7 @@ const ChatMessageList: React.FC = ({ chatId, chatMessageIds }) }, [chatMessageIds.first()]); return ( -
+
{chatMessages.reduce((acc, curr, idx) => { const lastMessage = chatMessages.get(idx - 1);