diff --git a/src/status_im/ui/components/toolbar/styles.cljs b/src/status_im/ui/components/toolbar/styles.cljs index a53e713341..ec6d5377f0 100644 --- a/src/status_im/ui/components/toolbar/styles.cljs +++ b/src/status_im/ui/components/toolbar/styles.cljs @@ -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 diff --git a/src/status_im/ui/components/toolbar/view.cljs b/src/status_im/ui/components/toolbar/view.cljs index 596d20ba12..baef7e2335 100644 --- a/src/status_im/ui/components/toolbar/view.cljs +++ b/src/status_im/ui/components/toolbar/view.cljs @@ -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}] diff --git a/src/status_im/ui/screens/browser/views.cljs b/src/status_im/ui/screens/browser/views.cljs index 29d9b93b78..8f3ecb8472 100644 --- a/src/status_im/ui/screens/browser/views.cljs +++ b/src/status_im/ui/screens/browser/views.cljs @@ -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? diff --git a/src/status_im/ui/screens/chat/views.cljs b/src/status_im/ui/screens/chat/views.cljs index 945e3cbaa5..f42cb77dce 100644 --- a/src/status_im/ui/screens/chat/views.cljs +++ b/src/status_im/ui/screens/chat/views.cljs @@ -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