Compare commits

...
Author SHA1 Message Date
Lungu Cristian 6215acdd23 feat: dismiss handler for modals 2024-07-22 13:10:51 +03:00
3 changed files with 30 additions and 21 deletions
@@ -48,7 +48,7 @@
set-animating-true #(reset! animating? true)
set-animating-false (fn [ms]
(js/setTimeout #(reset! animating? false) ms))]
(fn [{:keys [content skip-background?]}]
(fn [{:keys [content skip-background? on-dismiss]}]
(let [theme (quo.theme/use-theme)
{:keys [top] :as insets} (safe-area/get-insets)
alert-banners-top-margin (rf/sub [:alert-banners/top-margin])
@@ -63,6 +63,10 @@
(reanimated/animate opacity 0 300)
(rf/dispatch [:navigate-back])
true)
dismiss (fn []
(when on-dismiss
(on-dismiss))
(close))
reset-open-sheet (fn []
(reanimated/animate translate-y 0 300)
(reanimated/animate opacity 1 300)
@@ -83,7 +87,7 @@
:opacity opacity
:scroll-enabled? scroll-enabled?
:curr-scroll curr-scroll
:close close
:close dismiss
:reset-open-sheet reset-open-sheet
:set-animating-true set-animating-true})}
[reanimated/view {:style (style/main-view translate-y theme)}
+7 -3
View File
@@ -2,6 +2,7 @@
(:require
[legacy.status-im.ui.screens.screens :as old-screens]
[quo.foundations.colors :as colors]
[re-frame.core :as rf]
[status-im.common.emoji-picker.view :as emoji-picker]
[status-im.common.enter-seed-phrase.view :as enter-seed-phrase]
[status-im.common.lightbox.view :as lightbox]
@@ -539,15 +540,18 @@
;; Wallet Connect
{:name :screen/wallet-connect.sign-message
:options {:sheet? true}
:options {:sheet? true
:on-dismiss-sheet #(rf/dispatch [:wallet-connect/reject-session-request])}
:component wallet-connect-sign-message/view}
{:name :screen/wallet-connect.sign-transaction
:options {:sheet? true}
:options {:sheet? true
:on-dismiss-sheet #(rf/dispatch [:wallet-connect/reject-session-request])}
:component wallet-connect-sign-transaction/view}
{:name :screen/wallet-connect.send-transaction
:options {:sheet? true}
:options {:sheet? true
:on-dismiss-sheet #(rf/dispatch [:wallet-connect/reject-session-request])}
:component wallet-connect-send-transaction/view}
{:name :screen/wallet.connected-dapps
+17 -16
View File
@@ -57,22 +57,22 @@
[screen-key]
(reagent.core/reactify-component
(fn []
(let [screen-details (get (if js/goog.DEBUG
(get-screens)
screens)
(keyword screen-key))
qualified-screen-details (get (if js/goog.DEBUG
(get-screens)
screens)
(keyword "screen" screen-key))
{:keys [component options]} (or qualified-screen-details screen-details)
(let [screen-details (get (if js/goog.DEBUG
(get-screens)
screens)
(keyword screen-key))
qualified-screen-details (get (if js/goog.DEBUG
(get-screens)
screens)
(keyword "screen" screen-key))
{:keys [component options]} (or qualified-screen-details screen-details)
{:keys [insets sheet? theme
skip-background?]} options
alert-banners-top-margin (rf/sub [:alert-banners/top-margin])
background-color (or (get-in options [:layout :backgroundColor])
(when sheet? :transparent))
app-theme (rf/sub [:theme])
theme (or theme app-theme)]
skip-background? on-dismiss-sheet]} options
alert-banners-top-margin (rf/sub [:alert-banners/top-margin])
background-color (or (get-in options [:layout :backgroundColor])
(when sheet? :transparent))
app-theme (rf/sub [:theme])
theme (or theme app-theme)]
^{:key (str "root" screen-key @reloader/cnt)}
[quo.theme/provider theme
[rn/view
@@ -83,7 +83,8 @@
:alert-banners-top-margin alert-banners-top-margin))}
[inactive]
(if sheet?
[bottom-sheet-screen/view {:content component :skip-background? skip-background?}]
[bottom-sheet-screen/view
{:content component :skip-background? skip-background? :on-dismiss on-dismiss-sheet}]
[component])]
(when js/goog.DEBUG
[:<>