[fix 3346] remove unknown status subtitle from 1-1 chat

Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
This commit is contained in:
Eric Dvorsak 2018-05-10 16:45:40 +02:00 committed by Julien Eluard
parent 01a4869397
commit e5aae3fafb
No known key found for this signature in database
GPG Key ID: 6FD7DB5437FCBEF6
2 changed files with 34 additions and 38 deletions

View File

@ -46,13 +46,9 @@
{:flex-direction :row {:flex-direction :row
:flex 1}) :flex 1})
(defnstyle chat-name-view [show-actions] (defnstyle chat-name-view [has-subtitle?]
{:flex 1 {:flex 1
:justify-content :center :margin-top (if has-subtitle? 0 6)})
:android {:align-items :flex-start
:margin-left (if show-actions 66 18)
:padding-bottom 6}
:ios {:align-items :center}})
(def chat-name-text (def chat-name-text
{:color component.styles/color-gray6 {:color component.styles/color-gray6

View File

@ -37,14 +37,13 @@
(str (i18n/label :t/sync-in-progress) " " percentage "% " currentBlock))) (str (i18n/label :t/sync-in-progress) " " percentage "% " currentBlock)))
(defview last-activity [{:keys [online-text sync-state accessibility-label]}] (defview last-activity [{:keys [sync-state accessibility-label]}]
[state [:get :sync-data]] (letsubs [state [:get :sync-data]]
[react/text {:style st/last-activity-text [react/text {:style st/last-activity-text
:accessibility-label accessibility-label} :accessibility-label accessibility-label}
(case sync-state (case sync-state
:in-progress (in-progress-text state) :in-progress (in-progress-text state)
:synced (i18n/label :t/sync-synced) :synced (i18n/label :t/sync-synced))]))
online-text)])
(defn- group-last-activity [{:keys [contacts sync-state public?]}] (defn- group-last-activity [{:keys [contacts sync-state public?]}]
(if (or (= sync-state :in-progress) (if (or (= sync-state :in-progress)
@ -67,11 +66,12 @@
accounts [:get-accounts] accounts [:get-accounts]
contact [:get-current-chat-contact] contact [:get-current-chat-contact]
sync-state [:sync-state]] sync-state [:sync-state]]
(let [has-subtitle? (or group-chat (not= :done sync-state))]
[react/view {:style st/toolbar-container} [react/view {:style st/toolbar-container}
(when-not group-chat
[react/view (when-not group-chat [photos/member-photo chat-id])] [react/view {:margin-right 5}
[react/view (st/chat-name-view (or (empty? accounts) [photos/member-photo chat-id]])
show-actions?)) [react/view (st/chat-name-view has-subtitle?)
(let [chat-name (if (string/blank? name) (let [chat-name (if (string/blank? name)
(generate-gfy chat-id) (generate-gfy chat-id)
(or (i18n/get-contact-translated chat-id :name name) (or (i18n/get-contact-translated chat-id :name name)
@ -87,6 +87,6 @@
[group-last-activity {:contacts contacts [group-last-activity {:contacts contacts
:public? public? :public? public?
:sync-state sync-state}] :sync-state sync-state}]
[last-activity {:online-text (online-text contact chat-id) (when has-subtitle?
:sync-state sync-state [last-activity {:sync-state sync-state
:accessibility-label :last-seen-text}])]])) :accessibility-label :last-seen-text}]))]])))