From 14eec701cb5a4590d198fd0ecfddb0c2c5a0303b Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 27 Aug 2020 14:02:52 -0500 Subject: [PATCH] Chats: add empty chats message --- .../features/chats/components/chat_list.js | 10 ++++--- .../features/chats/components/chat_panes.js | 27 ++++++++++++------- app/styles/chats.scss | 12 +++++++++ app/styles/components/columns.scss | 1 - 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/app/soapbox/features/chats/components/chat_list.js b/app/soapbox/features/chats/components/chat_list.js index ca5349b20..84fd34244 100644 --- a/app/soapbox/features/chats/components/chat_list.js +++ b/app/soapbox/features/chats/components/chat_list.js @@ -10,7 +10,7 @@ import { makeGetChat } from 'soapbox/selectors'; const mapStateToProps = state => { const getChat = makeGetChat(); return { - chats: state.get('chats').map(chat => getChat(state, chat.toJS())), + chats: state.get('chats').map(chat => getChat(state, chat.toJS())).toList(), }; }; @@ -22,6 +22,7 @@ class ChatList extends ImmutablePureComponent { dispatch: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, onClickChat: PropTypes.func, + emptyMessage: PropTypes.node, }; componentDidMount() { @@ -29,12 +30,15 @@ class ChatList extends ImmutablePureComponent { } render() { - const { chats } = this.props; + const { chats, emptyMessage } = this.props; return (
- {chats.toList().map(chat => ( + {chats.count() === 0 && +
{emptyMessage}
+ } + {chats.map(chat => (
+
+ +
+
+ } + /> +
+
+ ); + return (
-
-
- -
-
- -
-
+ {mainWindowPane} {panes.map((pane, i) => )} diff --git a/app/styles/chats.scss b/app/styles/chats.scss index 10a682400..c73542db3 100644 --- a/app/styles/chats.scss +++ b/app/styles/chats.scss @@ -130,4 +130,16 @@ .chat-list { overflow-y: auto; + flex: 1; + + &__content { + height: 100%; + } + + .empty-column-indicator { + height: 100%; + box-sizing: border-box; + background: transparent; + align-items: start; + } } diff --git a/app/styles/components/columns.scss b/app/styles/components/columns.scss index 2151b168b..d8034e497 100644 --- a/app/styles/components/columns.scss +++ b/app/styles/components/columns.scss @@ -678,7 +678,6 @@ align-items: center; justify-content: center; min-height: 160px; - border-radius: 0 0 10px 10px; @supports(display: grid) { // hack to fix Chrome <57 contain: strict;