diff --git a/app/soapbox/features/chats/components/chat-list.tsx b/app/soapbox/features/chats/components/chat-list.tsx index cd3d5f05a..f016370e9 100644 --- a/app/soapbox/features/chats/components/chat-list.tsx +++ b/app/soapbox/features/chats/components/chat-list.tsx @@ -15,9 +15,10 @@ import Blankslate from './chat-pane/blankslate'; interface IChatList { onClickChat: (chat: any) => void, useWindowScroll?: boolean, + fade?: boolean, } -const ChatList: React.FC = ({ onClickChat, useWindowScroll = false }) => { +const ChatList: React.FC = ({ onClickChat, useWindowScroll = false, fade }) => { const dispatch = useDispatch(); const chatListRef = useRef(null); @@ -74,18 +75,22 @@ const ChatList: React.FC = ({ onClickChat, useWindowScroll = false }) )} -
-
+ {fade && ( + <> +
+
+ + )}
); }; diff --git a/app/soapbox/features/chats/components/chat-pane/chat-pane.tsx b/app/soapbox/features/chats/components/chat-pane/chat-pane.tsx index 2ab917f25..6f6b73f73 100644 --- a/app/soapbox/features/chats/components/chat-pane/chat-pane.tsx +++ b/app/soapbox/features/chats/components/chat-pane/chat-pane.tsx @@ -91,7 +91,7 @@ const ChatPane = () => { ); } else { - return ; + return ; } }; diff --git a/app/soapbox/features/chats/index.tsx b/app/soapbox/features/chats/index.tsx index 58f84f284..f064f8fae 100644 --- a/app/soapbox/features/chats/index.tsx +++ b/app/soapbox/features/chats/index.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useState } from 'react'; import { defineMessages, useIntl } from 'react-intl'; import { useDispatch } from 'react-redux'; import { useHistory } from 'react-router-dom'; @@ -8,6 +8,7 @@ import AccountSearch from 'soapbox/components/account_search'; import { Card, CardTitle, Stack } from '../../components/ui'; +import ChatBox from './components/chat-box'; import ChatList from './components/chat-list'; const messages = defineMessages({ @@ -20,18 +21,21 @@ const ChatIndex: React.FC = () => { const dispatch = useDispatch(); const history = useHistory(); + const [chat, setChat] = useState(null); + const handleSuggestion = (accountId: string) => { dispatch(launchChat(accountId, history, true)); }; - const handleClickChat = (chat: { id: string }) => { - history.push(`/chats/${chat.id}`); + const handleClickChat = (chat: any) => { + // history.push(`/chats/${chat.id}`); + setChat(chat); }; return ( - -
- + +
+ { onSelected={handleSuggestion} /> -
- -
+ + + +
+ + {chat && ( + {}} /> + )} - Message area
);