[#9233, #9173] fix some screens

Signed-off-by: yenda <eric@status.im>
This commit is contained in:
Roman Volosovskyi 2019-10-25 11:26:47 +03:00 committed by yenda
parent 88dbeead42
commit e80b08c42e
No known key found for this signature in database
GPG Key ID: 0095623C0069DCE6
3 changed files with 55 additions and 45 deletions

View File

@ -123,45 +123,48 @@
:style {:width image-size :height image-size}}])]))) :style {:width image-size :height image-size}}])])))
(defn choose-key [{:keys [multiaccounts selected-id view-height]}] (defn choose-key [{:keys [multiaccounts selected-id view-height]}]
[react/scroll-view {:content-container-style {:flex 1 [react/view
:justify-content (if (< view-height 600) :flex-start :flex-end) {:style {:flex 1
:margin-top (if (< view-height 600) 20 0) :justify-content :center}}
;; We have to align top multiaccount entry [react/view
;; with top key storage entry on the next screen {:style {:flex 1
:margin-bottom (if (< view-height 600) :height 200
0 :max-height 338}}
(/ view-height 12))}} [react/scroll-view
(for [[acc accessibility-n] (map vector multiaccounts (range (count multiaccounts)))] {:content-container-style {:justify-content :flex-start}}
(let [selected? (= (:id acc) selected-id) (for [[acc accessibility-n] (map vector multiaccounts (range (count multiaccounts)))]
public-key (get-in acc [:derived constants/path-whisper-keyword :publicKey])] (let [selected? (= (:id acc) selected-id)
^{:key public-key} public-key (get-in acc [:derived constants/path-whisper-keyword :publicKey])]
[react/touchable-highlight ^{:key public-key}
{:accessibility-label (keyword (str "select-account-button-" accessibility-n)) [react/touchable-highlight
:on-press #(re-frame/dispatch [:intro-wizard/on-key-selected (:id acc)])} {:accessibility-label (keyword (str "select-account-button-" accessibility-n))
[react/view {:style (styles/list-item selected?)} :on-press #(re-frame/dispatch [:intro-wizard/on-key-selected (:id acc)])}
[react/view {:style (styles/list-item selected?)}
[react/image {:source {:uri (identicon/identicon public-key)} [react/image {:source {:uri (identicon/identicon public-key)}
:resize-mode :cover :resize-mode :cover
:style styles/multiaccount-image}] :style styles/multiaccount-image}]
[react/view {:style {:margin-horizontal 16 :flex 1 :justify-content :space-between}} [react/view {:style {:margin-horizontal 16 :flex 1 :justify-content :space-between}}
[react/text {:style (assoc styles/wizard-text :text-align :left [react/text {:style (assoc styles/wizard-text :text-align :left
:color colors/black :color colors/black
:font-weight "500") :font-weight "500")
:number-of-lines 1 :number-of-lines 1
:ellipsize-mode :middle} :ellipsize-mode :middle}
(gfy/generate-gfy public-key)] (gfy/generate-gfy public-key)]
[react/text {:style (assoc styles/wizard-text [react/text {:style (assoc styles/wizard-text
:text-align :left :text-align :left
:font-family "monospace")} :font-family "monospace")}
(utils/get-shortened-address public-key)]] (utils/get-shortened-address public-key)]]
[radio/radio selected?]]]))]) [radio/radio selected?]]]))]]])
(defn storage-entry [{:keys [type icon icon-width icon-height (defn storage-entry [{:keys [type icon icon-width icon-height
image image-selected image-width image-height image image-selected image-width image-height
title desc]} selected-storage-type] title desc]} selected-storage-type]
(let [selected? (= type selected-storage-type)] (let [selected? (= type selected-storage-type)]
[react/view [react/view
[react/view {:style {:padding-top 14 :padding-bottom 4}} {:style {:flex 1
:padding-top 14}}
[react/view {:style {:padding-bottom 4}}
[react/text {:style (assoc styles/wizard-text :text-align :left :margin-left 16)} [react/text {:style (assoc styles/wizard-text :text-align :left :margin-left 16)}
(i18n/label type)]] (i18n/label type)]]
[react/touchable-highlight [react/touchable-highlight
@ -200,16 +203,20 @@
:image-height 24 :image-height 24
:title :keycard :title :keycard
:desc :keycard-desc}]] :desc :keycard-desc}]]
[react/view {:style {:flex 1 [react/view
:justify-content (if (< view-height 600) :flex-start :flex-end) {:style {:flex 1
;; We have to align top storage entry :justify-content :center}}
;; with top multiaccount entry on the previous screen [react/view
:margin-bottom (if (< view-height 600) {:style
0 {:max-height 420
(+ (- 322 226) (/ view-height 12)))}} :flex 1
[storage-entry (first storage-types) selected-storage-type] :justify-content :flex-start}}
[react/view {:style {:min-height 16 :max-height 16}}] [react/view {:style {:justify-content :flex-start
[storage-entry (second storage-types) selected-storage-type]])) :height 264}}
[storage-entry (first storage-types) selected-storage-type]
[react/view {:style {:flex 1
:max-height 16}}]
[storage-entry (second storage-types) selected-storage-type]]]]))
(defn password-container [confirm-failure? view-width] (defn password-container [confirm-failure? view-width]
(let [horizontal-margin 16] (let [horizontal-margin 16]
@ -315,7 +322,8 @@
"-alt") (step-kw-to-num step)))))] "-alt") (step-kw-to-num step)))))]
(cond (#{:choose-key :select-key-storage} step) (cond (#{:choose-key :select-key-storage} step)
; Use nested text for the "Learn more" link ; Use nested text for the "Learn more" link
[react/nested-text {:style styles/wizard-text} [react/nested-text {:style (merge styles/wizard-text
{:height 60})}
(str (i18n/label (keyword (str "intro-wizard-text" (step-kw-to-num step)))) " ") (str (i18n/label (keyword (str "intro-wizard-text" (step-kw-to-num step)))) " ")
[{:on-press #(re-frame/dispatch [:bottom-sheet/show-sheet :learn-more [{:on-press #(re-frame/dispatch [:bottom-sheet/show-sheet :learn-more
{:title (i18n/label (if (= step :choose-key) :t/about-names-title :t/about-key-storage-title)) {:title (i18n/label (if (= step :choose-key) :t/about-names-title :t/about-key-storage-title))

View File

@ -332,6 +332,8 @@
[react/view styles/network-icon [react/view styles/network-icon
[vector-icons/icon :main-icons/network {:color :white}]] [vector-icons/icon :main-icons/network {:color :white}]]
[react/text [react/text
{:style {:flex 1
:padding-left 16}}
(cond (ethereum/testnet? network-id) (cond (ethereum/testnet? network-id)
(i18n/label :t/testnet-text {:testnet (get-in ethereum/chains [(ethereum/chain-id->chain-keyword network-id) :name] "Unknown")}) (i18n/label :t/testnet-text {:testnet (get-in ethereum/chains [(ethereum/chain-id->chain-keyword network-id) :name] "Unknown")})

View File

@ -529,7 +529,7 @@
"intro-title2": "Secure crypto wallet", "intro-title2": "Secure crypto wallet",
"intro-title3": "Decentralized apps", "intro-title3": "Decentralized apps",
"intro-wizard-text1": "Your identity is secure by design. You get a locally generated cryptographic keypair", "intro-wizard-text1": "Your identity is secure by design. You get a locally generated cryptographic keypair",
"intro-wizard-text2": "This name is your identity in Status. It cant be changed once you choose one. ", "intro-wizard-text2": "This name is your identity in Status. It cant be changed once you choose one.",
"intro-wizard-text3": "Your key is stored locally. There is no copy. Only you have access.", "intro-wizard-text3": "Your key is stored locally. There is no copy. Only you have access.",
"intro-wizard-text4": "Secure and encrypt your key", "intro-wizard-text4": "Secure and encrypt your key",
"intro-wizard-text6": "Status will notify you about new messages. You can edit your notification preferences later in settings", "intro-wizard-text6": "Status will notify you about new messages. You can edit your notification preferences later in settings",
@ -593,7 +593,7 @@
"keycard-recovery-success-header": "Your key has been\n successfully recovered", "keycard-recovery-success-header": "Your key has been\n successfully recovered",
"keycard-unauthorized-operation": "You're unauthorized to perform this operation.\n Please tap valid card and try again.", "keycard-unauthorized-operation": "You're unauthorized to perform this operation.\n Please tap valid card and try again.",
"language": "Language", "language": "Language",
"learn-more": "Learn more", "learn-more": "Learn\u00a0more",
"learn-more-about-keycard": "Learn more about Keycard", "learn-more-about-keycard": "Learn more about Keycard",
"leave": "Leave", "leave": "Leave",
"leave-group": "Leave group", "leave-group": "Leave group",