Toolbar for contacts view
This commit is contained in:
parent
bbaff31570
commit
902daf3963
|
@ -17,7 +17,8 @@
|
||||||
selected-message-color
|
selected-message-color
|
||||||
separator-color
|
separator-color
|
||||||
text1-color
|
text1-color
|
||||||
text2-color]]
|
text2-color
|
||||||
|
toolbar-background1]]
|
||||||
[syng-im.utils.logging :as log]
|
[syng-im.utils.logging :as log]
|
||||||
[syng-im.navigation :refer [nav-pop]]
|
[syng-im.navigation :refer [nav-pop]]
|
||||||
[syng-im.resources :as res]
|
[syng-im.resources :as res]
|
||||||
|
@ -153,7 +154,7 @@
|
||||||
:icon-style {:width 20
|
:icon-style {:width 20
|
||||||
:height 13}
|
:height 13}
|
||||||
:handler (fn [] )}])]
|
:handler (fn [] )}])]
|
||||||
[view {:style {:backgroundColor color-white
|
[view {:style {:backgroundColor toolbar-background1
|
||||||
:elevation 2
|
:elevation 2
|
||||||
:position "absolute"
|
:position "absolute"
|
||||||
:top 56
|
:top 56
|
||||||
|
@ -186,7 +187,7 @@
|
||||||
(defn toolbar [navigator chat show-actions]
|
(defn toolbar [navigator chat show-actions]
|
||||||
[view {:style {:flexDirection "row"
|
[view {:style {:flexDirection "row"
|
||||||
:height 56
|
:height 56
|
||||||
:backgroundColor color-white
|
:backgroundColor toolbar-background1
|
||||||
:elevation 2}}
|
:elevation 2}}
|
||||||
(when (not show-actions)
|
(when (not show-actions)
|
||||||
[touchable-highlight {:on-press (fn []
|
[touchable-highlight {:on-press (fn []
|
||||||
|
|
|
@ -21,12 +21,13 @@
|
||||||
color-black
|
color-black
|
||||||
color-blue
|
color-blue
|
||||||
text1-color
|
text1-color
|
||||||
text2-color]]
|
text2-color
|
||||||
|
toolbar-background1]]
|
||||||
[syng-im.components.icons.ionicons :refer [icon]]))
|
[syng-im.components.icons.ionicons :refer [icon]]))
|
||||||
|
|
||||||
(defn toolbar []
|
(defn toolbar []
|
||||||
[view {:style {:flexDirection "row"
|
[view {:style {:flexDirection "row"
|
||||||
:backgroundColor color-white
|
:backgroundColor toolbar-background1
|
||||||
:height 56
|
:height 56
|
||||||
:elevation 2}}
|
:elevation 2}}
|
||||||
[touchable-highlight {:on-press (fn []
|
[touchable-highlight {:on-press (fn []
|
||||||
|
|
|
@ -4,9 +4,18 @@
|
||||||
[natal-shell.core :refer [with-error-view]])
|
[natal-shell.core :refer [with-error-view]])
|
||||||
(:require [re-frame.core :refer [subscribe dispatch dispatch-sync]]
|
(:require [re-frame.core :refer [subscribe dispatch dispatch-sync]]
|
||||||
[syng-im.components.react :refer [view text image touchable-highlight
|
[syng-im.components.react :refer [view text image touchable-highlight
|
||||||
navigator list-view toolbar-android
|
navigator list-view
|
||||||
list-item]]
|
list-item]]
|
||||||
[syng-im.components.contact-list.contact :refer [contact-view]]
|
[syng-im.components.contact-list.contact :refer [contact-view]]
|
||||||
|
[syng-im.components.styles :refer [font
|
||||||
|
title-font
|
||||||
|
color-white
|
||||||
|
color-black
|
||||||
|
color-blue
|
||||||
|
text1-color
|
||||||
|
text2-color
|
||||||
|
toolbar-background2]]
|
||||||
|
[syng-im.navigation :refer [nav-pop]]
|
||||||
[syng-im.resources :as res]
|
[syng-im.resources :as res]
|
||||||
[syng-im.utils.logging :as log]))
|
[syng-im.utils.logging :as log]))
|
||||||
|
|
||||||
|
@ -19,18 +28,46 @@
|
||||||
(not= row1 row2))})
|
(not= row1 row2))})
|
||||||
contacts))
|
contacts))
|
||||||
|
|
||||||
|
(defn toolbar [navigator]
|
||||||
|
[view {:style {:flexDirection "row"
|
||||||
|
:backgroundColor toolbar-background2
|
||||||
|
:height 56
|
||||||
|
:elevation 2}}
|
||||||
|
[touchable-highlight {:on-press (fn []
|
||||||
|
(nav-pop navigator))
|
||||||
|
:underlay-color :transparent}
|
||||||
|
[view {:width 56
|
||||||
|
:height 56}
|
||||||
|
[image {:source {:uri "icon_back"}
|
||||||
|
:style {:marginTop 21
|
||||||
|
:marginLeft 23
|
||||||
|
:width 8
|
||||||
|
:height 14}}]]]
|
||||||
|
[view {:style {:flex 1
|
||||||
|
:alignItems "center"
|
||||||
|
:justifyContent "center"}}
|
||||||
|
[text {:style {:marginTop -2.5
|
||||||
|
:color text1-color
|
||||||
|
:fontSize 16
|
||||||
|
:fontFamily font}}
|
||||||
|
"Contacts"]]
|
||||||
|
[touchable-highlight {:on-press (fn []
|
||||||
|
)
|
||||||
|
:underlay-color :transparent}
|
||||||
|
[view {:width 56
|
||||||
|
:height 56}
|
||||||
|
[image {:source {:uri "icon_search"}
|
||||||
|
:style {:margin 19.5
|
||||||
|
:width 17
|
||||||
|
:height 17}}]]]])
|
||||||
|
|
||||||
(defn contact-list [{:keys [navigator]}]
|
(defn contact-list [{:keys [navigator]}]
|
||||||
(let [contacts (subscribe [:get-contacts])]
|
(let [contacts (subscribe [:get-contacts])]
|
||||||
(fn []
|
(fn []
|
||||||
(let [contacts-ds (get-data-source @contacts)]
|
(let [contacts-ds (get-data-source @contacts)]
|
||||||
[view {:style {:flex 1
|
[view {:style {:flex 1
|
||||||
:backgroundColor "white"}}
|
:backgroundColor "white"}}
|
||||||
[toolbar-android {:logo res/logo-icon
|
[toolbar navigator]
|
||||||
:title "Contacts"
|
|
||||||
:titleColor "#4A5258"
|
|
||||||
:style {:backgroundColor "white"
|
|
||||||
:height 56
|
|
||||||
:elevation 2}}]
|
|
||||||
(when contacts-ds
|
(when contacts-ds
|
||||||
[list-view {:dataSource contacts-ds
|
[list-view {:dataSource contacts-ds
|
||||||
:renderRow (partial render-row navigator)
|
:renderRow (partial render-row navigator)
|
||||||
|
|
|
@ -12,11 +12,14 @@
|
||||||
(def color-light-blue "#bbc4cb")
|
(def color-light-blue "#bbc4cb")
|
||||||
(def color-light-blue-transparent "#bbc4cb32")
|
(def color-light-blue-transparent "#bbc4cb32")
|
||||||
(def color-dark-mint "#5fc48d")
|
(def color-dark-mint "#5fc48d")
|
||||||
|
(def color-light-gray "#EEF2F5")
|
||||||
|
|
||||||
(def text1-color color-black)
|
(def text1-color color-black)
|
||||||
(def text2-color color-gray)
|
(def text2-color color-gray)
|
||||||
(def online-color color-blue)
|
(def online-color color-blue)
|
||||||
(def new-messages-count-color "#7099e632")
|
(def new-messages-count-color "#7099e632")
|
||||||
(def chat-background "#EBF0F4")
|
(def chat-background color-light-gray)
|
||||||
(def selected-message-color "#E4E9ED")
|
(def selected-message-color "#E4E9ED")
|
||||||
(def separator-color "#0000001f")
|
(def separator-color "#0000001f")
|
||||||
|
(def toolbar-background1 color-white)
|
||||||
|
(def toolbar-background2 color-light-gray)
|
||||||
|
|
Loading…
Reference in New Issue