update select user screen

This commit is contained in:
Adrian Tiberius 2016-07-05 18:56:17 +03:00
parent 15955ffb98
commit 6e42338fdc
5 changed files with 14 additions and 8 deletions

View File

@ -6,6 +6,7 @@
[status-im.utils.types :refer [json->clj]]
[status-im.persistence.simple-kv-store :as kv]
[status-im.protocol.state.storage :as storage]
[status-im.utils.identicon :refer [identicon]]
[clojure.string :as str]))
@ -25,7 +26,9 @@
public-key (:pubkey data)
address (:address data)
account {:public-key public-key
:address address}]
:address address
:name address
:photo-path (identicon address)}]
(log/debug "Created account: " result)
(when (not (str/blank? public-key))
(do

View File

@ -14,6 +14,7 @@
[status-im.discovery.screen :refer [discovery]]
[status-im.discovery.tag :refer [discovery-tag]]
[status-im.chat.screen :refer [chat]]
[status-im.login.screen :refer [login]]
[status-im.users.screen :refer [users]]
[status-im.chats-list.screen :refer [chats-list]]
[status-im.new-group.screen :refer [new-group]]

View File

@ -17,8 +17,10 @@
:optinal true}}}
{:name :accounts
:primaryKey :address
:properties {:address "string"
:public-key "string"}}
:properties {:address "string"
:public-key "string"
:name "string"
:photo-path "string"}}
{:name :requests
:properties {:message-id :string
:chat-id :string

View File

@ -39,9 +39,9 @@
(defview users []
[accounts [:get :accounts]]
(let [accounts (conj accounts {:name (label :t/add-account)
:address "0x0"
:photo-path :icon_plus})]
(let [accounts (conj (vals accounts) {:name (label :t/add-account)
:address "0x0"
:photo-path :icon_plus})]
[view st/screen-container
[linear-gradient {:colors ["rgba(182, 116, 241, 1)" "rgba(107, 147, 231, 1)" "rgba(43, 171, 238, 1)"]
:start [0, 0]

View File

@ -15,7 +15,7 @@
(dispatch [:navigate-to :login address])
(dispatch [:set-in [:login :address] address]))
(defview user-view [{:keys [address photo-path name ] :as account}]
(defview user-view [{:keys [address photo-path name] :as account}]
[current-account [:get :current-account]]
[touchable-highlight
{:onPress #(on-press address)}
@ -29,7 +29,7 @@
:style icon-plus}])]]
[view st/name-container
[text {:style st/name-text
:numberOfLines 1} name]
:numberOfLines 1} (or name address)]
(when (not= address "0x0")
[text {:style st/address-text
:numberOfLines 1} address])]