Skip to content

Commit

Permalink
fix sign with keycard button in wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryn committed Oct 2, 2019
1 parent a02dce3 commit cf648de
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions src/status_im/ui/screens/signing/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,32 @@
:color colors/gray}}
(i18n/label :t/processing)]])

(defn- sign-with-keycard-button
(defn sign-with-keycard-button
[amount-error gas-error]
[button/button {:on-press #(re-frame/dispatch [:signing.ui/sign-with-keycard-pressed])
:disabled? (or amount-error gas-error)
:label :t/sign-with-keycard}])
(let [disabled? (or amount-error gas-error)]
[react/touchable-highlight {:on-press #(when-not disabled?
(re-frame/dispatch [:signing.ui/sign-with-keycard-pressed]))}
[react/view {:background-color colors/black-light
:padding-top 2
:border-radius 8
:width 182
:height 44
:flex-direction :row
:justify-content :center
:align-items :center
:opacity (if disabled? 0.1 1)
:padding-horizontal 12}
[react/text {:style {:padding-right 2
:padding-left 16
:color (if disabled? colors/black colors/white)
:padding-horizontal 16
:padding-vertical 10}}
(i18n/label :t/sign-with)]
[react/view {:padding-right 16}
[react/image {:source (resources/get-image :keycard-logo)
:style {:width 64
:margin-bottom 7
:height 26}}]]]]))

(defn- signing-phrase-view [phrase]
[react/view {:align-items :center}
Expand All @@ -169,7 +190,7 @@

(defn- keycard-view
[{:keys [keycard-step]} phrase]
[react/view {:height 500}
[react/view {:height 520}
[signing-phrase-view phrase]
(case keycard-step
:pin [keycard-pin-view]
Expand Down

0 comments on commit cf648de

Please sign in to comment.