diff --git a/src/status_im/contexts/chat/home/new_chat/view.cljs b/src/status_im/contexts/chat/home/new_chat/view.cljs index 1ac18f50ab68..e58e33c4af31 100644 --- a/src/status_im/contexts/chat/home/new_chat/view.cljs +++ b/src/status_im/contexts/chat/home/new_chat/view.cljs @@ -64,9 +64,10 @@ :on-check on-toggle}} item]))) -(defn- view-internal - [{:keys [scroll-enabled? on-scroll close theme]}] - (let [contacts (rf/sub [:contacts/sorted-and-grouped-by-first-letter]) +(defn view + [] + (let [theme (quo.theme/use-theme-value) + contacts (rf/sub [:contacts/sorted-and-grouped-by-first-letter]) selected-contacts-count (rf/sub [:selected-contacts-count]) selected-contacts (rf/sub [:group/selected-contacts]) one-contact-selected? (= selected-contacts-count 1) @@ -74,19 +75,22 @@ {:keys [primary-name public-key]} (when one-contact-selected? (rf/sub [:contacts/contact-by-identity (first selected-contacts)]))] - [rn/view {:flex 1} + [:<> [rn/view {:padding-horizontal 20} [quo/button {:type :grey :size 32 :icon-only? true - :on-press close} :i/close] + :on-press #(rf/dispatch [:navigate-back])} + :i/close] [rn/view {:style style/contact-selection-heading} [quo/text {:weight :semi-bold :size :heading-1 :style {:color (colors/theme-colors colors/neutral-100 colors/white theme)}} - (i18n/label :t/new-chat)] + (if (and contacts-selected? (not one-contact-selected?)) + (i18n/label :t/new-group-chat) + (i18n/label :t/new-chat))] (when (seq contacts) [quo/text {:size :paragraph-2 @@ -104,9 +108,7 @@ :sections (rf/sub [:contacts/filtered-active-sections]) :render-section-header-fn contact-list/contacts-section-header :content-container-style {:padding-bottom 70} - :render-fn contact-item-render - :scroll-enabled @scroll-enabled? - :on-scroll on-scroll}]) + :render-fn contact-item-render}]) (when contacts-selected? [quo/button {:type :primary @@ -115,9 +117,8 @@ :on-press (fn [] (if one-contact-selected? (rf/dispatch [:chat.ui/start-chat public-key]) - (rf/dispatch [:navigate-to :new-group])))} + (rf/dispatch [:navigate-to-within-stack + [:new-group :start-a-new-chat]])))} (if one-contact-selected? (i18n/label :t/chat-with {:selected-user primary-name}) (i18n/label :t/setup-group-chat))])])) - -(def view (quo.theme/with-theme view-internal)) diff --git a/src/status_im/navigation/screens.cljs b/src/status_im/navigation/screens.cljs index a58fe69b0490..7262dab30607 100644 --- a/src/status_im/navigation/screens.cljs +++ b/src/status_im/navigation/screens.cljs @@ -107,7 +107,8 @@ :component chat/chat} {:name :start-a-new-chat - :options {:sheet? true} + :options {:insets {:top? true} + :modalPresentationStyle :overCurrentContext} :component new-chat/view} {:name :group-add-manage-members