Add dispatch-and-chill to navigation events (#18372)

This commit is contained in:
Parvesh Monu 2024-01-08 19:59:01 +05:30 committed by GitHub
parent 0208224741
commit fb58d7205e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 9 deletions

View File

@ -1,6 +1,7 @@
(ns status-im.contexts.chat.actions.view
(:require
[quo.core :as quo]
[utils.debounce :as debounce]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
@ -22,10 +23,14 @@
:label (i18n/label :t/new-chat)
:on-press (fn []
(rf/dispatch [:group-chat/clear-contacts])
(rf/dispatch [:open-modal :start-a-new-chat]))}
(debounce/dispatch-and-chill
[:open-modal :start-a-new-chat]
1000))}
{:icon :i/add-user
:accessibility-label :add-a-contact
:label (i18n/label :t/add-a-contact)
:sub-label (i18n/label :t/enter-a-chat-key)
:add-divider? true
:on-press #(rf/dispatch [:open-modal :new-contact])}]]])
:on-press #(debounce/dispatch-and-chill
[:open-modal :new-contact]
1000)}]]])

View File

@ -8,8 +8,7 @@
[status-im.contexts.onboarding.intro.style :as style]
[status-im.contexts.syncing.scan-sync-code.view :as scan-sync-code]
[utils.debounce :as debounce]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
[utils.i18n :as i18n]))
(defn view
[]
@ -29,7 +28,9 @@
:bottom-card {:on-press (fn []
(when-let [blur-show-fn @overlay/blur-show-fn-atom]
(blur-show-fn))
(rf/dispatch [:open-modal :new-to-status]))
(debounce/dispatch-and-chill
[:open-modal :new-to-status]
1000))
:heading (i18n/label :t/new-to-status)
:accessibility-label :new-to-status-button}}
[quo/text
@ -41,7 +42,9 @@
{:style style/plain-text}
(i18n/label :t/by-continuing-you-accept)]
[quo/text
{:on-press #(rf/dispatch [:open-modal :privacy-policy])
{:on-press #(debounce/dispatch-and-chill
[:open-modal :privacy-policy]
1000)
:style style/highlighted-text}
(i18n/label :t/terms-of-service)]]]
[overlay/view]])

View File

@ -8,6 +8,7 @@
[status-im.common.resources :as resources]
[status-im.config :as config]
[status-im.contexts.onboarding.new-to-status.style :as style]
[utils.debounce :as debounce]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
@ -30,7 +31,9 @@
(* 2 56) ;; two other list items
(* 2 16) ;; spacing between items
220) ;; extra spacing (top bar)
:on-press #(rf/dispatch [:onboarding/navigate-to-create-profile])}]
:on-press #(debounce/dispatch-and-chill
[:onboarding/navigate-to-create-profile]
1000)}]
[rn/view {:style style/subtitle-container}
[quo/text
{:style style/subtitle

View File

@ -13,6 +13,7 @@
[status-im.contexts.onboarding.common.background.view :as background]
[status-im.contexts.profile.profiles.style :as style]
[taoensso.timbre :as log]
[utils.debounce :as debounce]
[utils.i18n :as i18n]
[utils.re-frame :as rf]
[utils.transforms :as transforms]))
@ -49,11 +50,15 @@
:on-press (fn []
(when @push-animation-fn-atom
(@push-animation-fn-atom))
(rf/dispatch [:open-modal :new-to-status]))
(debounce/dispatch-and-chill
[:open-modal :new-to-status]
1000))
:accessibility-label :create-new-profile}
{:icon :i/multi-profile
:label (i18n/label :t/add-existing-status-profile)
:on-press #(rf/dispatch [:open-modal :sign-in])
:on-press #(debounce/dispatch-and-chill
[:open-modal :sign-in]
1000)
:accessibility-label :multi-profile}]]])
(defn show-new-account-options