Skip to content

Commit 443066f

Browse files
committed
Fix topbar back-button flickering
1 parent 8a8b885 commit 443066f

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

src/status_im/ui/components/chat_icon/screen.cljs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
[status-im.ui.screens.chat.photos :as photos]
99
[status-im.utils.platform :as platform]))
1010

11+
;;TODO REWORK THIS NAMESPACE
12+
1113
(defn default-chat-icon [name styles]
1214
(when-not (string/blank? name)
1315
[react/view (:default-chat-icon styles)

src/status_im/ui/components/topbar.cljs

+3-2
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@
3333
[react/text {:style {:color colors/blue}}
3434
(utils.label/stringify label)])]]))
3535

36+
(def default-title-padding 16)
3637
;; TODO(Ferossgp): Tobbar should handle safe area
37-
(defn topbar [_]
38-
(let [title-padding (reagent/atom 16)]
38+
(defn topbar [{:keys [initial-title-padding] :as opts}]
39+
(let [title-padding (reagent/atom (or initial-title-padding default-title-padding))]
3940
(fn [& [{:keys [title navigation accessories show-border? modal? content]}]]
4041
(let [navigation (or navigation (default-navigation modal?))]
4142
[react/view (cond-> {:height 56 :align-items :center :flex-direction :row}

src/status_im/ui/screens/chat/views.cljs

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
[topbar/topbar
2727
{:content [toolbar-content/toolbar-content-view]
2828
:show-border? true
29+
:initial-title-padding 56
2930
:navigation {:icon :main-icons/back
3031
:accessibility-label :back-button
3132
:handler

src/status_im/ui/screens/home/views/inner_item.cljs

+3
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@
116116
:else nil)
117117
:title (if group-chat
118118
(utils/truncate-str chat-name 30)
119+
;; This looks a bit odd, but I would like only to subscribe
120+
;; if it's a one-to-one. If wrapped in a component styling
121+
;; won't be applied correctly.
119122
@(re-frame/subscribe [:contacts/contact-name-by-identity chat-id]))
120123
:title-accessibility-label :chat-name-text
121124
:title-row-accessory [message-timestamp (if (pos? (:whisper-timestamp last-message))

0 commit comments

Comments
 (0)