From d3cfaa7196fd38cb3c2c890e6885f4060561d6bd Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Wed, 11 May 2016 14:58:03 +0300 Subject: [PATCH] chats-list screen styles Former-commit-id: bb0a6c848f70fbb2a79c59bb2a9350a6a6bcbc11 --- src/syng_im/chats_list/screen.cljs | 27 +++++++++++---------------- src/syng_im/chats_list/styles.cljs | 25 +++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/src/syng_im/chats_list/screen.cljs b/src/syng_im/chats_list/screen.cljs index a9e238288f..96320dc886 100644 --- a/src/syng_im/chats_list/screen.cljs +++ b/src/syng_im/chats_list/screen.cljs @@ -22,17 +22,17 @@ text1-color text2-color]] [syng-im.components.toolbar :refer [toolbar]] - [syng-im.components.icons.ionicons :refer [icon]])) + [syng-im.components.icons.ionicons :refer [icon]] + [syng-im.chats-list.styles :as st])) + (defn chats-list-toolbar [] - [toolbar {:nav-action {:image {:source {:uri "icon_hamburger"} - :style {:width 16 - :height 12}} + [toolbar {:nav-action {:image {:source {:uri :icon_hamburger} + :style st/hamburger-icon } :handler (fn [])} :title "Chats" - :action {:image {:source {:uri "icon_search"} - :style {:width 17 - :height 17}} + :action {:image {:source {:uri :icon_search} + :style st/search-icon} :handler (fn [])}}]) (defn chats-list [] @@ -40,27 +40,22 @@ (fn [] (let [chats @chats datasource (to-realm-datasource chats)] - [view {:flex 1 - :backgroundColor :white} + [view st/chats-container [chats-list-toolbar] [list-view {:dataSource datasource :renderRow (fn [row _ _] (r/as-element [chat-list-item row])) - :style {:backgroundColor :white}}] + :style st/list-container}] [action-button {:buttonColor color-blue} [action-button-item {:title "New Chat" :buttonColor :#9b59b6 :onPress #(dispatch [:navigate-to :contact-list])} [icon {:name :android-create - :style {:fontSize 20 - :height 22 - :color :white}}]] + :style st/create-icon}]] [action-button-item {:title "New Group Chat" :buttonColor :#1abc9c :onPress #(dispatch [:show-group-new])} [icon {:name :person-stalker - :style {:fontSize 20 - :height 22 - :color :white}}]]]])))) + :style st/person-stalker-icon}]]]])))) diff --git a/src/syng_im/chats_list/styles.cljs b/src/syng_im/chats_list/styles.cljs index 14594cc72c..5b37f27122 100644 --- a/src/syng_im/chats_list/styles.cljs +++ b/src/syng_im/chats_list/styles.cljs @@ -120,3 +120,28 @@ :fontSize 10 :color color-blue :textAlign :center}) + +(def hamburger-icon + {:width 16 + :height 12}) + +(def search-icon + {:width 17 + :height 17}) + +(def chats-container + {:flex 1 + :backgroundColor :white}) + +(def list-container + {:backgroundColor :white}) + +(def create-icon + {:fontSize 20 + :height 22 + :color :white}) + +(def person-stalker-icon + {:fontSize 20 + :height 22 + :color :white})