Andrey Shovkoplyas 2017-03-28 14:00:19 +03:00 committed by Roman Volosovskyi
parent 9c89c56679
commit d6a589b5bc
3 changed files with 7 additions and 13 deletions

View File

@ -3,7 +3,7 @@
(:require [reagent.core :as r] (:require [reagent.core :as r]
[clojure.string :as str] [clojure.string :as str]
[re-frame.core :refer [subscribe dispatch dispatch-sync]] [re-frame.core :refer [subscribe dispatch dispatch-sync]]
[status-im.components.common.common :refer [separator]] [status-im.components.common.common :refer [separator top-shaddow bottom-shaddow]]
[status-im.components.react :refer [view [status-im.components.react :refer [view
text text
image image
@ -12,7 +12,6 @@
scroll-view scroll-view
list-view list-view
list-item] :as react] list-item] :as react]
[status-im.components.common.common :refer [top-shaddow bottom-shaddow]]
[status-im.components.native-action-button :refer [native-action-button [status-im.components.native-action-button :refer [native-action-button
native-action-button-item]] native-action-button-item]]
[status-im.components.status-bar :refer [status-bar]] [status-im.components.status-bar :refer [status-bar]]
@ -74,7 +73,7 @@
(when extended? (when extended?
[options-btn group])]) [options-btn group])])
(defn contact-group-form [{:keys [contacts contacts-count group edit? click-handler]}] (defn contact-group-form [{:keys [contacts contacts-count group edit?]}]
(let [subtitle (:name group)] (let [subtitle (:name group)]
[view st/contact-group [view st/contact-group
(when subtitle (when subtitle
@ -90,7 +89,6 @@
[contact-view [contact-view
{:contact contact {:contact contact
:extended? edit? :extended? edit?
:on-click (when-not edit? click-handler)
:extend-options (when group :extend-options (when group
[{:value #(dispatch [:hide-contact contact]) [{:value #(dispatch [:hide-contact contact])
:text (label :t/delete-contact) :text (label :t/delete-contact)
@ -139,7 +137,6 @@
(defview contact-list [current-view?] (defview contact-list [current-view?]
[contacts [:get-added-contacts-with-limit contacts-limit] [contacts [:get-added-contacts-with-limit contacts-limit]
contacts-count [:added-contacts-count] contacts-count [:added-contacts-count]
click-handler [:get :contacts-click-handler]
edit? [:get-in [:contacts-ui-props :edit?]] edit? [:get-in [:contacts-ui-props :edit?]]
groups [:all-added-groups] groups [:all-added-groups]
tabs-hidden? [:tabs-hidden?]] tabs-hidden? [:tabs-hidden?]]
@ -152,13 +149,11 @@
(when (pos? contacts-count) (when (pos? contacts-count)
[contact-group-form {:contacts contacts [contact-group-form {:contacts contacts
:contacts-count contacts-count :contacts-count contacts-count
:edit? edit? :edit? edit?}])
:click-handler click-handler}])
(for [group groups] (for [group groups]
^{:key group} ^{:key group}
[contact-group-view {:group group [contact-group-view {:group group
:edit? edit? :edit? edit?}])]
:click-handler click-handler}])]
[view st/empty-contact-groups [view st/empty-contact-groups
[react/icon :group_big st/empty-contacts-icon] [react/icon :group_big st/empty-contacts-icon]
[text {:style st/empty-contacts-text} (label :t/no-contacts)]]) [text {:style st/empty-contacts-text} (label :t/no-contacts)]])

View File

@ -10,7 +10,8 @@
(defn- on-press [{:keys [whisper-identity] :as contact}] (defn- on-press [{:keys [whisper-identity] :as contact}]
(dispatch [:send-contact-request! contact]) (dispatch [:send-contact-request! contact])
(dispatch [:start-chat whisper-identity {} :navigation-replace])) (dispatch [:navigate-to-clean :chat-list])
(dispatch [:start-chat whisper-identity {}]))
(defn letter-view [letter] (defn letter-view [letter]
[view st/letter-container [view st/letter-container

View File

@ -52,9 +52,7 @@
(replace-view db view-id))) (replace-view db view-id)))
(defn- can-navigate-back? [db] (defn- can-navigate-back? [db]
(and (not (db :creating-account?)) (and (not (db :creating-account?))))
;; ...
))
(register-handler :navigate-back (register-handler :navigate-back
(enrich -preload-data!) (enrich -preload-data!)