From 54da5d5005afd0ee97a489262dd488dca95fd841 Mon Sep 17 00:00:00 2001 From: Alexander Pantyuhov Date: Thu, 3 Nov 2016 00:19:45 +0300 Subject: [PATCH] Add contact form fixes (#405) Former-commit-id: 11c477756c7a5d8a2799387aaf7e4fc6be02b944 --- src/status_im/contacts/styles.cljs | 3 +- src/status_im/contacts/views/new_contact.cljs | 30 +++++++++++-------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/status_im/contacts/styles.cljs b/src/status_im/contacts/styles.cljs index 982518c7d0..796a401e79 100644 --- a/src/status_im/contacts/styles.cljs +++ b/src/status_im/contacts/styles.cljs @@ -189,7 +189,8 @@ (def form-container {:margin-left 16 - :margin-top 16}) + :margin-top 16 + :height 72}) (def address-explication-container {:flex 1 diff --git a/src/status_im/contacts/views/new_contact.cljs b/src/status_im/contacts/views/new_contact.cljs index fc982f6a2d..59535c26a0 100644 --- a/src/status_im/contacts/views/new_contact.cljs +++ b/src/status_im/contacts/views/new_contact.cljs @@ -13,9 +13,10 @@ [status-im.components.status-bar :refer [status-bar]] [status-im.components.toolbar.view :refer [toolbar]] [status-im.components.toolbar.styles :refer [toolbar-title-container - toolbar-title-text]] + toolbar-title-text + toolbar-background1]] [status-im.utils.utils :refer [log http-post]] - [status-im.components.styles :refer [icon-search + [status-im.components.styles :refer [icon-ok icon-back button-input-container button-input]] @@ -25,7 +26,8 @@ [status-im.contacts.validations :as v] [status-im.contacts.styles :as st] [status-im.utils.gfycat.core :refer [generate-gfy]] - [status-im.utils.hex :refer [normalize-hex]])) + [status-im.utils.hex :refer [normalize-hex]] + [status-im.utils.platform :refer [platform-specific]])) (def toolbar-title @@ -69,7 +71,7 @@ [{:image {:source {:uri (if (str/blank? error-message) :icon_ok_blue :icon_ok_disabled)} - :style icon-search} + :style icon-ok} :handler #(when (str/blank? error-message) (on-add-contact new-contact-identity))}])) @@ -89,7 +91,9 @@ (dispatch [:set-in [:new-contact-identity] %]) (dispatch [:set :new-contact-address-error nil]))}] [scan-button {:showLabel (zero? (count whisper-identity)) - :handler #(dispatch [:scan-qr-code {:toolbar-title (label :t/new-contact)} :set-contact-identity-from-qr])}]])) + :handler #(dispatch [:scan-qr-code + {:toolbar-title (label :t/new-contact)} + :set-contact-identity-from-qr])}]])) (defview new-contact [] @@ -97,14 +101,14 @@ error [:get :new-contact-address-error] account [:get-current-account]] [view st/contact-form-container - [view - [status-bar] - [toolbar {:background-color :white - :nav-action {:image {:source {:uri :icon_back} - :style icon-back} - :handler #(dispatch [:navigate-back])} - :custom-content toolbar-title - :actions (toolbar-actions new-contact-identity account error)}]] + [status-bar] + [toolbar {:background-color toolbar-background1 + :style (get-in platform-specific [:component-styles :toolbar]) + :nav-action {:image {:source {:uri :icon_back} + :style icon-back} + :handler #(dispatch [:navigate-back])} + :title (label :t/add-new-contact) + :actions (toolbar-actions new-contact-identity account error)}] [view st/form-container [contact-whisper-id-input new-contact-identity error]] [view st/address-explication-container