From f402fc9b6e8805c988821153d0b1d3181dc3452f Mon Sep 17 00:00:00 2001 From: Adrian Tiberius Date: Tue, 3 May 2016 16:00:44 +0300 Subject: [PATCH] fixed discovery screen design styles --- .../discovery-popular-list-item.cljs | 14 +++++---- .../components/discovery/discovery.cljs | 28 ++++++++++------- .../discovery/discovery_popular.cljs | 2 +- .../discovery/discovery_popular_list.cljs | 30 ++++++++++++++----- 4 files changed, 49 insertions(+), 25 deletions(-) diff --git a/src/syng_im/components/discovery/discovery-popular-list-item.cljs b/src/syng_im/components/discovery/discovery-popular-list-item.cljs index fd0c55a7b6..86b11dc3d0 100644 --- a/src/syng_im/components/discovery/discovery-popular-list-item.cljs +++ b/src/syng_im/components/discovery/discovery-popular-list-item.cljs @@ -17,11 +17,13 @@ [view {:style {:flex 0.8 :flexDirection "column"}} [text {:style {:color "black" - :fontWeight "bold" - :fontSize 12}} (aget discovery "name")] + :fontFamily "sans-serif-medium" + :fontSize 14 + :lineHeight 24}} (aget discovery "name")] [text {:style {:color "black" - :fontWeight "normal" - :fontSize 12} + :fontFamily "sans-serif" + :lineHeight 22 + :fontSize 14} :numberOfLines 2} (aget discovery "status")] ] [view {:style {:flex 0.2 @@ -30,8 +32,8 @@ :paddingTop 5}} [image {:style {:resizeMode "contain" :borderRadius 150 - :width 30 - :height 30} + :width 40 + :height 40} :source res/user-no-photo}] ] ])) \ No newline at end of file diff --git a/src/syng_im/components/discovery/discovery.cljs b/src/syng_im/components/discovery/discovery.cljs index c4ec3e989d..d92b395eba 100644 --- a/src/syng_im/components/discovery/discovery.cljs +++ b/src/syng_im/components/discovery/discovery.cljs @@ -42,7 +42,7 @@ (let [number (rand-int 999)] (do (save-discoveries [{:name (str "Name " number) - :status (str "Status " number) + :status (str "Status This is some longer status to get the second line " number) :whisper-id (str number) :photo "" :location "" @@ -72,26 +72,32 @@ (let [search (aget e "nativeEvent" "text") hashtags (get-hashtags search)] (dispatch [:broadcast-status search hashtags])))}] - [text "Discover"])] + [view {:style {;:flex 1 + ;:flexDirection "row" + ;:justifyContent "center" + ;:alignSelf "stretch" + ;:alignItems "center" + }} + [text {:style {:color "#000000de" + :alignSelf "center" + :textAlign "center" + :fontFamily "sans-serif" + :fontSize 16}} "Discover"]])] [scroll-view {:style {}} - [view {:style {:paddingTop 5}} - [text {:style {:color "#b2bdc5" - :fontSize 14 - :textAlign "center"}} "Discover popular contacts \n around the world"]] [view {:style {:paddingLeft 30 :paddingTop 15 :paddingBottom 15}} - [text {:style {:color "#b2bdc5" - :fontSize 14 - :fontWeight "bold"}} "Popular Tags"]] + [text {:style {:color "#8f838c93" + :fontFamily "sans-serif-medium" + :fontSize 14}} "Popular tags"]] [discovery-popular] [view {:style {:paddingLeft 30 :paddingTop 15 :paddingBottom 15}} - [text {:style {:color "#b2bdc5" + [text {:style {:color "#8f838c93" :fontSize 14 - :fontWeight "bold"}} "Recent"]] + :fontFamily "sans-serif-medium"}} "Recent"]] [discovery-recent] ] ] diff --git a/src/syng_im/components/discovery/discovery_popular.cljs b/src/syng_im/components/discovery/discovery_popular.cljs index 1dae49a7f1..e7f03b0dfa 100644 --- a/src/syng_im/components/discovery/discovery_popular.cljs +++ b/src/syng_im/components/discovery/discovery_popular.cljs @@ -24,7 +24,7 @@ :pageWidth (- (page-width) 60) :sneak 20} (for [tag @popular-tags] - (discovery-popular-list (.-name tag)))] + (discovery-popular-list (.-name tag) (.-count tag)))] [text "None"] ) ) diff --git a/src/syng_im/components/discovery/discovery_popular_list.cljs b/src/syng_im/components/discovery/discovery_popular_list.cljs index 5938e3e9af..8ac9f0aeba 100644 --- a/src/syng_im/components/discovery/discovery_popular_list.cljs +++ b/src/syng_im/components/discovery/discovery_popular_list.cljs @@ -25,28 +25,44 @@ :key rowID}])] elem)) -(defn discovery-popular-list [tag] +(defn discovery-popular-list [tag count] (let [discoveries (subscribe [:get-discoveries-by-tag tag 3])] (log/debug "Got discoveries for tag (" tag "): " @discoveries) [view {:style {:flex 1 :backgroundColor "white" :paddingLeft 10 - :paddingTop 10}} + :paddingTop 16}} [view {:style {:flexDirection "row" :backgroundColor "white" :padding 0}} - [view {:style {:flexDirection "column" - :backgroundColor "#e9f7fe" + [view {:style { + :flexDirection "column"}} + [view {:style {:backgroundColor "#eef2f5" :borderRadius 5 - :padding 0}} - [text {:style {:color "#6092df" + :padding 4}} + [text {:style {:color "#7099e6" + :fontFamily "sans-serif-medium" + :fontSize 14 :paddingRight 5 :paddingBottom 2 :alignItems "center" :justifyContent "center"}} (str " #" (name tag))]]] + [view {:style {:flex 0.2 + :alignItems "flex-end" + :paddingTop 10 + :paddingRight 9}} + [text {:style {:color "#838c93" + :fontFamily "sans-serif" + :fontSize 12 + :paddingRight 5 + :paddingBottom 2 + :alignItems "center" + :justifyContent "center"}} + count]]] [list-view {:dataSource (to-realm-datasource @discoveries) :renderRow render-row :renderSeparator render-separator - :style {:backgroundColor "white"}}] + :style {:backgroundColor "white" + :paddingTop 13}}] ]))