Fix navigation. Change image to icon.

This commit is contained in:
virvar 2016-05-10 10:59:38 +03:00
parent ee4a4a6f65
commit ee7de39274
5 changed files with 16 additions and 22 deletions

View File

@ -125,7 +125,7 @@
:height 13}
:handler (fn [])}]
[{:title "Profile"
:icon "icon_menu_group"
:icon :menu_group
:icon-style {:width 25
:height 19}
:handler #(dispatch [:show-profile @chat-id])}])]

View File

@ -64,7 +64,7 @@
[action-button-item {:title "New Group Chat"
:buttonColor "#1abc9c"
:onPress (fn []
(dispatch [:show-group-new navigator]))}
(dispatch [:show-group-new]))}
[icon {:name "person-stalker"
:style {:fontSize 20
:height 22

View File

@ -6,13 +6,12 @@
text
text-input
image
icon
scroll-view
navigator
touchable-highlight
touchable-opacity]]
[syng-im.resources :as res]
[syng-im.components.profile-styles :as st]
[syng-im.navigation :refer [nav-pop]]))
[syng-im.components.profile-styles :as st]))
(defn user-photo [{:keys [photo-path]}]
[image {:source (if (s/blank? photo-path)
@ -34,21 +33,19 @@
[text {:style st/profile-property-view-value}
value]]])
(defn message-user [navigator identity]
(defn message-user [identity]
(when identity
(dispatch [:show-chat identity navigator :push])))
(dispatch [:show-chat identity nil :push])))
(defn profile [{:keys [navigator]}]
(defn profile []
(let [contact (subscribe [:contact])]
(fn [{:keys [navigator]}]
(fn []
[scroll-view {:style st/profile}
[touchable-highlight {:style st/profile-back-button-touchable
:on-press (fn []
(nav-pop navigator))
:on-press #(dispatch [:navigate-back])
:underlay-color :transparent}
[view st/profile-back-button-container
[image {:source {:uri "icon_back"}
:style st/profile-back-button-icon}]]]
[icon :back st/profile-back-button-icon]]]
[view st/status-block
[view st/user-photo-container
[user-photo {}]
@ -58,8 +55,7 @@
[text {:style st/status}
"!not implemented"]
[view st/btns-container
[touchable-highlight {:onPress #(message-user navigator
(:whisper-identity @contact))
[touchable-highlight {:onPress #(message-user (:whisper-identity @contact))
:underlay-color :transparent}
[view st/message-btn
[text {:style st/message-btn-text}
@ -69,8 +65,7 @@
)
:underlay-color :transparent}
[view st/more-btn
[image {:source {:uri "icon_more_vertical_blue"}
:style st/more-btn-image}]]]]]
[icon :more_vertical_blue st/more-btn-image]]]]]
[view st/profile-properties-container
[profile-property-view {:name "Username"
:value (:name @contact)}]

View File

@ -15,8 +15,7 @@
toolbar-background1]]
[syng-im.components.realm :refer [list-view]]
[syng-im.utils.listview :refer [to-realm-datasource]]
[reagent.core :as r]
[syng-im.navigation :refer [nav-pop]]))
[reagent.core :as r]))
(defn toolbar [{:keys [navigator title nav-action action background-color]}]
[view {:style {:flexDirection "row"
@ -30,7 +29,7 @@
:alignItems "center"
:justifyContent "center"}
[image (:image nav-action)]]]
[touchable-highlight {:on-press #(nav-pop navigator)}
[touchable-highlight {:on-press #(dispatch [:navigate-back])}
[view {:width 56
:height 56}
[image {:source {:uri "icon_back"}

View File

@ -561,9 +561,9 @@
db)))
(register-handler :show-group-new
(fn [db [action navigator]]
(fn [db [action]]
(log/debug action)
(nav-push navigator {:view-id :new-group})
(dispatch [:navigate-to :new-group])
(clear-new-group db)))
(register-handler :select-for-new-group