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