[fix 7630] remove unread messages badge in chat toolbar

Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
yenda 2019-03-04 16:21:04 +01:00 committed by Pedro Pombeiro
parent 6ff36b5dd5
commit 3584b31747
No known key found for this signature in database
GPG Key ID: C4A24185B2AA48A1
4 changed files with 8 additions and 28 deletions

View File

@ -63,9 +63,8 @@
{:width 24
:height 24})
(defn nav-item-button [unread-messages?]
{:margin-left 13
:margin-right (if unread-messages? -5 13)})
(def nav-item-button
{:margin-horizontal 13})
(defstyle item
{:ios {:padding-horizontal 12
@ -91,9 +90,6 @@
;;e.g. see Discover > Popular hashtags on iPhone 5s
(def ios-content-item {:position :absolute :right 40 :left 40})
(def counter-container
{:top 3})
(def icon-add
{:width 24
:height 24

View File

@ -24,20 +24,9 @@
item]])
(defn nav-button
[{:keys [icon icon-opts unread-messages?] :as props}]
[nav-item (merge {:style (styles/nav-item-button unread-messages?)} props)
[vector-icons/icon icon (if unread-messages?
(assoc icon-opts :color :active)
icon-opts)]])
(defview nav-button-with-count [props]
(letsubs [unread-messages-number [:chats/unread-messages-number]]
(let [unread-messages? (pos? unread-messages-number)]
[react/view {:flex-direction :row}
[nav-button (assoc props :unread-messages? unread-messages?)]
(when unread-messages?
[nav-item (merge {:style styles/counter-container} props)
[components.common/counter unread-messages-number]])])))
[{:keys [icon icon-opts] :as props}]
[nav-item (merge {:style styles/nav-item-button} props)
[vector-icons/icon icon icon-opts]])
(defn nav-text
([text] (nav-text nil text))
@ -52,15 +41,10 @@
([props text]
(nav-text (merge props styles/item-text-white-background) text)))
(def nav-back-home [nav-button actions/home-back])
(def default-nav-back [nav-button actions/default-back])
(def default-nav-close [nav-button actions/default-close])
(defn nav-back-count
([]
[nav-button-with-count actions/default-back])
([{:keys [home?]}]
[nav-button-with-count (if home? actions/home-back actions/default-back)]))
(defn default-done
"Renders a touchable icon on Android or a label or iOS."
[{:keys [icon] :as props}]

View File

@ -57,7 +57,7 @@
(defn toolbar [error? url url-original browser browser-id url-editing?]
[toolbar.view/toolbar {}
[toolbar.view/nav-button-with-count
[toolbar.view/nav-button
(actions/close (fn []
(re-frame/dispatch [:navigate-to :home])
(when error?

View File

@ -59,7 +59,7 @@
(if modal?
[toolbar/nav-button
(toolbar.actions/close toolbar.actions/default-handler)]
(toolbar/nav-back-count {:home? true}))
toolbar/nav-back-home)
[toolbar-content/toolbar-content-view]
(when-not modal?
[toolbar/actions [{:icon :main-icons/more