From fb6d6327803552fc718214e3e98b31fc17c2d549 Mon Sep 17 00:00:00 2001 From: Andrey Shovkoplyas Date: Thu, 6 Dec 2018 12:40:13 +0100 Subject: [PATCH] kyber ui (image source support and placeholder color) Signed-off-by: Andrey Shovkoplyas --- src/status_im/extensions/core.cljs | 13 +++++++------ src/status_im/ui/screens/wallet/settings/views.cljs | 10 ++++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/status_im/extensions/core.cljs b/src/status_im/extensions/core.cljs index 840671929a..2890f58829 100644 --- a/src/status_im/extensions/core.cljs +++ b/src/status_im/extensions/core.cljs @@ -276,8 +276,9 @@ [button/secondary-button (merge {:disabled? (or (when (contains? m :enabled) (or (nil? enabled) (false? enabled))) disabled)} (when on-click {:on-press #(re-frame/dispatch (on-click {}))})) label]) -(defn input [{:keys [keyboard-type style on-change placeholder]}] +(defn input [{:keys [keyboard-type style on-change placeholder placeholder-text-color]}] [react/text-input (merge {:placeholder placeholder} + (when placeholder-text-color {:placeholder-text-color placeholder-text-color}) (when style {:style style}) (when keyboard-type {:keyboard-type keyboard-type}) (when on-change @@ -287,8 +288,8 @@ (into [react/touchable-opacity (merge (when on-press {:on-press #(re-frame/dispatch (on-press {}))}) (when style {:style style}))] children)) -(defn image [{:keys [uri style]}] - [react/image (merge {:style (merge {:width 100 :height 100} style)} {:source {:uri uri}})]) +(defn image [{:keys [source uri style]}] + [react/image (merge {:style (merge {:width 100 :height 100} style)} {:source (if source source {:uri uri})})]) (defn link [{:keys [uri]}] [react/text @@ -341,9 +342,9 @@ {:components {'view {:value view} 'text {:value text} 'touchable-opacity {:value touchable-opacity :properties {:on-press :event}} - 'icon {:value icon :properties {:key :keyword :color :keyword}} - 'image {:value image :properties {:uri :string}} - 'input {:value input :properties {:on-change :event :placeholder :string :keyboard-type :keyword}} + 'icon {:value icon :properties {:key :keyword :color :any}} + 'image {:value image :properties {:uri :string :source :numeric}} + 'input {:value input :properties {:on-change :event :placeholder :string :keyboard-type :keyword :placeholder-text-color :any}} 'button {:value button :properties {:enabled :boolean :disabled :boolean :on-click :event}} 'link {:value link :properties {:uri :string}} 'list {:value list :properties {:data :vector :item-view :view :key? :keyword}} diff --git a/src/status_im/ui/screens/wallet/settings/views.cljs b/src/status_im/ui/screens/wallet/settings/views.cljs index bc13689091..76ef4d2688 100644 --- a/src/status_im/ui/screens/wallet/settings/views.cljs +++ b/src/status_im/ui/screens/wallet/settings/views.cljs @@ -11,7 +11,8 @@ [status-im.ui.components.status-bar.view :as status-bar] [status-im.ui.screens.wallet.styles :as wallet.styles] [status-im.utils.ethereum.core :as ethereum] - [status-im.utils.ethereum.tokens :as tokens])) + [status-im.utils.ethereum.tokens :as tokens] + [status-im.ui.components.toolbar.actions :as actions])) (def hook "Hook for extensions" @@ -60,11 +61,8 @@ [react/view {:style {:flex 1 :background-color colors/white}} [status-bar/status-bar {:type :modal-wallet}] [toolbar/toolbar {:style wallet.styles/toolbar} - [toolbar/nav-text {:handler #(do (re-frame/dispatch [:update-wallet]) - (re-frame/dispatch [:navigate-back])) - :style {:color colors/white} - :accessibility-label :done-button} - (i18n/label :t/done)] + [toolbar/nav-button (actions/back-white #(do (re-frame/dispatch [:update-wallet]) + (re-frame/dispatch [:navigate-back])))] [toolbar/content-title {:color colors/white} label]] [view]]))