2019-07-08 11:38:47 +00:00
|
|
|
(ns status-im.popover.core
|
2019-09-15 15:20:10 +00:00
|
|
|
(:require [status-im.utils.fx :as fx]))
|
2019-07-08 11:38:47 +00:00
|
|
|
|
|
|
|
(fx/defn show-popover
|
|
|
|
{:events [:show-popover]}
|
2021-05-24 14:25:05 +00:00
|
|
|
[_ value]
|
|
|
|
{:rnn-show-popover nil
|
|
|
|
;;TODO refactor popover just start animation on mount
|
|
|
|
:dispatch-later [{:ms 250 :dispatch [:show-popover-db value]}]
|
2019-07-08 11:38:47 +00:00
|
|
|
:dismiss-keyboard nil})
|
|
|
|
|
2021-05-24 14:25:05 +00:00
|
|
|
(fx/defn show-popover-db
|
|
|
|
{:events [:show-popover-db]}
|
|
|
|
[{:keys [db]} value]
|
|
|
|
{:db (assoc db :popover/popover value)})
|
|
|
|
|
2019-07-08 11:38:47 +00:00
|
|
|
(fx/defn hide-popover
|
|
|
|
{:events [:hide-popover]}
|
|
|
|
[{:keys [db]}]
|
2021-05-24 14:25:05 +00:00
|
|
|
{:db (dissoc db :popover/popover)
|
|
|
|
:rnn-hide-popover nil})
|