Make popover delay configurable (#15225)

Make the popover delay in milliseconds configurable.

To open the Activity Center, 30ms delay seems to be more than enough. It's a quick fix because the current 250ms to open the AC gives the wrong impression to users (and confuses even us developers) who think the AC has a performance issue to open.

See issue https://github.com/status-im/status-mobile/pull/15222 for the full discussion.
This commit is contained in:
Icaro Motta 2023-03-02 08:41:18 -03:00 committed by GitHub
parent 4190dfd26b
commit 041622d98b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -4,10 +4,14 @@
(rf/defn show-popover
{:events [:show-popover]}
[_ value]
{:show-popover nil
;;TODO refactor popover just start animation on mount
:dispatch-later [{:ms 250 :dispatch [:show-popover-db value]}]
:dismiss-keyboard nil})
(let [delay-ms (or (:delay-ms value) 250)
value (dissoc value :delay-ms)]
{:show-popover nil
;; We should probably refactor to start the animation on mount, so that the
;; delay can be removed. See comment for more details:
;; https://github.com/status-im/status-mobile/pull/15222#issuecomment-1450162137
:dispatch-later [{:ms delay-ms :dispatch [:show-popover-db value]}]
:dismiss-keyboard nil}))
(rf/defn show-popover-db
{:events [:show-popover-db]}

View File

@ -33,6 +33,7 @@
:dispatch [:show-popover
{:view :activity-center
:style {:margin 0}
:delay-ms 50
:disable-touchable-overlay? true
:blur-view? true
:blur-view-props {:blur-amount 20