Use monospace font for address and public-key

Swap monospace header

Signed-off-by: Gheorghe Pinzaru <feross95@gmail.com>
This commit is contained in:
Gheorghe Pinzaru 2020-08-18 17:13:35 +03:00
parent 399be0686c
commit fdf8d11913
No known key found for this signature in database
GPG Key ID: C9A094959935A952
23 changed files with 169 additions and 158 deletions

View File

@ -36,7 +36,7 @@
(when-not minimized (when-not minimized
{:padding-top subtitle-margin}))) {:padding-top subtitle-margin})))
(defn extended-header [{:keys [title photo color subtitle subtitle-icon on-press]}] (defn extended-header [{:keys [title photo color subtitle subtitle-icon on-press monospace]}]
(fn [{:keys [animation minimized]}] (fn [{:keys [animation minimized]}]
(let [wrapper (if on-press (let [wrapper (if on-press
[rn/touchable-opacity {:on-press on-press}] [rn/touchable-opacity {:on-press on-press}]
@ -72,6 +72,7 @@
:container-style {:margin-right 4}}]) :container-style {:margin-right 4}}])
[quo/text {:number-of-lines 1 [quo/text {:number-of-lines 1
:ellipsize-mode :middle :ellipsize-mode :middle
:monospace monospace
:size (if minimized :small :base) :size (if minimized :small :base)
:color :secondary} :color :secondary}
subtitle]])]] subtitle]])]]

View File

