From b45261f2e56a9fc88f007446d8f8f67f18916f34 Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Wed, 28 Dec 2022 14:40:13 +0400 Subject: [PATCH] Photo selector fix (#14646) * fix: photo-selector --- src/status_im/ui2/screens/chat/composer/images/view.cljs | 8 ++++++-- src/status_im/ui2/screens/chat/photo_selector/view.cljs | 8 +++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/status_im/ui2/screens/chat/composer/images/view.cljs b/src/status_im/ui2/screens/chat/composer/images/view.cljs index f5bb89d3d6..a3e8bb89f2 100644 --- a/src/status_im/ui2/screens/chat/composer/images/view.cljs +++ b/src/status_im/ui2/screens/chat/composer/images/view.cljs @@ -13,7 +13,11 @@ :style style/small-image}] [rn/touchable-opacity {:on-press (fn [] (rf/dispatch [:chat.ui/image-unselected (first item)])) - :style style/remove-photo-container} + :style style/remove-photo-container + :hit-slop {:right 5 + :left 5 + :top 10 + :bottom 10}} [quo2/icon :i/close {:color colors/white :size 12}]]]) (defn images-list @@ -24,5 +28,5 @@ :data images :horizontal true :style {:bottom 50 :position :absolute :z-index 5 :elevation 5} - :content-container-style {:padding-horizontal 20 :margin-top 12} + :content-container-style {:padding-horizontal 20 :margin-top 12 :padding-top 8} :separator [rn/view {:style {:width 12}}]}]) diff --git a/src/status_im/ui2/screens/chat/photo_selector/view.cljs b/src/status_im/ui2/screens/chat/photo_selector/view.cljs index d11b5136e5..4a9eb1a6d3 100644 --- a/src/status_im/ui2/screens/chat/photo_selector/view.cljs +++ b/src/status_im/ui2/screens/chat/photo_selector/view.cljs @@ -14,11 +14,11 @@ (def selected (reagent/atom [])) (defn bottom-gradient - [] + [chat-id selected-images] [:f> (fn [] (let [safe-area (safe-area/use-safe-area)] - (when (pos? (count @selected)) + (when (or (pos? (count @selected)) selected-images) [linear-gradient/linear-gradient {:colors [:black :transparent] :start {:x 0 :y 1} @@ -28,6 +28,7 @@ {:style {:align-self :stretch :margin-horizontal 20} :on-press #(do + (rf/dispatch [:chat.ui/clear-sending-images chat-id]) (doseq [item @selected] (rf/dispatch [:chat.ui/camera-roll-pick item])) (reset! selected []) @@ -97,4 +98,5 @@ :style {:border-radius 20} :on-end-reached #(rf/dispatch [:camera-roll/on-end-reached end-cursor loading? has-next-page?])}] - [bottom-gradient]]))])) + [bottom-gradient chat-id selected-images]]))])) +