Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaliy Vlasov committed Sep 12, 2019
1 parent 4597020 commit 3a8ca4b
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 30 deletions.
6 changes: 3 additions & 3 deletions src/status_im/ui/components/text_input/styles.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@

(defstyle input
{:padding 0
:text-align-vertical :top
:text-align-vertical :center
:desktop {:height 52}})

(defn error [label?]
{:bottom-value (if label? 20 0)
(defn error [bottom-value]
{:bottom-value bottom-value
:container-style {:shadow-offset {:width 0 :height 1}
:shadow-radius 6
:shadow-opacity 1
Expand Down
12 changes: 9 additions & 3 deletions src/status_im/ui/components/text_input/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
(dissoc merged-styles :background-color)
merged-styles)))

(defn text-input-with-label [{:keys [label content error style height container text editable] :as props :or {editable true}}]
[react/view
(defn text-input-with-label [{:keys [label content error style height container
bottom-value
parent-container text editable] :as props :or {editable true}}]
[react/view (when parent-container
parent-container)
(when label
[react/text {:style (styles/label editable)}
label])
Expand All @@ -33,4 +36,7 @@
{:value text}))]
(when content content)]
(when error
[tooltip/tooltip error (styles/error label)])])
[tooltip/tooltip error (styles/error
(cond bottom-value bottom-value
label 20
:else 0))])])
66 changes: 42 additions & 24 deletions src/status_im/ui/screens/multiaccounts/recover/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -66,37 +66,55 @@
[react/text {:style {:typography :header
:text-align :center}}
(i18n/label :t/multiaccounts-recover-enter-phrase-title)]]
[react/view {:style {:flex 1 :justify-content :center}}
[text-input/text-input-with-label
{:on-change-text #(re-frame/dispatch [::multiaccounts.recover/enter-phrase-input-changed (security/mask-data %)])
:auto-focus true
:on-submit-editing #(re-frame/dispatch [::multiaccounts.recover/enter-phrase-input-submitted])
:error (when passphrase-error (i18n/label passphrase-error))
:placeholder nil
;:height 120
:multiline true
:auto-correct false
:keyboard-type "visible-password"
:container {:background-color :white}
:style {:background-color :white
:text-align :center
:flex 1
:align-self :stretch
:font-size 16
:font-weight "700"}}]]]
[text-input/text-input-with-label
{:on-change-text #(re-frame/dispatch [::multiaccounts.recover/enter-phrase-input-changed (security/mask-data %)])
:auto-focus true
:on-submit-editing #(re-frame/dispatch [::multiaccounts.recover/enter-phrase-input-submitted])
:error (when passphrase-error (i18n/label passphrase-error))
:placeholder nil
;:height 120
:bottom-value 40
:multiline true
:auto-correct false
:keyboard-type "visible-password"
:parent-container {:flex 1
:align-self :stretch
:justify-content :center
:align-items :center}
:container {:background-color :white
:flex 1
:justify-content :center
:align-items :center}
:style {:background-color :white
:text-align :center
;:height 75
:flex 1
:flex-wrap :wrap
:font-size 16
:font-weight "700"}}]]
[react/view {:align-items :center}
(when words-count
[react/view {:flex-direction :row
:height 11
:align-items :center}
(when-not next-button-disabled?
[vector-icons/tiny-icon :tiny-icons/tiny-check])
[react/text {:style {:font-size 14
:padding-left 4
:font-weight "500"
:text-align :center
:color colors/black}}
(i18n/label-pluralize words-count :t/words-n)]])
:color colors/gray}}
(str (i18n/label :t/word-count) ":")]
[react/text {:style {:font-size 14
:padding-horizontal 4
:font-weight "500"
:text-align :center
:color colors/black}}
(i18n/label-pluralize words-count :t/words-n)]
(when-not next-button-disabled?
[react/view {:style {:background-color colors/green-transparent-10
:border-radius 12
:width 24
:justify-content :center
:align-items :center
:height 24}}
[vector-icons/tiny-icon :tiny-icons/tiny-check {:color colors/green}]])])
(when next-button-disabled?
[react/text {:style {:color colors/gray
:font-size 14
Expand Down
1 change: 1 addition & 0 deletions translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,7 @@
"recover-with-keycard": "Recover with Keycard",
"multiaccounts-recover-enter-phrase-title": "Enter your seed phrase",
"multiaccounts-recover-enter-phrase-text": "Enter 12, 15, 18, 21 or 24 words.\nSeparate words by a single space.",
"word-count": "Word count",
"words-n": {
"one": "1 word",
"other": "{{count}} words"
Expand Down

0 comments on commit 3a8ca4b

Please sign in to comment.