fixed wallet ui issues

This commit is contained in:
Andrey Shovkoplyas 2017-10-17 13:37:13 +03:00 committed by Oskar Thorén
parent 86b8a38f08
commit 3ed2fb6a07
5 changed files with 20 additions and 13 deletions

View File

@ -23,16 +23,20 @@
(case position (case position
:first {:border-bottom-left-radius radius :first {:border-bottom-left-radius radius
:border-top-left-radius radius :border-top-left-radius radius
:ios {:border-width 1}} :ios {:border-top-width 1
:last {:border-bottom-right-radius radius :border-left-width 1
:border-top-right-radius radius :border-bottom-width 1}}
:ios {:border-width 1}} :last {:border-bottom-right-radius radius
:border-top-right-radius radius
:ios {:border-top-width 1
:border-right-width 1
:border-bottom-width 1}}
{:android {:border-left-width 1 {:android {:border-left-width 1
:border-right-width 1} :border-right-width 1}
:ios {:border-width 1}}))) :ios {:border-width 1}})))
(defnstyle button-bar [position] (defnstyle button-bar [position]
(merge {:border-color border-color} (merge {:border-color border-color}
(border position))) (border position)))
(defnstyle button-text [disabled?] (defnstyle button-text [disabled?]
@ -40,9 +44,9 @@
:color styles/color-white :color styles/color-white
:padding-horizontal 16 :padding-horizontal 16
:android (merge :android (merge
{:font-size 14 {:font-size 14
:padding-vertical 10 :padding-vertical 10
:letter-spacing 0.5} :letter-spacing 0.5}
(when disabled? {:opacity 0.4})) (when disabled? {:opacity 0.4}))
:ios (merge :ios (merge
{:font-size 15 {:font-size 15

View File

@ -121,8 +121,7 @@
(def separator (def separator
{:height 1 {:height 1
:margin-horizontal 15 :margin-horizontal 15
:background-color styles/color-white-transparent-1 :background-color styles/color-white-transparent-1})
:margin-top 16})
(def button-text (def button-text
{:color :white {:color :white

View File

@ -101,7 +101,7 @@
(defstyle buttons (defstyle buttons
{:margin-top 34 {:margin-top 34
:android {:margin-horizontal 21} :android {:margin-horizontal 21}
:ios {:margin-horizontal 29}}) :ios {:margin-horizontal 30}})
(defstyle main-button-text (defstyle main-button-text
{:padding-vertical 13 {:padding-vertical 13

View File

@ -101,14 +101,16 @@
(re-frame/dispatch [:navigate-to :choose-recipient])))) (re-frame/dispatch [:navigate-to :choose-recipient]))))
(defview send-transaction [] (defview send-transaction []
(letsubs [transaction [:wallet.send/transaction]] (letsubs [transaction [:wallet.send/transaction]
scroll (atom nil)]
(let [{:keys [amount amount-error signing? to-address to-name in-progress? sufficient-funds?]} transaction] (let [{:keys [amount amount-error signing? to-address to-name in-progress? sufficient-funds?]} transaction]
[react/keyboard-avoiding-view wallet.styles/wallet-modal-container [react/keyboard-avoiding-view wallet.styles/wallet-modal-container
[react/view components.styles/flex [react/view components.styles/flex
[status-bar/status-bar {:type :wallet}] [status-bar/status-bar {:type :wallet}]
[toolbar-view signing?] [toolbar-view signing?]
[common/network-info {:text-color :white}] [common/network-info {:text-color :white}]
[react/scroll-view {:keyboardShouldPersistTaps :always} [react/scroll-view {:keyboardShouldPersistTaps :always
:ref #(reset! scroll %)}
[react/view components.styles/flex [react/view components.styles/flex
[react/view wallet.styles/choose-participant-container [react/view wallet.styles/choose-participant-container
[components/choose-recipient {:address to-address [components/choose-recipient {:address to-address
@ -121,6 +123,7 @@
{:error (or amount-error {:error (or amount-error
(when-not sufficient-funds? (i18n/label :t/wallet-insufficient-funds))) (when-not sufficient-funds? (i18n/label :t/wallet-insufficient-funds)))
:input-options {:auto-focus true :input-options {:auto-focus true
:on-focus (fn [] (when @scroll (js/setTimeout #(.scrollToEnd @scroll) 100)))
:default-value amount :default-value amount
:on-change-text #(re-frame/dispatch [:wallet/set-and-validate-amount %])}}] :on-change-text #(re-frame/dispatch [:wallet/set-and-validate-amount %])}}]
[react/view wallet.styles/choose-currency-container [react/view wallet.styles/choose-currency-container

View File

@ -64,6 +64,7 @@
(def amount-container (def amount-container
{:margin-top 16 {:margin-top 16
:margin-bottom 16
:margin-horizontal 15 :margin-horizontal 15
:flex-direction :row}) :flex-direction :row})