diff --git a/web/chat/chat-tabs.react.js b/web/chat/chat-tabs.react.js
index ef1077290..2da8c4674 100644
--- a/web/chat/chat-tabs.react.js
+++ b/web/chat/chat-tabs.react.js
@@ -1,48 +1,55 @@
// @flow
import * as React from 'react';
import { unreadBackgroundCount } from 'lib/selectors/thread-selectors';
import { useSelector } from '../redux/redux-utils';
import css from './chat-tabs.css';
import ChatThreadBackground from './chat-thread-background.react';
import ChatThreadHome from './chat-thread-home.react';
import ChatThreadTab from './chat-thread-tab.react';
-function ChatTabs() {
+type Props = {|
+ +setModal: (modal: ?React.Node) => void,
+|};
+function ChatTabs(props: Props) {
let backgroundTitle = 'BACKGROUND';
const unreadBackgroundCountVal = useSelector(unreadBackgroundCount);
if (unreadBackgroundCountVal) {
backgroundTitle += ` (${unreadBackgroundCountVal})`;
}
const [activeTab, setActiveTab] = React.useState('HOME');
const onClickHome = React.useCallback(() => setActiveTab('HOME'), []);
const onClickBackground = React.useCallback(
() => setActiveTab('BACKGROUND'),
[],
);
const threadList =
- activeTab === 'HOME' ? : ;
+ activeTab === 'HOME' ? (
+
+ ) : (
+
+ );
return (
+
);
}
export default ChatThreadListSeeMoreSidebars;
diff --git a/web/chat/chat-thread-list.react.js b/web/chat/chat-thread-list.react.js
index 6693783ad..74044725d 100644
--- a/web/chat/chat-thread-list.react.js
+++ b/web/chat/chat-thread-list.react.js
@@ -1,33 +1,38 @@
// @flow
import * as React from 'react';
import type { ThreadInfo } from 'lib/types/thread-types';
import { useSelector } from '../redux/redux-utils';
import { webChatListData } from '../selectors/chat-selectors';
import ChatThreadListItem from './chat-thread-list-item.react';
type Props = {|
+filterThreads: (threadItem: ThreadInfo) => boolean,
+ +setModal: (modal: ?React.Node) => void,
+emptyItem?: React.ComponentType<{||}>,
|};
function ChatThreadList(props: Props) {
- const { filterThreads, emptyItem } = props;
+ const { filterThreads, setModal, emptyItem } = props;
const chatListData = useSelector(webChatListData);
const listData: React.Node[] = React.useMemo(() => {
const threads = chatListData
.filter((item) => filterThreads(item.threadInfo))
.map((item) => (
-
+
));
if (threads.length === 0 && emptyItem) {
const EmptyItem = emptyItem;
threads.push(
);
}
return threads;
- }, [chatListData, filterThreads, emptyItem]);
+ }, [chatListData, emptyItem, filterThreads, setModal]);
return
{listData}
;
}
export default ChatThreadList;
diff --git a/web/chat/chat.react.js b/web/chat/chat.react.js
index 90890e514..1fa192353 100644
--- a/web/chat/chat.react.js
+++ b/web/chat/chat.react.js
@@ -1,20 +1,20 @@
// @flow
import * as React from 'react';
import ChatMessageList from './chat-message-list.react';
import ChatTabs from './chat-tabs.react';
type Props = {|
+setModal: (modal: ?React.Node) => void,
|};
function Chat(props: Props) {
return (
<>
-
+
>
);
}
export default Chat;
diff --git a/web/modals/chat/sidebar-list-modal.react.js b/web/modals/chat/sidebar-list-modal.react.js
new file mode 100644
index 000000000..2a7f66fda
--- /dev/null
+++ b/web/modals/chat/sidebar-list-modal.react.js
@@ -0,0 +1,27 @@
+// @flow
+
+import * as React from 'react';
+
+import css from '../../style.css';
+import Modal from '../modal.react';
+
+type Props = {|
+ +setModal: (modal: ?React.Node) => void,
+|};
+function SidebarsListModal(props: Props) {
+ const { setModal } = props;
+
+ const clearModal = React.useCallback(() => {
+ setModal(null);
+ }, [setModal]);
+
+ return (
+
+
+
Sidebars will be displayed here
+
+
+ );
+}
+
+export default SidebarsListModal;