@ -1,6 +1,5 @@
(ns status-im.ui.components.typography (ns status-im.ui.components.typography
(:require [status-im.ui.components.colors :as colors] (:require [status-im.ui.components.colors :as colors]))
[status-im.utils.platform :as platform]))
(def default-font-family "Inter") (def default-font-family "Inter")
(defn default-style [] (defn default-style []
@ -37,17 +36,15 @@
(dissoc style :typography :nested?))] (dissoc style :typography :nested?))]
(-> style (-> style
(assoc :font-family (assoc :font-family
(if (= (:font-family style) "monospace") (str default-font-family "-"
(if platform/ios? "Menlo-Regular" "monospace") (case font-weight
(str default-font-family "-" "400" (when-not (= font-style :italic)
(case font-weight "Regular")
"400" (when-not (= font-style :italic) "500" "Medium"
"Regular") "600" "SemiBold"
"500" "Medium" "700" "Bold")
"600" "SemiBold" (when (= font-style :italic)
"700" "Bold") "Italic")))
(when (= font-style :italic)
"Italic"))))
(dissoc :font-weight :font-style)))) (dissoc :font-weight :font-style))))
(defn get-nested-style (defn get-nested-style

View File

@ -1,8 +1,4 @@
(ns status-im.ui.screens.add-new.new-chat.styles (ns status-im.ui.screens.add-new.new-chat.styles)
(:require [status-im.ui.components.colors :as colors]))
(def message (def message
{:margin-horizontal 16 {:margin-horizontal 16})
:align-self :center
:font-size 12
:color colors/gray})

View File

@ -93,16 +93,25 @@
:align-items :center} :align-items :center}
[input-icon state false]]] [input-icon state false]]]
[react/view {:min-height 30 :justify-content :flex-end} [react/view {:min-height 30 :justify-content :flex-end}
[react/text {:style styles/message} [quo/text {:style styles/message
:size :small
:align :center
:color :secondary}
(cond (= state :error) (cond (= state :error)
(get-validation-label error) (get-validation-label error)
(= state :valid) (= state :valid)
(str (if ens-name (str (if ens-name
ens-name ens-name
(gfycat/generate-gfy public-key)) (gfycat/generate-gfy public-key))
" • " " • ")
(utils/get-shortened-address public-key))
:else "")]] :else "")
(when (= state :valid)
[quo/text {:monospace true
:size :inherit
:color :inherit}
(utils/get-shortened-address public-key)])]]
[list/flat-list {:data contacts [list/flat-list {:data contacts
:key-fn :address :key-fn :address
:render-fn render-row :render-fn render-row

View File

@ -15,6 +15,7 @@
[status-im.utils.contenthash :as contenthash] [status-im.utils.contenthash :as contenthash]
[status-im.utils.security :as security] [status-im.utils.security :as security]
[status-im.ui.screens.chat.message.reactions :as reactions] [status-im.ui.screens.chat.message.reactions :as reactions]
[quo.core :as quo]
[reagent.core :as reagent]) [reagent.core :as reagent])
(:require-macros [status-im.utils.views :refer [defview letsubs]])) (:require-macros [status-im.utils.views :refer [defview letsubs]]))
@ -59,7 +60,9 @@
(conj acc literal) (conj acc literal)
"code" "code"
(conj acc [react/text-class (style/inline-code-style) literal]) (conj acc [quo/text {:max-font-size-multiplier react/max-font-size-multiplier
:style (style/inline-code-style)}
literal])
"emph" "emph"
(conj acc [react/text-class (style/emph-style outgoing) literal]) (conj acc [react/text-class (style/emph-style outgoing) literal])
@ -71,7 +74,7 @@
(conj acc (conj acc
[react/text-class [react/text-class
{:style {:style
{:color (if outgoing colors/white-persist colors/blue) {:color (if outgoing colors/white-persist colors/blue)
:text-decoration-line :underline} :text-decoration-line :underline}
:on-press :on-press
#(when (and (security/safe-link? destination) #(when (and (security/safe-link? destination)
@ -82,16 +85,16 @@
"mention" "mention"
(conj acc [react/text-class (conj acc [react/text-class
{:style {:color (cond {:style {:color (cond
(= content-type constants/content-type-system-text) colors/black (= content-type constants/content-type-system-text) colors/black
outgoing colors/mention-outgoing outgoing colors/mention-outgoing
:else colors/mention-incoming)} :else colors/mention-incoming)}
:on-press (when-not (= content-type constants/content-type-system-text) :on-press (when-not (= content-type constants/content-type-system-text)
#(re-frame/dispatch [:chat.ui/show-profile literal]))} #(re-frame/dispatch [:chat.ui/show-profile literal]))}
[mention-element literal]]) [mention-element literal]])
"status-tag" "status-tag"
(conj acc [react/text-class (conj acc [react/text-class
{:style {:color (if outgoing colors/white-persist colors/blue) {:style {:color (if outgoing colors/white-persist colors/blue)
:text-decoration-line :underline} :text-decoration-line :underline}
:on-press :on-press
#(re-frame/dispatch #(re-frame/dispatch
@ -117,8 +120,9 @@
(.substring literal 0 (dec (.-length literal)))]]) (.substring literal 0 (dec (.-length literal)))]])
"codeblock" "codeblock"
(conj acc [react/view style/codeblock-style (conj acc [react/view {:style style/codeblock-style}
[react/text-class style/codeblock-text-style [quo/text {:max-font-size-multiplier react/max-font-size-multiplier
:style style/codeblock-text-style}
(.substring literal 0 (dec (.-length literal)))]]) (.substring literal 0 (dec (.-length literal)))]])
acc)) acc))

View File

@ -3,7 +3,6 @@
[status-im.ui.components.colors :as colors] [status-im.ui.components.colors :as colors]
[status-im.ui.components.react :as react] [status-im.ui.components.react :as react]
[status-im.ui.screens.chat.styles.photos :as photos] [status-im.ui.screens.chat.styles.photos :as photos]
[status-im.utils.platform :as platform]
[status-im.ui.components.typography :as typography])) [status-im.ui.components.typography :as typography]))
(defn style-message-text (defn style-message-text
@ -235,26 +234,19 @@
(outgoing-strong-text-style) (outgoing-strong-text-style)
(strong-text-style))) (strong-text-style)))
(def monospace-fonts (if platform/ios? "Courier" "monospace"))
(def code-block-background "#2E386B") (def code-block-background "#2E386B")
(defn inline-code-style [] (defn inline-code-style []
(update (default-text-style) :style {:color colors/white-persist
assoc :background-color code-block-background})
:font-family monospace-fonts
:color colors/white-persist
:background-color code-block-background))
(def codeblock-style {:style {:padding 10 (def codeblock-style
:background-color code-block-background {:padding 10
:border-radius 4}}) :background-color code-block-background
:border-radius 4})
(def codeblock-text-style (def codeblock-text-style
(update (default-text-style) :style {:color colors/white-persist})
assoc
:font-family monospace-fonts
:color colors/white))
(defn default-blockquote-style [] (defn default-blockquote-style []
{:style {:border-left-width 2 {:style {:border-left-width 2

View File

@ -36,16 +36,16 @@
(defn- section (defn- section
[{:keys [title content]}] [{:keys [title content]}]
[react/view {:style {:margin-horizontal 16 [react/view {:style {:margin-horizontal 16
:align-items :flex-start}} :align-items :flex-start}}
[react/text {:style {:color colors/gray :font-size 15}} [react/text {:style {:color colors/gray :font-size 15}}
title] title]
[react/view {:margin-top 8 [react/view {:margin-top 8
:padding-horizontal 16 :padding-horizontal 16
:padding-vertical 12 :padding-vertical 12
:border-width 1 :border-width 1
:border-radius 12 :border-radius 12
:border-color colors/gray-lighter} :border-color colors/gray-lighter}
[react/text {:style {:font-size 15}} [quo/text {:monospace true}
content]]]) content]]])
(defn- domain-label (defn- domain-label
@ -320,8 +320,8 @@
(i18n/label :t/ens-deposit)]]] (i18n/label :t/ens-deposit)]]]
:right [react/view {:padding-horizontal 8} :right [react/view {:padding-horizontal 8}
[quo/button [quo/button
{:disabled? (or (not @checked?) (not sufficient-funds?)) {:disabled (or (not @checked?) (not sufficient-funds?))
:on-press #(debounce/dispatch-and-chill [::ens/register-name-pressed] 2000)} :on-press #(debounce/dispatch-and-chill [::ens/register-name-pressed] 2000)}
(if sufficient-funds? (if sufficient-funds?
(i18n/label :t/ens-register) (i18n/label :t/ens-register)
(i18n/label :t/not-enough-snt))]]}]])))) (i18n/label :t/not-enough-snt))]]}]]))))

