Photo selector fix (#14646)

* fix: photo-selector
This commit is contained in:
Omar Basem 2022-12-28 14:40:13 +04:00 committed by GitHub
parent 4ce71e4d29
commit b45261f2e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View File

@ -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}}]}])

View File

@ -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]]))]))