From aa2cf51c05ebdf411d74af5debbbc8fa4d3cf457 Mon Sep 17 00:00:00 2001
From: eugenijm <eugenijm@protonmail.com>
Date: Thu, 7 May 2020 16:10:53 +0300
Subject: Add Chats

---
 src/components/chat_list/chat_list.vue | 48 ++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 src/components/chat_list/chat_list.vue

(limited to 'src/components/chat_list/chat_list.vue')

diff --git a/src/components/chat_list/chat_list.vue b/src/components/chat_list/chat_list.vue
new file mode 100644
index 00000000..e62f58e5
--- /dev/null
+++ b/src/components/chat_list/chat_list.vue
@@ -0,0 +1,48 @@
+<template>
+  <div v-if="isNew">
+    <ChatNew @cancel="cancelNewChat" />
+  </div>
+  <div
+    v-else
+    class="chat-list panel panel-default"
+  >
+    <div class="panel-heading">
+      <span class="title">
+        {{ $t("chats.chats") }}
+      </span>
+      <button @click="newChat">
+        {{ $t("chats.new") }}
+      </button>
+    </div>
+    <div class="panel-body">
+      <div class="timeline">
+        <List :items="sortedChatList">
+          <template
+            slot="item"
+            slot-scope="{item}"
+          >
+            <ChatListItem
+              :key="item.id"
+              :compact="false"
+              :chat="item"
+            />
+          </template>
+        </List>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script src="./chat_list.js"></script>
+
+<style lang="scss">
+@import '../../_variables.scss';
+
+.chat-list {
+  min-height: calc(100vh - 67px);
+  margin-bottom: 0;
+  border-bottom-left-radius: 0;
+  border-bottom-right-radius: 0;
+}
+
+</style>
-- 
cgit v1.2.3-70-g09d2


From 18a1f5d62a72da45d62672043397a7471ab2c090 Mon Sep 17 00:00:00 2001
From: eugenijm <eugenijm@protonmail.com>
Date: Tue, 7 Jul 2020 18:30:05 +0300
Subject: Add the empty chat list placeholder.

Do not use full height when displaying the chat list.
Remove an unsued chat action.
---
 src/components/chat_list/chat_list.vue             | 27 ++++++++++++++++++++--
 .../post_status_form/post_status_form.js           |  2 +-
 src/i18n/en.json                                   |  3 ++-
 src/modules/chats.js                               |  3 ---
 4 files changed, 28 insertions(+), 7 deletions(-)

(limited to 'src/components/chat_list/chat_list.vue')

diff --git a/src/components/chat_list/chat_list.vue b/src/components/chat_list/chat_list.vue
index e62f58e5..fa138f16 100644
--- a/src/components/chat_list/chat_list.vue
+++ b/src/components/chat_list/chat_list.vue
@@ -15,7 +15,10 @@
       </button>
     </div>
     <div class="panel-body">
-      <div class="timeline">
+      <div
+        v-if="sortedChatList.length > 0"
+        class="timeline"
+      >
         <List :items="sortedChatList">
           <template
             slot="item"
@@ -29,6 +32,12 @@
           </template>
         </List>
       </div>
+      <div
+        v-else
+        class="emtpy-chat-list-alert"
+      >
+        <span>{{ $t('chats.empty_chat_list_placeholder') }}</span>
+      </div>
     </div>
   </div>
 </template>
@@ -39,10 +48,24 @@
 @import '../../_variables.scss';
 
 .chat-list {
-  min-height: calc(100vh - 67px);
+  min-height: 25em;
   margin-bottom: 0;
   border-bottom-left-radius: 0;
   border-bottom-right-radius: 0;
+
+  &::after {
+    border-bottom-left-radius: 0;
+    border-bottom-right-radius: 0;
+  }
+}
+
+.emtpy-chat-list-alert {
+  padding: 3em;
+  font-size: 1.2em;
+  display: flex;
+  justify-content: center;
+  color: $fallback--text;
+  color: var(--faint, $fallback--text);
 }
 
 </style>
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
index 9e7cce0f..b0d94555 100644
--- a/src/components/post_status_form/post_status_form.js
+++ b/src/components/post_status_form/post_status_form.js
@@ -192,7 +192,7 @@ const PostStatusForm = {
         this.newStatus.poll.error
     },
     showPreview () {
-      return !!this.preview || this.previewLoading
+      return !this.disablePreview && (!!this.preview || this.previewLoading)
     },
     emptyStatus () {
       return this.newStatus.status.trim() === '' && this.newStatus.files.length === 0
diff --git a/src/i18n/en.json b/src/i18n/en.json
index c9a34556..5cc75460 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -794,7 +794,8 @@
     "more": "More",
     "delete_confirm": "Do you really want to delete this message?",
     "error_loading_chat": "Something went wrong when loading the chat.",
-    "error_sending_message": "Something went wrong when sending the message."
+    "error_sending_message": "Something went wrong when sending the message.",
+    "empty_chat_list_placeholder": "You don't have any chats yet. Start a new chat!"
   },
   "file_type": {
     "audio": "Audio",
diff --git a/src/modules/chats.js b/src/modules/chats.js
index f868ca0c..228d6256 100644
--- a/src/modules/chats.js
+++ b/src/modules/chats.js
@@ -83,9 +83,6 @@ const chats = {
     resetChatNewMessageCount ({ commit }, value) {
       commit('resetChatNewMessageCount', value)
     },
-    removeFromCurrentChatStatuses ({ commit }, { id }) {
-      commit('removeFromCurrentChatStatuses', id)
-    },
     clearCurrentChat ({ rootState, commit, dispatch }, value) {
       commit('setCurrentChatId', { chatId: undefined })
       commit('setCurrentChatFetcher', { fetcher: undefined })
-- 
cgit v1.2.3-70-g09d2


From b756c83e8d275c0f9d210c15a319d36dca56d3c8 Mon Sep 17 00:00:00 2001
From: Eugenij <eugenijm@protonmail.com>
Date: Wed, 8 Jul 2020 11:13:42 +0000
Subject: Apply suggestion to src/components/chat_list/chat_list.vue

---
 src/components/chat_list/chat_list.vue | 7 -------
 1 file changed, 7 deletions(-)

(limited to 'src/components/chat_list/chat_list.vue')

diff --git a/src/components/chat_list/chat_list.vue b/src/components/chat_list/chat_list.vue
index fa138f16..17e2f795 100644
--- a/src/components/chat_list/chat_list.vue
+++ b/src/components/chat_list/chat_list.vue
@@ -50,13 +50,6 @@
 .chat-list {
   min-height: 25em;
   margin-bottom: 0;
-  border-bottom-left-radius: 0;
-  border-bottom-right-radius: 0;
-
-  &::after {
-    border-bottom-left-radius: 0;
-    border-bottom-right-radius: 0;
-  }
 }
 
 .emtpy-chat-list-alert {
-- 
cgit v1.2.3-70-g09d2