View File

@ -279,7 +279,7 @@
(i18n/label :t/processing)]])]]) (i18n/label :t/processing)]])]])
(defn recovery-success [pubkey name photo-path] (defn recovery-success [pubkey name photo-path]
[react/view {:flex 1 [react/view {:flex 1
:justify-content :space-between :justify-content :space-between
:background-color colors/white} :background-color colors/white}
[react/view {:flex 1 [react/view {:flex 1
@ -306,12 +306,12 @@
:number-of-lines 1 :number-of-lines 1
:ellipsize-mode :middle} :ellipsize-mode :middle}
name] name]
[react/text {:style {:text-align :center [quo/text {:style {:margin-top 4}
:margin-top 4 :monospace true
:color colors/gray :color :secondary
:font-family "monospace"} :align :center
:number-of-lines 1 :number-of-lines 1
:ellipsize-mode :middle} :ellipsize-mode :middle}
(utils/get-shortened-address pubkey)]]]]]) (utils/get-shortened-address pubkey)]]]]])
(defview wizard-generate-key [] (defview wizard-generate-key []

View File

@ -128,11 +128,11 @@
(i18n/label :t/puk-code)]] (i18n/label :t/puk-code)]]
[react/view {:justify-content :flex-start [react/view {:justify-content :flex-start
:flex 1} :flex 1}
[react/text {:style {:typography :header [quo/text {:color :link
:font-family "monospace" :align :center
:text-align :center :size :large
:color colors/blue} :monospace true
:accessibility-label :puk-code} :accessibility-label :puk-code}
puk-code]]]] puk-code]]]]
[react/view {:margin-top 16} [react/view {:margin-top 16}
[react/text {:style {:color colors/gray}} [react/text {:style {:color colors/gray}}
@ -156,11 +156,11 @@
(i18n/label :t/pair-code)]] (i18n/label :t/pair-code)]]
[react/view {:justify-content :flex-start [react/view {:justify-content :flex-start
:flex 1} :flex 1}
[react/text {:style {:typography :header [quo/text {:color :link
:text-align :center :align :center
:font-family "monospace" :size :large
:color colors/blue} :monospace true
:accessibility-label :pair-code} :accessibility-label :pair-code}
(:password secrets)]]]] (:password secrets)]]]]
[react/view {:margin-top 16} [react/view {:margin-top 16}
[react/text {:style {:color colors/gray}} [react/text {:style {:color colors/gray}}

View File

@ -189,12 +189,12 @@
:number-of-lines 1 :number-of-lines 1
:ellipsize-mode :middle} :ellipsize-mode :middle}
(gfy/generate-gfy whisper-public-key)] (gfy/generate-gfy whisper-public-key)]
[react/text {:style {:text-align :center [quo/text {:style {:margin-top 4}
:margin-top 4 :monospace true
:color colors/gray :align :center
:font-family "monospace"} :color :secondary
:number-of-lines 1 :number-of-lines 1
:ellipsize-mode :middle} :ellipsize-mode :middle}
(utils.core/truncate-str address 14 true)]]] (utils.core/truncate-str address 14 true)]]]
[react/view {:margin-bottom 50} [react/view {:margin-bottom 50}
[quo/button {:on-press #(re-frame/dispatch [:keycard.recovery.success/finish-pressed])} [quo/button {:on-press #(re-frame/dispatch [:keycard.recovery.success/finish-pressed])}

View File

@ -28,10 +28,7 @@
:font-weight "500"}) :font-weight "500"})
(def login-badge-pubkey (def login-badge-pubkey
{:margin-top 4 {:margin-top 4})
:text-align :center
:color colors/gray
:font-family "monospace"})
(def password-container (def password-container
{:margin-top 24 {:margin-top 24

View File

@ -33,7 +33,10 @@
:numberOfLines 1} :numberOfLines 1}
;;TODO this should be done in a subscription ;;TODO this should be done in a subscription
name] name]
[react/text {:style styles/login-badge-pubkey} [quo/text {:monospace true
:align :center
:color :secondary
:style styles/login-badge-pubkey}
(utils/get-shortened-address public-key)]]]) (utils/get-shortened-address public-key)]]])
(defview login [] (defview login []

View File

@ -47,26 +47,26 @@
; :content-height 150} ; :content-height 150}
; contact]) ; contact])
(defn render-detail [{:keys [alias public-key ens-name] :as detail}]
[quo/list-item
{:title (or alias ens-name)
:subtitle (utils/get-shortened-address public-key)
:icon [chat-icon/contact-icon-contacts-tab
(multiaccounts/displayed-photo detail)]
:accessibility-label :profile-public-key
:on-press #(re-frame/dispatch [:show-popover {:view :share-chat-key
:address public-key
:ens-name ens-name}])
:accessory [icons/icon :main-icons/share styles/contact-profile-detail-share-icon]}])
(defn profile-details [contact] (defn profile-details [{:keys [alias public-key ens-name] :as contact}]
(when contact (when contact
[react/view [react/view
[quo/list-header [quo/list-header
[quo/text {:accessibility-label :profile-details [quo/text {:accessibility-label :profile-details
:color :inherit} :color :inherit}
(i18n/label :t/profile-details)]] (i18n/label :t/profile-details)]]
[render-detail contact]])) [quo/list-item
{:title (or alias ens-name)
:subtitle [quo/text {:monospace true
:color :secondary}
(utils/get-shortened-address public-key)]
:icon [chat-icon/contact-icon-contacts-tab
(multiaccounts/displayed-photo contact)]
:accessibility-label :profile-public-key
:on-press #(re-frame/dispatch [:show-popover {:view :share-chat-key
:address public-key
:ens-name ens-name}])
:accessory [icons/icon :main-icons/share styles/contact-profile-detail-share-icon]}]]))
;; TODO: List item ;; TODO: List item
(defn block-contact-action [{:keys [blocked? public-key]}] (defn block-contact-action [{:keys [blocked? public-key]}]
@ -104,12 +104,13 @@
:accessibility-label :back-button :accessibility-label :back-button
:on-press #(re-frame/dispatch [:navigate-back])}] :on-press #(re-frame/dispatch [:navigate-back])}]
:extended-header (profile-header/extended-header :extended-header (profile-header/extended-header
{:on-press on-share {:on-press on-share
:title (multiaccounts/displayed-name contact) :title (multiaccounts/displayed-name contact)
:photo (multiaccounts/displayed-photo contact) :photo (multiaccounts/displayed-photo contact)
:subtitle (if (and ens-verified public-key) :monospace (not ens-verified)
(gfy/generate-gfy public-key) :subtitle (if (and ens-verified public-key)
public-key)})} (gfy/generate-gfy public-key)
public-key)})}
[react/view {:padding-top 12} [react/view {:padding-top 12}
(for [{:keys [label subtext accessibility-label icon action disabled?]} (actions contact)] (for [{:keys [label subtext accessibility-label icon action disabled?]} (actions contact)]

View File

@ -32,9 +32,8 @@
{:label :t/ens-username {:label :t/ens-username
:container-style {:margin-top 12 :margin-bottom 4} :container-style {:margin-top 12 :margin-bottom 4}
:copied-text ens-name} :copied-text ens-name}
[react/nested-text [quo/text
{:style {:line-height 22 :font-size 15 {:monospace true
:font-family "monospace"}
:accessibility-label :ens-username} :accessibility-label :ens-username}
ens-name]] ens-name]]
[react/view {:height 1 :margin-top 12 :margin-horizontal -16 [react/view {:height 1 :margin-top 12 :margin-horizontal -16
@ -43,11 +42,10 @@
{:label :t/chat-key {:label :t/chat-key
:container-style {:margin-top 12 :margin-bottom 4} :container-style {:margin-top 12 :margin-bottom 4}
:copied-text address} :copied-text address}
[react/text {:number-of-lines 1 [quo/text {:number-of-lines 1
:ellipsize-mode :middle :ellipsize-mode :middle
:accessibility-label :chat-key :accessibility-label :chat-key
:style {:line-height 22 :font-size 15 :monospace true}
:font-family "monospace"}}
address]]] address]]]
[react/view styles/share-link-button [react/view styles/share-link-button
[quo/button [quo/button
@ -194,10 +192,11 @@
:on-press on-share}] :on-press on-share}]
:use-insets true :use-insets true
:extended-header (profile-header/extended-header :extended-header (profile-header/extended-header
{:on-press on-share {:on-press on-share
:title (multiaccounts/displayed-name account) :title (multiaccounts/displayed-name account)
:photo (multiaccounts/displayed-photo account) :photo (multiaccounts/displayed-photo account)
:subtitle (if (and ens-verified public-key) :monospace (not ens-verified)
(gfy/generate-gfy public-key) :subtitle (if (and ens-verified public-key)
public-key)})} (gfy/generate-gfy public-key)
public-key)})}
[content]]]))) [content]]])))

