This commit is contained in:
parent
2f1271e6af
commit
fa94340b6a
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
(defmethod nav/preload-data! :login
|
(defmethod nav/preload-data! :login
|
||||||
[db]
|
[db]
|
||||||
(update db :login dissoc :error :password))
|
(update db :login dissoc :error :password :processing))
|
||||||
|
|
||||||
(defn set-login-from-qr
|
(defn set-login-from-qr
|
||||||
[{:keys [login] :as db} [_ _ login-info]]
|
[{:keys [login] :as db} [_ _ login-info]]
|
||||||
|
@ -69,8 +69,11 @@
|
||||||
error (:error data)
|
error (:error data)
|
||||||
success (zero? (count error))]
|
success (zero? (count error))]
|
||||||
(log/debug "Logged in account: ")
|
(log/debug "Logged in account: ")
|
||||||
|
(dispatch [:set-in [:login :processing] false])
|
||||||
(if success
|
(if success
|
||||||
(logged-in db address)
|
(logged-in db address)
|
||||||
(dispatch [:set-in [:login :error] error])))))))
|
(dispatch [:set-in [:login :error] error])))))))
|
||||||
(fn [db [_ _ _ account-creation?]]
|
(fn [db [_ _ _ account-creation?]]
|
||||||
(assoc db :account-creation? account-creation?)))
|
(-> db
|
||||||
|
(assoc :account-creation? account-creation?)
|
||||||
|
(assoc-in [:login :processing] true))))
|
||||||
|
|
|
@ -21,8 +21,10 @@
|
||||||
:actions [{:image :blank}]
|
:actions [{:image :blank}]
|
||||||
:title (i18n/label :t/sign-in-to-status)}])
|
:title (i18n/label :t/sign-in-to-status)}])
|
||||||
|
|
||||||
|
(def password-text-input (atom nil))
|
||||||
|
|
||||||
(defview login []
|
(defview login []
|
||||||
[{:keys [address photo-path name password error]} [:get :login]]
|
[{:keys [address photo-path name password error processing]} [:get :login]]
|
||||||
[view ast/accounts-container
|
[view ast/accounts-container
|
||||||
[status-bar {:type :transparent}]
|
[status-bar {:type :transparent}]
|
||||||
[login-toolbar]
|
[login-toolbar]
|
||||||
|
@ -30,7 +32,8 @@
|
||||||
[view st/login-badge-container
|
[view st/login-badge-container
|
||||||
[account-bage address photo-path name]
|
[account-bage address photo-path name]
|
||||||
[view {:height 8}]
|
[view {:height 8}]
|
||||||
[text-input-with-label {:label (i18n/label :t/password)
|
[text-input-with-label {:ref #(reset! password-text-input %)
|
||||||
|
:label (i18n/label :t/password)
|
||||||
:auto-capitalize :none
|
:auto-capitalize :none
|
||||||
:hide-underline? true
|
:hide-underline? true
|
||||||
:on-change-text #(do
|
:on-change-text #(do
|
||||||
|
@ -40,6 +43,10 @@
|
||||||
:secure-text-entry true
|
:secure-text-entry true
|
||||||
:error (when (pos? (count error)) (i18n/label :t/wrong-password))}]]
|
:error (when (pos? (count error)) (i18n/label :t/wrong-password))}]]
|
||||||
[view {:margin-top 16}
|
[view {:margin-top 16}
|
||||||
[touchable-highlight {:on-press #(dispatch [:login-account address password])}
|
[touchable-highlight {:on-press #(do
|
||||||
|
(.blur @password-text-input)
|
||||||
|
(dispatch [:login-account address password]))}
|
||||||
[view st/sign-in-button
|
[view st/sign-in-button
|
||||||
[text {:style st/sign-it-text} (i18n/label :t/sign-in)]]]]]])
|
[text {:style st/sign-it-text} (i18n/label :t/sign-in)]]]]]
|
||||||
|
(when processing
|
||||||
|
[view st/processing-view])])
|
||||||
|
|
|
@ -32,3 +32,12 @@
|
||||||
:height 52
|
:height 52
|
||||||
:ios {:border-radius 8}
|
:ios {:border-radius 8}
|
||||||
:android {:border-radius 4}})
|
:android {:border-radius 4}})
|
||||||
|
|
||||||
|
(def processing-view
|
||||||
|
{:position :absolute
|
||||||
|
:top 0
|
||||||
|
:bottom 0
|
||||||
|
:right 0
|
||||||
|
:left 0
|
||||||
|
:background-color common/color-black
|
||||||
|
:opacity 0.1})
|
||||||
|
|
Loading…
Reference in New Issue