cleanup
This commit is contained in:
parent
eab8dd5ca2
commit
5a409ed6bf
|
@ -72,7 +72,7 @@
|
|||
:custom-content toolbar-title
|
||||
:action {:image {:source {:uri :icon_add}
|
||||
:style icon-search}
|
||||
:handler #(dispatch [:add-new-contact (merge new-contact {:photo-path (identicon whisper-identity 40)})])}}]
|
||||
:handler #(dispatch [:add-new-contact (merge {:photo-path (identicon whisper-identity)} new-contact)])}}]
|
||||
[view st/form-container
|
||||
[contact-whisper-id-input whisper-identity]
|
||||
[contact-name-input name]
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
(defn create-contact [{:keys [name photo-path whisper-identity] :as contact}]
|
||||
(->> {:name (or name "")
|
||||
:photo-path (or photo-path (identicon whisper-identity 40))}
|
||||
:photo-path (or photo-path (identicon whisper-identity))}
|
||||
(merge contact)
|
||||
(r/create :contacts)))
|
||||
|
||||
|
|
|
@ -2,8 +2,12 @@
|
|||
(:require [clojure.string :as s]
|
||||
[status-im.utils.utils :as u]))
|
||||
|
||||
(def default-size 40)
|
||||
|
||||
(def identicon-js (u/require "identicon.js"))
|
||||
|
||||
(defn identicon [hash options]
|
||||
(str "data:image/png;base64," (.toString (new identicon-js hash options))))
|
||||
(defn identicon
|
||||
([hash] (identicon hash default-size))
|
||||
([hash options]
|
||||
(str "data:image/png;base64," (.toString (new identicon-js hash options)))))
|
||||
|
||||
|
|
Loading…
Reference in New Issue