[#9596] Fix biometric auth popover styles

This commit is contained in:
Roman Volosovskyi 2019-12-12 09:48:09 +02:00
parent 31f7b09a7b
commit ecb71645c2
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
2 changed files with 17 additions and 21 deletions

View File

@ -1,5 +1,4 @@
(ns status-im.ui.screens.biometric.views
(:require-macros [status-im.utils.views :as views])
(:require [status-im.ui.components.react :as react]
[status-im.ui.components.button :as button]
[re-frame.core :as re-frame]
@ -19,10 +18,9 @@
ok-button-label cancel-button-label on-cancel on-confirm]}]
(let [supported-biometric-auth (get-supported-biometric-auth)
bio-type-label (get-bio-type-label)]
[react/view {:padding 24
[react/view {:margin-top 24
:align-items :center}
[react/view {:margin-bottom 16
:width 32
[react/view {:width 32
:height 32
:background-color colors/blue-light
:border-radius 16
@ -30,21 +28,23 @@
:justify-content :center}
[icons/icon (if (= supported-biometric-auth :FaceID) :faceid :print)]]
[react/text {:style {:typography :title-bold}}
[react/text {:style {:typography :title-bold
:margin-top 16}}
(str (i18n/label title-label {:bio-type-label bio-type-label}))]
(vec
(concat
[react/nested-text {:style {:margin-bottom 25
:margin-top 10
:text-align :center}}]
[react/nested-text {:style {:margin-top 8
:color colors/gray
:text-align :center}}]
(if description-label
[(i18n/label description-label {:bio-type-label bio-type-label})]
description-text)))
[button/button {:label (i18n/label ok-button-label
{:bio-type-label bio-type-label})
:style {:margin-bottom 16}
:style {:margin-top 24}
:on-press #(re-frame/dispatch [on-confirm])}]
[button/button {:label (or cancel-button-label :t/cancel)
:style {:margin-bottom 24}
:type :secondary
:on-press #(re-frame/dispatch [(or on-cancel :hide-popover)])}]]))
@ -63,23 +63,20 @@
(defn enable-biometric-popover []
[biometric-popover
{:title-label :t/enable
{:title-label :t/biometric-enable-title
:description-label :t/to-enable-biometric
:ok-button-label :t/biometric-enable-button
:on-confirm :biometric-logout}])
(defn secure-with-biometric-popover []
(let [bio-label-type (get-bio-type-label)
keycard-account? @(re-frame/subscribe
(let [keycard-account? @(re-frame/subscribe
[:multiaccounts.login/keycard-account?])]
[biometric-popover
{:title-label :t/biometric-secure-with
:ok-button-label :t/biometric-enable-button
:on-confirm :biometric/enable
:description-text
[[{:style {:color colors/gray}}
(if keycard-account?
(i18n/label :t/biometric-enable-keycard)
(i18n/label :t/biometric-enable))]
[{} (i18n/label :t/biometric-sign-in {:bio-type-label bio-label-type})]]}]))
:description-label
(if keycard-account?
(i18n/label :t/biometric-enable-keycard)
(i18n/label :t/biometric-enable))}]))

View File

@ -69,9 +69,8 @@
"biometric-auth-reason-verify": "Verify authentication",
"biometric-auth-setting-label": "Use biometric authentication",
"biometric-secure-with": "Secure with {{bio-type-label}}",
"biometric-sign-in": "{{bio-type-label}} sign in",
"biometric-enable-keycard": "If you don't want to use your Keycard each time to access the app, enable ",
"biometric-enable": "If you don't want to enter your password each time to access the app, enable ",
"biometric-enable-keycard": "If you don't want to use your Keycard each time to access the app, enable {{bio-type-label}} sign in",
"biometric-enable": "If you don't want to enter your password each time to access the app, enable {{bio-type-label}} sign in",
"biometric-disable-bioauth": "disable {{bio-type-label}}",
"biometric-disable-password-title": "Disable password saving",
"biometric-disable-password-description": "If you disable this, you will also ",