Fix topbar back-button flickering

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
This commit is contained in:
Andrea Maria Piana 2020-05-28 09:37:21 +02:00
parent f69ae44d50
commit 9d7691312b
No known key found for this signature in database
GPG Key ID: AA6CCA6DE0E06424
6 changed files with 11 additions and 3 deletions

View File

@ -8,6 +8,8 @@
[status-im.ui.screens.chat.photos :as photos] [status-im.ui.screens.chat.photos :as photos]
[status-im.utils.platform :as platform])) [status-im.utils.platform :as platform]))
;;TODO REWORK THIS NAMESPACE
(defn default-chat-icon [name styles] (defn default-chat-icon [name styles]
(when-not (string/blank? name) (when-not (string/blank? name)
[react/view (:default-chat-icon styles) [react/view (:default-chat-icon styles)

View File

@ -33,9 +33,10 @@
[react/text {:style {:color colors/blue}} [react/text {:style {:color colors/blue}}
(utils.label/stringify label)])]])) (utils.label/stringify label)])]]))
(def default-title-padding 16)
;; TODO(Ferossgp): Tobbar should handle safe area ;; TODO(Ferossgp): Tobbar should handle safe area
(defn topbar [_] (defn topbar [{:keys [initial-title-padding]}]
(let [title-padding (reagent/atom 16)] (let [title-padding (reagent/atom (or initial-title-padding default-title-padding))]
(fn [& [{:keys [title navigation accessories show-border? modal? content]}]] (fn [& [{:keys [title navigation accessories show-border? modal? content]}]]
(let [navigation (or navigation (default-navigation modal?))] (let [navigation (or navigation (default-navigation modal?))]
[react/view (cond-> {:height 56 :align-items :center :flex-direction :row} [react/view (cond-> {:height 56 :align-items :center :flex-direction :row}

View File

@ -38,7 +38,7 @@
appender]) appender])
(defview quoted-message (defview quoted-message
[_ {:keys [from text]} outgoing current-public-key public?] [_ {:keys [from text image]} outgoing current-public-key public?]
(letsubs [contact-name [:contacts/contact-name-by-identity from]] (letsubs [contact-name [:contacts/contact-name-by-identity from]]
[react/view {:style (style/quoted-message-container outgoing)} [react/view {:style (style/quoted-message-container outgoing)}
[react/view {:style style/quoted-message-author-container} [react/view {:style style/quoted-message-author-container}

View File

@ -6,6 +6,7 @@
[status-im.utils.universal-links.core :as universal-links] [status-im.utils.universal-links.core :as universal-links]
[status-im.ui.components.chat-icon.screen :as chat-icon] [status-im.ui.components.chat-icon.screen :as chat-icon]
[status-im.ui.components.colors :as colors] [status-im.ui.components.colors :as colors]
[status-im.multiaccounts.core :as multiaccounts]
[status-im.utils.platform :as platform] [status-im.utils.platform :as platform]
[status-im.ui.screens.chat.styles.message.sheets :as sheets.styles] [status-im.ui.screens.chat.styles.message.sheets :as sheets.styles]
[status-im.ui.components.list-item.views :as list-item])) [status-im.ui.components.list-item.views :as list-item]))

View File

@ -27,6 +27,7 @@
[topbar/topbar [topbar/topbar
{:content [toolbar-content/toolbar-content-view] {:content [toolbar-content/toolbar-content-view]
:show-border? true :show-border? true
:initial-title-padding 56
:navigation {:icon :main-icons/back :navigation {:icon :main-icons/back
:accessibility-label :back-button :accessibility-label :back-button
:handler :handler

View File

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