added disabled state for create contact button

Former-commit-id: b5ea433420
This commit is contained in:
Adrian Tiberius 2016-06-21 17:39:05 +03:00
parent a9d2ed2711
commit bfcc63fc05
1 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,7 @@
(ns status-im.contacts.views.new-contact
(:require-macros [status-im.utils.views :refer [defview]])
(:require [re-frame.core :refer [subscribe dispatch dispatch-sync]]
[clojure.string :as str]
[status-im.components.react :refer [view
text
text-input
@ -31,6 +32,9 @@
[text {:style toolbar-title-text}
(label :t/add-new-contact)]])
(defn valid-form? [name address]
(and (not (str/blank? name)) (not (str/blank? address))))
(defview contact-name-input [name]
[]
[text-input
@ -63,7 +67,9 @@
:style icon-back}
:handler #(dispatch [:navigate-back])}
:custom-content toolbar-title
:action {:image {:source {:uri :icon_ok_blue}
:action {:image {:source {:uri (if (valid-form? name whisper-identity)
:icon_ok_blue
:icon_ok_disabled)}
:style icon-search}
:handler #(dispatch [:add-new-contact new-contact])}}]
[view st/form-container