fix: make identifier carousel swipe-able (#18515)

This commit is contained in:
BalogunofAfrica 2024-01-23 12:25:03 +01:00 committed by GitHub
parent fd50e4281c
commit cb586c8676
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 4 deletions

View File

@ -30,7 +30,7 @@
:status-indicator? false :status-indicator? false
:customization-color customization-color}]] :customization-color customization-color}]]
[rn/view [rn/view
{:style style/card-view} {:pointer-events :none :style style/card-view}
[reanimated/view [reanimated/view
{:style (style/card-container container-background)} {:style (style/card-container container-background)}
[rn/view {:style style/card-header} [rn/view {:style style/card-header}

View File

@ -15,3 +15,8 @@
{:justify-self :flex-end {:justify-self :flex-end
:margin-bottom 46 :margin-bottom 46
:margin-horizontal 20}) :margin-horizontal 20})
(defn carousel-background
[height width]
{:height height
:width width})

View File

@ -26,6 +26,8 @@
paused? (atom nil) paused? (atom nil)
is-dragging? (atom nil) is-dragging? (atom nil)
drag-amount (atom nil) drag-amount (atom nil)
window-width (rf/sub [:dimensions/window-width])
window-height (rf/sub [:dimensions/window-height])
{:keys [emoji-hash display-name compressed-key {:keys [emoji-hash display-name compressed-key
public-key]} (rf/sub [:profile/profile]) public-key]} (rf/sub [:profile/profile])
{:keys [color]} (rf/sub [:onboarding/profile]) {:keys [color]} (rf/sub [:onboarding/profile])
@ -42,11 +44,16 @@
{:animate? true {:animate? true
:progress progress :progress progress
:paused? paused? :paused? paused?
:gesture :tappable :gesture :swipeable
:is-dragging? is-dragging? :is-dragging? is-dragging?
:drag-amount drag-amount :drag-amount drag-amount
:header-text header-text}] :header-text header-text
[rn/view {:style style/content-container} :background [rn/view
{:style (style/carousel-background window-height
(* (count header-text) window-width))}]}]
[rn/view
{:style style/content-container
:pointer-events :box-none}
[profile-card/profile-card [profile-card/profile-card
{:profile-picture photo-path {:profile-picture photo-path
:name display-name :name display-name