mirror of
https://github.com/status-im/status-mobile.git
synced 2025-02-28 08:10:42 +00:00
[fix 7630] remove unread messages badge in chat toolbar
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
parent
6ff36b5dd5
commit
3584b31747
@ -63,9 +63,8 @@
|
|||||||
{:width 24
|
{:width 24
|
||||||
:height 24})
|
:height 24})
|
||||||
|
|
||||||
(defn nav-item-button [unread-messages?]
|
(def nav-item-button
|
||||||
{:margin-left 13
|
{:margin-horizontal 13})
|
||||||
:margin-right (if unread-messages? -5 13)})
|
|
||||||
|
|
||||||
(defstyle item
|
(defstyle item
|
||||||
{:ios {:padding-horizontal 12
|
{:ios {:padding-horizontal 12
|
||||||
@ -91,9 +90,6 @@
|
|||||||
;;e.g. see Discover > Popular hashtags on iPhone 5s
|
;;e.g. see Discover > Popular hashtags on iPhone 5s
|
||||||
(def ios-content-item {:position :absolute :right 40 :left 40})
|
(def ios-content-item {:position :absolute :right 40 :left 40})
|
||||||
|
|
||||||
(def counter-container
|
|
||||||
{:top 3})
|
|
||||||
|
|
||||||
(def icon-add
|
(def icon-add
|
||||||
{:width 24
|
{:width 24
|
||||||
:height 24
|
:height 24
|
||||||
|
@ -24,20 +24,9 @@
|
|||||||
item]])
|
item]])
|
||||||
|
|
||||||
(defn nav-button
|
(defn nav-button
|
||||||
[{:keys [icon icon-opts unread-messages?] :as props}]
|
[{:keys [icon icon-opts] :as props}]
|
||||||
[nav-item (merge {:style (styles/nav-item-button unread-messages?)} props)
|
[nav-item (merge {:style styles/nav-item-button} props)
|
||||||
[vector-icons/icon icon (if unread-messages?
|
[vector-icons/icon icon icon-opts]])
|
||||||
(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]])])))
|
|
||||||
|
|
||||||
(defn nav-text
|
(defn nav-text
|
||||||
([text] (nav-text nil text))
|
([text] (nav-text nil text))
|
||||||
@ -52,15 +41,10 @@
|
|||||||
([props text]
|
([props text]
|
||||||
(nav-text (merge props styles/item-text-white-background) 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-back [nav-button actions/default-back])
|
||||||
(def default-nav-close [nav-button actions/default-close])
|
(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
|
(defn default-done
|
||||||
"Renders a touchable icon on Android or a label or iOS."
|
"Renders a touchable icon on Android or a label or iOS."
|
||||||
[{:keys [icon] :as props}]
|
[{:keys [icon] :as props}]
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
(defn toolbar [error? url url-original browser browser-id url-editing?]
|
(defn toolbar [error? url url-original browser browser-id url-editing?]
|
||||||
[toolbar.view/toolbar {}
|
[toolbar.view/toolbar {}
|
||||||
[toolbar.view/nav-button-with-count
|
[toolbar.view/nav-button
|
||||||
(actions/close (fn []
|
(actions/close (fn []
|
||||||
(re-frame/dispatch [:navigate-to :home])
|
(re-frame/dispatch [:navigate-to :home])
|
||||||
(when error?
|
(when error?
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
(if modal?
|
(if modal?
|
||||||
[toolbar/nav-button
|
[toolbar/nav-button
|
||||||
(toolbar.actions/close toolbar.actions/default-handler)]
|
(toolbar.actions/close toolbar.actions/default-handler)]
|
||||||
(toolbar/nav-back-count {:home? true}))
|
toolbar/nav-back-home)
|
||||||
[toolbar-content/toolbar-content-view]
|
[toolbar-content/toolbar-content-view]
|
||||||
(when-not modal?
|
(when-not modal?
|
||||||
[toolbar/actions [{:icon :main-icons/more
|
[toolbar/actions [{:icon :main-icons/more
|
||||||
|
Loading…
x
Reference in New Issue
Block a user