ignore back button on signing panel

Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
Andrey Shovkoplyas 2020-03-31 11:35:28 +02:00
parent c5ec451692
commit fc1bc48fdc
No known key found for this signature in database
GPG Key ID: EAAB7C8622D860A4
1 changed files with 17 additions and 1 deletions

View File

@ -3,10 +3,25 @@
(:require [status-im.ui.components.react :as react] (:require [status-im.ui.components.react :as react]
[status-im.ui.components.animation :as anim] [status-im.ui.components.animation :as anim]
[reagent.core :as reagent] [reagent.core :as reagent]
[status-im.ui.components.colors :as colors])) [status-im.ui.components.colors :as colors]
[status-im.react-native.js-dependencies :as js-dependencies]))
(def back-listener (atom nil))
(defn remove-back-listener []
(when @back-listener
(.remove @back-listener)
(reset! back-listener nil)))
(defn add-back-listener []
(remove-back-listener)
(reset! back-listener (.addEventListener js-dependencies/back-handler
"hardwareBackPress"
(fn [] true))))
(defn hide-panel-anim (defn hide-panel-anim
[bottom-anim-value alpha-value window-height] [bottom-anim-value alpha-value window-height]
(remove-back-listener)
(react/dismiss-keyboard!) (react/dismiss-keyboard!)
(anim/start (anim/start
(anim/parallel (anim/parallel
@ -18,6 +33,7 @@
(defn show-panel-anim (defn show-panel-anim
[bottom-anim-value alpha-value] [bottom-anim-value alpha-value]
(add-back-listener)
(anim/start (anim/start
(anim/parallel (anim/parallel
[(anim/spring bottom-anim-value {:toValue 40 [(anim/spring bottom-anim-value {:toValue 40