From b88dcf1072a604242a21ca796fc568f3e86188d2 Mon Sep 17 00:00:00 2001 From: BalogunofAfrica <45393944+BalogunofAfrica@users.noreply.github.com> Date: Fri, 6 Oct 2023 12:47:29 +0100 Subject: [PATCH] fix: back button on 1:1 chat (#17544) * fix: back button on 1:1 chat * fix: show close icon only for 1:1 and community chat * fix: use close icon for only 1:1 chat --- src/status_im2/contexts/chat/messages/navigation/view.cljs | 5 +++-- src/status_im2/contexts/chat/messages/view.cljs | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/status_im2/contexts/chat/messages/navigation/view.cljs b/src/status_im2/contexts/chat/messages/navigation/view.cljs index cd1b311746..25f046909b 100644 --- a/src/status_im2/contexts/chat/messages/navigation/view.cljs +++ b/src/status_im2/contexts/chat/messages/navigation/view.cljs @@ -15,7 +15,8 @@ [utils.re-frame :as rf])) (defn f-view - [{:keys [theme scroll-y chat chat-screen-loaded? all-loaded? display-name online? photo-path]}] + [{:keys [theme scroll-y chat chat-screen-loaded? all-loaded? display-name online? photo-path + back-icon]}] (let [{:keys [group-chat chat-id]} chat opacity-animation (reanimated/interpolate scroll-y [style/navigation-bar-height @@ -63,7 +64,7 @@ (when config/shell-navigation-disabled? (rf/dispatch [:chat/close])) (rf/dispatch [:navigate-back]))} - :i/arrow-left] + back-icon] [reanimated/view {:style (style/animated-header all-loaded? translate-animation title-opacity-animation)} [rn/view {:style style/header-content-container} diff --git a/src/status_im2/contexts/chat/messages/view.cljs b/src/status_im2/contexts/chat/messages/view.cljs index bae01a3542..d03b8594ef 100644 --- a/src/status_im2/contexts/chat/messages/view.cljs +++ b/src/status_im2/contexts/chat/messages/view.cljs @@ -39,7 +39,10 @@ (str (when emoji (str emoji " ")) "# " chat-name) :else (str emoji chat-name)) online? (rf/sub [:visibility-status-updates/online? chat-id]) - photo-path (rf/sub [:chats/photo-path chat-id])] + photo-path (rf/sub [:chats/photo-path chat-id]) + back-icon (if (= chat-type constants/one-to-one-chat-type) + :i/close + :i/arrow-left)] (rn/use-effect (fn [] ;; If keyboard is shown then adjust `scroll-y` @@ -71,6 +74,7 @@ [messages.navigation/navigation-view {:scroll-y scroll-y + :back-icon back-icon :chat chat :chat-screen-loaded? chat-screen-loaded? :all-loaded? all-loaded?