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:
parent
4190dfd26b
commit
041622d98b
|
@ -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]}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue