parent
3f2c598b2b
commit
c20e7a2424
|
@ -63,8 +63,7 @@
|
|||
:default-chat-icon (st/default-chat-icon-menu-item color)
|
||||
:default-chat-icon-text st/default-chat-icon-text}])
|
||||
|
||||
(defview contact-icon-view [identity styles]
|
||||
[contact [:contact-by-identity identity]]
|
||||
(defn contact-icon-view [contact styles]
|
||||
(let [photo-path (:photo-path contact)
|
||||
;; TODO stub data
|
||||
online true]
|
||||
|
@ -74,8 +73,8 @@
|
|||
[default-chat-icon (:name contact) styles])
|
||||
[contact-online online styles]]))
|
||||
|
||||
(defn contact-icon-contacts-tab [identity]
|
||||
[contact-icon-view identity
|
||||
(defn contact-icon-contacts-tab [contact]
|
||||
[contact-icon-view contact
|
||||
{:container st/container-chat-list
|
||||
:online-view st/online-view
|
||||
:online-dot-left st/online-dot-left
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
[text {:style st/show-all-text} (label :show-all)]]]])
|
||||
|
||||
(defn contact-list []
|
||||
(let [contacts (subscribe [:get-contacts])
|
||||
(let [contacts (subscribe [:all-contacts])
|
||||
show-toolbar-shadow? (r/atom false)]
|
||||
(fn []
|
||||
[drawer-view
|
||||
|
|
|
@ -7,10 +7,14 @@
|
|||
(let [contacts (reaction (:contacts @db))]
|
||||
(reaction (vals @contacts)))))
|
||||
|
||||
(defn sort-contacts [contacts]
|
||||
(sort-by :name #(compare (clojure.string/lower-case %1)
|
||||
(clojure.string/lower-case %2)) (vals contacts)))
|
||||
|
||||
(register-sub :all-contacts
|
||||
(fn [db _]
|
||||
(let [contacts (reaction (:contacts @db))]
|
||||
(reaction (sort-by :name (vals @contacts))))))
|
||||
(reaction (sort-contacts @contacts)))))
|
||||
|
||||
(defn get-contact-letter [contact]
|
||||
(when-let [letter (first (:name contact))]
|
||||
|
@ -20,7 +24,7 @@
|
|||
(fn [db _]
|
||||
(let [contacts (reaction (:contacts @db))]
|
||||
(reaction
|
||||
(let [ordered (sort-by :name (vals @contacts))]
|
||||
(let [ordered (sort-contacts @contacts)]
|
||||
(map (fn [prev cur]
|
||||
(let [prev-letter (get-contact-letter prev)
|
||||
cur-letter (get-contact-letter cur)]
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
[text {:style st/letter-text}
|
||||
letter])])
|
||||
|
||||
(defn contact-photo [{:keys [whisper-identity]}]
|
||||
(defn contact-photo [contact]
|
||||
[view st/contact-photo-container
|
||||
[contact-icon-contacts-tab whisper-identity]])
|
||||
[contact-icon-contacts-tab contact]])
|
||||
|
||||
(defn contact-inner-view [{:keys [name letter] :as contact}]
|
||||
[view st/contact-container
|
||||
|
|
Loading…
Reference in New Issue