kyber ui (image source support and placeholder color)

Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
Andrey Shovkoplyas 2018-12-06 12:40:13 +01:00
parent 915ccbebbb
commit fb6d632780
No known key found for this signature in database
GPG Key ID: EAAB7C8622D860A4
2 changed files with 11 additions and 12 deletions

View File

@ -276,8 +276,9 @@
[button/secondary-button (merge {:disabled? (or (when (contains? m :enabled) (or (nil? enabled) (false? enabled))) disabled)} [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]) (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} [react/text-input (merge {:placeholder placeholder}
(when placeholder-text-color {:placeholder-text-color placeholder-text-color})
(when style {:style style}) (when style {:style style})
(when keyboard-type {:keyboard-type keyboard-type}) (when keyboard-type {:keyboard-type keyboard-type})
(when on-change (when on-change
@ -287,8 +288,8 @@
(into [react/touchable-opacity (merge (when on-press {:on-press #(re-frame/dispatch (on-press {}))}) (into [react/touchable-opacity (merge (when on-press {:on-press #(re-frame/dispatch (on-press {}))})
(when style {:style style}))] children)) (when style {:style style}))] children))
(defn image [{:keys [uri style]}] (defn image [{:keys [source uri style]}]
[react/image (merge {:style (merge {:width 100 :height 100} style)} {:source {:uri uri}})]) [react/image (merge {:style (merge {:width 100 :height 100} style)} {:source (if source source {:uri uri})})])
(defn link [{:keys [uri]}] (defn link [{:keys [uri]}]
[react/text [react/text
@ -341,9 +342,9 @@
{:components {'view {:value view} {:components {'view {:value view}
'text {:value text} 'text {:value text}
'touchable-opacity {:value touchable-opacity :properties {:on-press :event}} 'touchable-opacity {:value touchable-opacity :properties {:on-press :event}}
'icon {:value icon :properties {:key :keyword :color :keyword}} 'icon {:value icon :properties {:key :keyword :color :any}}
'image {:value image :properties {:uri :string}} 'image {:value image :properties {:uri :string :source :numeric}}
'input {:value input :properties {:on-change :event :placeholder :string :keyboard-type :keyword}} '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}} 'button {:value button :properties {:enabled :boolean :disabled :boolean :on-click :event}}
'link {:value link :properties {:uri :string}} 'link {:value link :properties {:uri :string}}
'list {:value list :properties {:data :vector :item-view :view :key? :keyword}} 'list {:value list :properties {:data :vector :item-view :view :key? :keyword}}

View File

@ -11,7 +11,8 @@
[status-im.ui.components.status-bar.view :as status-bar] [status-im.ui.components.status-bar.view :as status-bar]
[status-im.ui.screens.wallet.styles :as wallet.styles] [status-im.ui.screens.wallet.styles :as wallet.styles]
[status-im.utils.ethereum.core :as ethereum] [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 (def hook
"Hook for extensions" "Hook for extensions"
@ -60,11 +61,8 @@
[react/view {:style {:flex 1 :background-color colors/white}} [react/view {:style {:flex 1 :background-color colors/white}}
[status-bar/status-bar {:type :modal-wallet}] [status-bar/status-bar {:type :modal-wallet}]
[toolbar/toolbar {:style wallet.styles/toolbar} [toolbar/toolbar {:style wallet.styles/toolbar}
[toolbar/nav-text {:handler #(do (re-frame/dispatch [:update-wallet]) [toolbar/nav-button (actions/back-white #(do (re-frame/dispatch [:update-wallet])
(re-frame/dispatch [:navigate-back])) (re-frame/dispatch [:navigate-back])))]
:style {:color colors/white}
:accessibility-label :done-button}
(i18n/label :t/done)]
[toolbar/content-title {:color colors/white} [toolbar/content-title {:color colors/white}
label]] label]]
[view]])) [view]]))