add blocked card popover

Signed-off-by: Michele Balistreri <michele@bitgamma.com>
This commit is contained in:
Michele Balistreri 2021-06-02 11:54:52 +02:00
parent 8448570922
commit aaf07911c4
No known key found for this signature in database
GPG Key ID: E9567DA33A4F791A
3 changed files with 27 additions and 8 deletions

View File

@ -361,6 +361,14 @@
(clear-on-card-read)
(hide-connection-sheet))))
(fx/defn blocked-keycard-popup
[{:keys [db] :as cofx}]
(fx/merge cofx
{:db (-> db
(assoc-in [:keycard :pin :status] :blocked-card)
(assoc :popover/popover {:view :blocked-card}))}
(hide-connection-sheet)))
(fx/defn frozen-keycard-popup
[{:keys [db] :as cofx}]
(if (:multiaccounts/login db)
@ -438,10 +446,7 @@
(frozen-keycard-popup))
(fn [{:keys [db] :as cofx}]
(if (zero? puk-retry-counter)
(fx/merge
cofx
{:db (assoc-in db [:keycard :pin :status] :blocked-card)}
hide-connection-sheet)
(blocked-keycard-popup cofx)
(when on-success'
(dispatch-event cofx on-success')))))))
(fx/defn on-get-application-info-error

View File

@ -213,9 +213,9 @@
[frozen-card.view/frozen-card
{:show-dismiss-button? false}])
(defn blocked-card []
[react/view {:style {:flex 1
:align-items :center}}
(defn blocked-card [{:keys [show-dismiss-button?]}]
[react/view {:style (when-not show-dismiss-button?
{:flex 1})}
[react/view {:margin-top 24
:margin-horizontal 24
:align-items :center}
@ -245,7 +245,17 @@
[react/view {:style {:margin-top 24}}
[quo/button
{:on-press #(re-frame/dispatch [:keycard-settings.ui/recovery-card-pressed false])}
(i18n/label :t/keycard-is-frozen-factory-reset)]]]])
(i18n/label :t/keycard-is-frozen-factory-reset)]]
(when show-dismiss-button?
[react/view {:margin-top 24
:margin-bottom 24}
[quo/button
{:on-press #(re-frame/dispatch [::keycard.login/frozen-keycard-popover-dismissed])
:type :secondary}
(i18n/label :t/dismiss)]])]])
(defn blocked-card-popover []
[blocked-card {:show-dismiss-button? true}])
(defview login-pin [{:keys [back-button-handler
hide-login-actions?

View File

@ -17,6 +17,7 @@
[status-im.ui.screens.signing.views :as signing]
[status-im.ui.screens.biometric.views :as biometric]
[status-im.ui.components.colors :as colors]
[status-im.ui.screens.keycard.views :as keycard.views]
[status-im.ui.screens.keycard.frozen-card.view :as frozen-card]))
(defn hide-panel-anim
@ -146,6 +147,9 @@
(= :frozen-card view)
[frozen-card/frozen-card]
(= :blocked-card view)
[keycard.views/blocked-card-popover]
(= :advertiser-invite view)
[advertiser.invite/accept-popover]