View File

@ -40,13 +40,11 @@
{:title title {:title title
:title-prefix-width 45 :title-prefix-width 45
:size :small :size :small
;; FIXME
:accessory :text :accessory :text
:accessory-text [react/text :accessory-text [quo/text
{:ellipsize-mode :middle {:ellipsize-mode :middle
:number-of-lines 1 :number-of-lines 1
:style {:font-family "monospace" :monospace true}
:line-height 22}}
(displayed-name contact)]}]]) (displayed-name contact)]}]])
(defn token-item [{:keys [icon color] :as token} display-symbol] (defn token-item [{:keys [icon color] :as token} display-symbol]

View File

@ -50,18 +50,20 @@
[react/small-loading-indicator :colors/white-persist] [react/small-loading-indicator :colors/white-persist]
[react/text {:style {:font-size 32 :color colors/white-persist :font-weight "600"}} portfolio-value]) [react/text {:style {:font-size 32 :color colors/white-persist :font-weight "600"}} portfolio-value])
[react/text {:style {:font-size 32 :color colors/white-transparent-persist :font-weight "600"}} (str " " (:code currency))]] [react/text {:style {:font-size 32 :color colors/white-transparent-persist :font-weight "600"}} (str " " (:code currency))]]
[react/text {:number-of-lines 1 :ellipsize-mode :middle [quo/text {:number-of-lines 1
:style {:width (/ window-width 3) :ellipsize-mode :middle
:line-height 22 :font-size 13 :monospace true
:font-family "monospace" :size :small
:color colors/white-transparent-70-persist}} :style {:width (/ window-width 3)
:line-height 22
:color colors/white-transparent-70-persist}}
(ethereum/normalized-hex address)]] (ethereum/normalized-hex address)]]
[react/view {:position :absolute :top 12 :right 12} [react/view {:position :absolute :top 12 :right 12}
[react/touchable-highlight {:on-press #(re-frame/dispatch [:show-popover {:view :share-account :address address}])} [react/touchable-highlight {:on-press #(re-frame/dispatch [:show-popover {:view :share-account :address address}])}
[icons/icon :main-icons/share {:color colors/white-persist [icons/icon :main-icons/share {:color colors/white-persist
:accessibility-label :share-wallet-address-icon}]]] :accessibility-label :share-wallet-address-icon}]]]
[react/view {:height button-group-height :background-color colors/black-transparent-20 [react/view {:height button-group-height :background-color colors/black-transparent-20
:border-bottom-right-radius 8 :border-bottom-left-radius 8 :flex-direction :row} :border-bottom-right-radius 8 :border-bottom-left-radius 8 :flex-direction :row}
(if (= type :watch) (if (= type :watch)
[react/view {:flex 1 :align-items :center :justify-content :center} [react/view {:flex 1 :align-items :center :justify-content :center}
[react/text {:style {:margin-left 8 :color colors/white-persist}} [react/text {:style {:margin-left 8 :color colors/white-persist}}

View File

@ -83,12 +83,15 @@
[property (i18n/label :t/wallet-address) [property (i18n/label :t/wallet-address)
[copyable-text/copyable-text-view [copyable-text/copyable-text-view
{:copied-text address} {:copied-text address}
[react/text {:style {:margin-top 6 :font-family "monospace"}} address]]] [quo/text {:style {:margin-top 6}
:monospace true}
address]]]
(when-not (= type :watch) (when-not (= type :watch)
[property (i18n/label :t/derivation-path) [property (i18n/label :t/derivation-path)
[copyable-text/copyable-text-view [copyable-text/copyable-text-view
{:copied-text path} {:copied-text path}
[react/text {:style {:margin-top 6 :font-family "monospace"}} path]]]) [quo/text {:style {:margin-top 6}
:monospace true} path]]])
(when-not (= type :watch) (when-not (= type :watch)
[property (i18n/label :t/storage) [property (i18n/label :t/storage)
(i18n/label (if keycard? (i18n/label (if keycard?

View File

@ -30,8 +30,8 @@
[react/view {:style {:flex-direction :row}} [react/view {:style {:flex-direction :row}}
(if prices-loading? (if prices-loading?
[react/small-loading-indicator :colors/white-persist] [react/small-loading-indicator :colors/white-persist]
[react/text {:style {:color colors/white-persist :font-weight "500"} [react/text {:style {:color colors/white-persist :font-weight "500"}
:accessibility-label "account-total-value"} portfolio-value]) :accessibility-label "account-total-value"} portfolio-value])
[react/text {:style {:color colors/white-transparent-persist :font-weight "500"}} (str " " (:code currency))]] [react/text {:style {:color colors/white-transparent-persist :font-weight "500"}} (str " " (:code currency))]]
[react/touchable-highlight [react/touchable-highlight
{:on-press #(re-frame/dispatch [:show-popover {:on-press #(re-frame/dispatch [:show-popover
@ -39,10 +39,12 @@
[icons/icon :main-icons/share {:color colors/white-persist}]]] [icons/icon :main-icons/share {:color colors/white-persist}]]]
[react/view [react/view
[react/text {:style {:color colors/white-persist :font-weight "500" :line-height 22}} name] [react/text {:style {:color colors/white-persist :font-weight "500" :line-height 22}} name]
[react/text {:number-of-lines 1 :ellipsize-mode :middle [quo/text {:number-of-lines 1
:style {:line-height 22 :font-size 13 :ellipsize-mode :middle
:font-family "monospace" :size :small
:color colors/white-transparent-70-persist}} :monospace true
:style {:line-height 22
:color colors/white-transparent-70-persist}}
address]]]])) address]]]]))
(defn add-card [] (defn add-card []

View File

@ -64,6 +64,7 @@
{:label (i18n/label :t/wallet-key-title) {:label (i18n/label :t/wallet-key-title)
:auto-focus false :auto-focus false
:default-value scanned-address :default-value scanned-address
:monospace true
:placeholder (i18n/label :t/enter-address) :placeholder (i18n/label :t/enter-address)
:accessibility-label :add-account-enter-watch-address :accessibility-label :add-account-enter-watch-address
:on-change-text #(re-frame/dispatch [:set-in [:add-account :address] %])}] :on-change-text #(re-frame/dispatch [:set-in [:add-account :address] %])}]
@ -92,6 +93,7 @@
:height 95 :height 95
:error account-error :error account-error
:accessibility-label :add-account-enter-seed :accessibility-label :add-account-enter-seed
:monospace true
:on-change-text :on-change-text
#(do #(do
(re-frame/dispatch [:set-in [:add-account :account-error] nil]) (re-frame/dispatch [:set-in [:add-account :account-error] nil])

View File

@ -48,6 +48,7 @@
{:on-change-text #(debounce-and-save :contract %) {:on-change-text #(debounce-and-save :contract %)
:error error :error error
:default-value contract :default-value contract
:monospace true
:multiline true :multiline true
:height 78 :height 78
:auto-focus false :auto-focus false

View File

@ -24,11 +24,10 @@
{:label :t/wallet-address {:label :t/wallet-address
:container-style {:margin-top 12 :margin-bottom 4} :container-style {:margin-top 12 :margin-bottom 4}
:copied-text (eip55/address->checksum address)} :copied-text (eip55/address->checksum address)}
[react/text {:number-of-lines 1 [quo/text {:number-of-lines 1
:ellipsize-mode :middle :ellipsize-mode :middle
:accessibility-label :address-text :accessibility-label :address-text
:style {:line-height 22 :font-size 15 :monospace true}
:font-family "monospace"}}
(eip55/address->checksum address)]]] (eip55/address->checksum address)]]]
[react/view {:padding-top 12 [react/view {:padding-top 12
:padding-horizontal 16 :padding-horizontal 16

View File

@ -47,9 +47,7 @@
:font-size 16}) :font-size 16})
(def address-hash (def address-hash
{:flex-shrink 1 {:flex-shrink 1})
:font-size 16
:color colors/gray})
(defn transaction-icon-background [color] (defn transaction-icon-background [color]
{:justify-content :center {:justify-content :center

View File

@ -63,10 +63,12 @@
[react/text {:style styles/address-contact [react/text {:style styles/address-contact
:accessibility-label contact-accessibility-label} :accessibility-label contact-accessibility-label}
contact]) contact])
[react/text {:style styles/address-hash [quo/text {:style styles/address-hash
:ellipsize-mode "middle" :monospace true
:number-of-lines 1 :color :secondary
:accessibility-label address-accessibility-label} :ellipsize-mode "middle"
:number-of-lines 1
:accessibility-label address-accessibility-label}
address]]] address]]]
[list/item-icon {:icon :main-icons/next [list/item-icon {:icon :main-icons/next
:style {:margin-top 10} :style {:margin-top 10}
@ -169,18 +171,23 @@
([label props-value] ([label props-value]
(details-list-row label props-value nil)) (details-list-row label props-value nil))
([label props-value extra-props-value] ([label props-value extra-props-value]
(let [[props value] (if (string? props-value) (let [[props value] (if (string? props-value)
[nil props-value] [nil props-value]
props-value) props-value)
[extra-props extra-value] (if (string? extra-props-value) [extra-props extra-value] (if (string? extra-props-value)
[nil extra-props-value] [nil extra-props-value]
extra-props-value)] extra-props-value)]
[react/view {:style styles/details-row} [react/view {:style styles/details-row}
[react/i18n-text {:style styles/details-item-label :key label}] [react/i18n-text {:style styles/details-item-label :key label}]
[react/view {:style styles/details-item-value-wrapper} [react/view {:style styles/details-item-value-wrapper}
[react/text (merge {:style styles/details-item-value} props) [quo/text (merge {:size :small
:monospace true}
props)
(str (or value "-"))] (str (or value "-"))]
[react/text (merge {:style styles/details-item-extra-value} extra-props) [quo/text (merge {:size :small
:color :secondary
:monospace true}
extra-props)
(str extra-value)]]]))) (str extra-value)]]])))
(defn details-list (defn details-list
@ -204,10 +211,10 @@
(when (or to-wallet to-contact) (when (or to-wallet to-contact)
[{:accessibility-label :recipient-address-text} [{:accessibility-label :recipient-address-text}
to])] to])]
[details-list-row :t/gas-limit gas-limit] [details-list-row :t/gas-limit [{:monospace true} gas-limit]]
[details-list-row :t/gas-price gas-price-gwei gas-price-eth] [details-list-row :t/gas-price gas-price-gwei [{:monospace false} gas-price-eth]]
[details-list-row :t/gas-used gas-used] [details-list-row :t/gas-used gas-used]
[details-list-row :t/cost-fee cost] [details-list-row :t/cost-fee [{:monospace false} cost]]
[details-list-row :t/nonce nonce] [details-list-row :t/nonce nonce]
[details-list-row :t/data data]]) [details-list-row :t/data data]])