Transaction screen on iOS (#407)

Former-commit-id: 2fbe7dbc597ed40da530a6c5456dd7f4025f4e9a
This commit is contained in:
Alexander Pantyuhov 2016-11-02 23:41:52 +03:00
parent 321935e8ca
commit abea6ab803
3 changed files with 25 additions and 19 deletions

View File

@ -11,6 +11,7 @@
[status-im.components.styles :refer [icon-ok [status-im.components.styles :refer [icon-ok
icon-close]] icon-close]]
[status-im.components.carousel.carousel :refer [carousel]] [status-im.components.carousel.carousel :refer [carousel]]
[status-im.components.status-bar :refer [status-bar]]
[status-im.components.toolbar.view :refer [toolbar]] [status-im.components.toolbar.view :refer [toolbar]]
[status-im.components.toolbar.styles :refer [toolbar-title-container]] [status-im.components.toolbar.styles :refer [toolbar-title-container]]
[status-im.components.text-field.view :refer [text-field]] [status-im.components.text-field.view :refer [text-field]]
@ -25,6 +26,7 @@
{:keys [password]} [:get :confirm-transactions] {:keys [password]} [:get :confirm-transactions]
wrong-password? [:wrong-password?]] wrong-password? [:wrong-password?]]
[view st/transactions-screen [view st/transactions-screen
[status-bar {:type :transparent}]
[toolbar [toolbar
{:style st/transactions-toolbar {:style st/transactions-toolbar
:nav-action {:image {:source {:uri :icon_close_white} :nav-action {:image {:source {:uri :icon_close_white}
@ -41,19 +43,19 @@
[view st/carousel-container [view st/carousel-container
[carousel {:pageStyle st/carousel-page-style [carousel {:pageStyle st/carousel-page-style
:gap 16 :gap 16
:count (count transactions) :sneak 20
:sneak 20} :count (count transactions)}
(when transactions (when transactions
(for [transaction transactions] (for [transaction transactions]
[transaction-page transaction]))]] [transaction-page transaction]))]]
[view st/form-container [view st/form-container
[text-field [text-field
{:input-style st/password-style {:editable true
:secure-text-entry true
:error (when wrong-password? (label :t/wrong-password)) :error (when wrong-password? (label :t/wrong-password))
:error-color :#ffffff80 #_:#7099e6 :error-color :#ffffff80 #_:#7099e6
:line-color :white
:label-color :#ffffff80
:value password
:label (label :t/password) :label (label :t/password)
:secure-text-entry true
:label-color :#ffffff80
:line-color :white
:input-style st/password-style
:on-change-text #(dispatch [:set-in [:confirm-transactions :password] %])}]]]) :on-change-text #(dispatch [:set-in [:confirm-transactions :password] %])}]]])

View File

@ -20,7 +20,8 @@
:paddingLeft 16}) :paddingLeft 16})
(def password-style (def password-style
{:color :white}) {:color :white
:font-size 12})
;transaction-page ;transaction-page
@ -35,8 +36,9 @@
(def title-bar-text (def title-bar-text
{:color "#838c93" {:color "#838c93"
:fontSize 13 :font-size 13
:marginLeft 12}) :margin-left 12
:margin-right 30})
(def icon-close-container (def icon-close-container
{:position :absolute {:position :absolute
@ -63,9 +65,7 @@
(def transaction-info-row (def transaction-info-row
{:flex 1 {:flex 1
:flexDirection :row :flexDirection :row})
:height 20
})
(def transaction-info-column-title (def transaction-info-column-title
{:flex 0.4 {:flex 0.4

View File

@ -11,11 +11,15 @@
[status-im.components.styles :refer [icon-ok [status-im.components.styles :refer [icon-ok
icon-close]] icon-close]]
[status-im.transactions.styles :as st] [status-im.transactions.styles :as st]
[status-im.i18n :refer [label label-pluralize]])) [status-im.i18n :refer [label label-pluralize]]
[taoensso.timbre :as log]))
(defn title-bar [title id] (defn title-bar [title id]
[view st/title-bar [view st/title-bar
[text {:style st/title-bar-text} title] [text {:style st/title-bar-text
:font :medium
:number-of-lines 1}
title]
[touchable-highlight {:style st/icon-close-container [touchable-highlight {:style st/icon-close-container
:on-press #(dispatch [:deny-transaction id])} :on-press #(dispatch [:deny-transaction id])}
[view [image {:source {:uri :icon_close_gray} [view [image {:source {:uri :icon_close_gray}
@ -33,9 +37,9 @@
(defview transaction-page [{:keys [id from to value] :as transaction}] (defview transaction-page [{:keys [id from to value] :as transaction}]
[{:keys [name] :as contact} [:contact-by-address to]] [{:keys [name] :as contact} [:contact-by-address to]]
(let [eth-value (.fromWei js/Web3.prototype value "ether") (let [eth-value (.fromWei js/Web3.prototype value "ether")
title (str eth-value " ETH to " name) title (str eth-value " ETH to " (or name to))
transactions-info [[(label :t/status) (label :t/pending-confirmation)] transactions-info [[(label :t/status) (label :t/pending-confirmation)]
[(label :t/recipient) name] [(label :t/recipient) (or name to)]
[(label :t/value) (str eth-value " ETH")]]] [(label :t/value) (str eth-value " ETH")]]]
[view {:style st/transaction-page [view {:style st/transaction-page
:key id} :key id}