mirror of
https://github.com/status-im/status-react.git
synced 2025-01-09 10:42:53 +00:00
Loading spinner for sign up confirmation view
This commit is contained in:
parent
c95ecf5363
commit
81b1d6440a
@ -10,12 +10,14 @@
|
||||
[messenger.state :as state]
|
||||
[messenger.utils.utils :refer [log toast]]
|
||||
[messenger.utils.resources :as res]
|
||||
[messenger.components.spinner :refer [spinner]]
|
||||
[messenger.comm.intercom :as intercom :refer [set-confirmation-code]]
|
||||
[messenger.android.contacts-list :refer [contacts-list]]))
|
||||
|
||||
(def nav-atom (atom nil))
|
||||
|
||||
(defn show-home-view []
|
||||
(swap! state/app-state assoc :loading false)
|
||||
(binding [state/*nav-render* false]
|
||||
(.replace @nav-atom (clj->js {:component contacts-list
|
||||
:name "contacts-list"}))))
|
||||
@ -37,6 +39,7 @@
|
||||
|
||||
(defn send-code [code]
|
||||
(when (code-valid? code)
|
||||
(swap! state/app-state assoc :loading true)
|
||||
(intercom/sign-up-confirm code on-send-code-response)))
|
||||
|
||||
(defn update-code [value]
|
||||
@ -46,13 +49,15 @@
|
||||
(defui SignUpConfirm
|
||||
static om/IQuery
|
||||
(query [this]
|
||||
'[:confirmation-code])
|
||||
'[:confirmation-code :loading])
|
||||
Object
|
||||
(render
|
||||
[this]
|
||||
(let [{:keys [confirmation-code]} (om/props this)
|
||||
(let [{:keys [confirmation-code loading]} (om/props this)
|
||||
{:keys [nav]} (om/get-computed this)]
|
||||
(reset! nav-atom nav)
|
||||
(view
|
||||
{:style {:flex 1}}
|
||||
(view
|
||||
{:style {:flex 1
|
||||
:backgroundColor "white"}}
|
||||
@ -94,6 +99,8 @@
|
||||
:width 100}}
|
||||
(text {:style {:marginVertical 10
|
||||
:textAlign "center"}}
|
||||
"Confirm"))))))))
|
||||
"Confirm")))))
|
||||
(when loading
|
||||
(spinner {:visible true}))))))
|
||||
|
||||
(def sign-up-confirm (om/factory SignUpConfirm))
|
||||
|
Loading…
x
Reference in New Issue
Block a user