From d02af8907d3f84c45817f8751ed5100f91cf2c71 Mon Sep 17 00:00:00 2001 From: virvar Date: Fri, 15 Apr 2016 14:33:14 +0300 Subject: [PATCH] Change font --- src/syng_im/android/core.cljs | 4 ++-- src/syng_im/components/chat/chat_message.cljs | 18 +++++++++--------- src/syng_im/components/chat/input/money.cljs | 3 ++- .../components/chat/input/simple_command.cljs | 5 +++-- .../components/chat/plain_message_input.cljs | 3 ++- src/syng_im/components/chat/suggestions.cljs | 5 +++-- .../components/chats/chat_list_item.cljs | 5 +++-- src/syng_im/components/chats/new_group.cljs | 3 ++- .../components/contact_list/contact_inner.cljs | 9 +++++---- src/syng_im/components/styles.cljs | 3 +++ 10 files changed, 34 insertions(+), 24 deletions(-) create mode 100644 src/syng_im/components/styles.cljs diff --git a/src/syng_im/android/core.cljs b/src/syng_im/android/core.cljs index 27650ba76b..a382a1a3e7 100644 --- a/src/syng_im/android/core.cljs +++ b/src/syng_im/android/core.cljs @@ -37,8 +37,8 @@ (fn [] (let [signed-up @signed-up-atom] [navigator {:initial-route (clj->js {:view-id - ;:chat-list - :chat + :chat-list + ;:chat }) :render-scene (fn [route nav] (log/debug "route" route) diff --git a/src/syng_im/components/chat/chat_message.cljs b/src/syng_im/components/chat/chat_message.cljs index b6a68a6d9b..55bda8351c 100644 --- a/src/syng_im/components/chat/chat_message.cljs +++ b/src/syng_im/components/chat/chat_message.cljs @@ -7,6 +7,7 @@ touchable-highlight navigator toolbar-android]] + [syng-im.components.styles :refer [font]] [syng-im.models.commands :refer [parse-command-msg-content parse-command-request-msg-content]] [syng-im.utils.logging :as log] @@ -16,10 +17,9 @@ content-type-command content-type-command-request]])) - (defn message-date [{:keys [date]}] [text {:style {:marginVertical 10 - :fontFamily "Avenir-Roman" + :fontFamily font :fontSize 11 :color "#AAB2B2" :letterSpacing 1 @@ -57,7 +57,7 @@ [text {:style {:position "absolute" :left 1 :top 11 - :fontFamily "Avenir-Roman" + :fontFamily font :fontSize 11 :color "#4A5258" :letterSpacing 1 @@ -79,7 +79,7 @@ :paddingTop 2 :paddingHorizontal 12}} [text {:style {:fontSize 12 - :fontFamily "Avenir-Roman" + :fontFamily font :color "white"}} (:text command)]]] [image {:source (:icon command) @@ -89,7 +89,7 @@ [text {:style {:marginTop 5 :marginHorizontal 0 :fontSize 14 - :fontFamily "Avenir-Roman" + :fontFamily font :color "black"}} ;; TODO isn't smart (if (= (:command command) :keypair-password) @@ -113,7 +113,7 @@ {:backgroundColor "white"} {:backgroundColor background-color}))} [text {:style (merge {:fontSize 14 - :fontFamily "Avenir-Roman"} + :fontFamily font} (if outgoing {:color "#4A5258"} {:color text-color}))} @@ -130,7 +130,7 @@ :top 9 :left 10}}]] [text {:style {:marginTop 2 - :fontFamily "Avenir-Roman" + :fontFamily font :fontSize 12 :color "#AAB2B2" :opacity 0.8 }} @@ -147,7 +147,7 @@ (cond (= content-type text-content-type) [text {:style (merge {:fontSize 14 - :fontFamily "Avenir-Roman"} + :fontFamily font} (if outgoing {:color "#4A5258"} {:color text-color}))} @@ -166,7 +166,7 @@ :failed res/delivery-failed-icon) :style {:marginTop 6 :opacity 0.6}}] - [text {:style {:fontFamily "Avenir-Roman" + [text {:style {:fontFamily font :fontSize 12 :color "#AAB2B2" :opacity 0.8 diff --git a/src/syng_im/components/chat/input/money.cljs b/src/syng_im/components/chat/input/money.cljs index 8401ff31a2..eb879188cb 100644 --- a/src/syng_im/components/chat/input/money.cljs +++ b/src/syng_im/components/chat/input/money.cljs @@ -1,6 +1,7 @@ (ns syng-im.components.chat.input.money (:require [re-frame.core :refer [subscribe dispatch dispatch-sync]] + [syng-im.components.styles :refer [font]] [syng-im.components.chat.input.simple-command :refer [simple-command-input-view]] [syng-im.utils.utils :refer [log toast http-post]] [syng-im.utils.logging :as log])) @@ -11,5 +12,5 @@ :marginLeft 8 :lineHeight 42 :fontSize 32 - :fontFamily "Avenir-Roman" + :fontFamily font :color "black"}}]) diff --git a/src/syng_im/components/chat/input/simple_command.cljs b/src/syng_im/components/chat/input/simple_command.cljs index 1e8926925a..388bda61f6 100644 --- a/src/syng_im/components/chat/input/simple_command.cljs +++ b/src/syng_im/components/chat/input/simple_command.cljs @@ -6,6 +6,7 @@ text text-input touchable-highlight]] + [syng-im.components.styles :refer [font]] [syng-im.utils.utils :refer [log toast http-post]] [syng-im.utils.logging :as log] [syng-im.resources :as res] @@ -44,7 +45,7 @@ [text {:style {:marginTop -2 :marginHorizontal 10 :fontSize 14 - :fontFamily "Avenir-Roman" + :fontFamily font :color "white"}} (:text command)]] [touchable-highlight {:style {:marginTop 14 @@ -61,7 +62,7 @@ :marginLeft 8 :lineHeight 42 :fontSize 14 - :fontFamily "Avenir-Roman" + :fontFamily font :color "black"} :underlineColorAndroid "transparent" :autoFocus true diff --git a/src/syng_im/components/chat/plain_message_input.cljs b/src/syng_im/components/chat/plain_message_input.cljs index 0784f693c2..635940b065 100644 --- a/src/syng_im/components/chat/plain_message_input.cljs +++ b/src/syng_im/components/chat/plain_message_input.cljs @@ -4,6 +4,7 @@ view image text-input]] + [syng-im.components.styles :refer [font]] [syng-im.components.chat.suggestions :refer [suggestions-view]] [syng-im.utils.utils :refer [log toast http-post]] [syng-im.utils.logging :as log] @@ -35,7 +36,7 @@ :marginLeft 18 :lineHeight 42 :fontSize 14 - :fontFamily "Avenir-Roman" + :fontFamily font :color "#9CBFC0"} :autoFocus false :placeholder "Type your message here" diff --git a/src/syng_im/components/chat/suggestions.cljs b/src/syng_im/components/chat/suggestions.cljs index 21b22b6711..d151840e46 100644 --- a/src/syng_im/components/chat/suggestions.cljs +++ b/src/syng_im/components/chat/suggestions.cljs @@ -10,6 +10,7 @@ touchable-highlight list-view list-item]] + [syng-im.components.styles :refer [font]] [syng-im.utils.listview :refer [to-datasource]] [syng-im.utils.utils :refer [log toast http-post]] [syng-im.utils.logging :as log])) @@ -34,7 +35,7 @@ [text {:style {:marginTop -2 :marginHorizontal 10 :fontSize 14 - :fontFamily "Avenir-Roman" + :fontFamily font :color "white"}} (:text suggestion)]] [text {:style {:flex 1 @@ -43,7 +44,7 @@ :left 190 :lineHeight 18 :fontSize 14 - :fontFamily "Avenir-Roman" + :fontFamily font :color "black"}} (:description suggestion)]]]) diff --git a/src/syng_im/components/chats/chat_list_item.cljs b/src/syng_im/components/chats/chat_list_item.cljs index 0a7c3e3902..82f2c1e50a 100644 --- a/src/syng_im/components/chats/chat_list_item.cljs +++ b/src/syng_im/components/chats/chat_list_item.cljs @@ -4,6 +4,7 @@ text image touchable-highlight]] + [syng-im.components.styles :refer [font]] [syng-im.utils.logging :as log] [syng-im.resources :as res])) @@ -21,6 +22,6 @@ :marginRight 5 :marginLeft 5}}] [text {:style {:fontSize 14 - :fontFamily "Avenir-Roman" + :fontFamily font :color "#4A5258"}} - (subs (aget chat-obj "name") 0 30)]]]) \ No newline at end of file + (subs (aget chat-obj "name") 0 30)]]]) diff --git a/src/syng_im/components/chats/new_group.cljs b/src/syng_im/components/chats/new_group.cljs index c402ebd799..8e34287246 100644 --- a/src/syng_im/components/chats/new_group.cljs +++ b/src/syng_im/components/chats/new_group.cljs @@ -2,6 +2,7 @@ (:require [re-frame.core :refer [subscribe dispatch dispatch-sync]] [syng-im.resources :as res] [syng-im.components.react :refer [view toolbar-android android? text-input]] + [syng-im.components.styles :refer [font]] [syng-im.components.realm :refer [list-view]] [syng-im.utils.listview :refer [to-realm-datasource]] [syng-im.components.chats.new-group-contact :refer [new-group-contact]] @@ -35,7 +36,7 @@ :style {:marginLeft 5 :marginRight 5 :fontSize 14 - :fontFamily "Avenir-Roman" + :fontFamily font :color "#9CBFC0"} :autoFocus true :placeholder "Group Name" diff --git a/src/syng_im/components/contact_list/contact_inner.cljs b/src/syng_im/components/contact_list/contact_inner.cljs index c047551c57..5f3e4883f3 100644 --- a/src/syng_im/components/contact_list/contact_inner.cljs +++ b/src/syng_im/components/contact_list/contact_inner.cljs @@ -1,6 +1,7 @@ (ns syng-im.components.contact-list.contact-inner (:require [clojure.string :as s] [syng-im.components.react :refer [view image text]] + [syng-im.components.styles :refer [font]] [syng-im.resources :as res])) (defn contact-photo [{:keys [photo-path]}] @@ -54,10 +55,10 @@ :position "relative"}} ;;; name [text {:style {:fontSize 15 - :fontFamily "Avenir-Roman"}} name] + :fontFamily font}} name] ;;; last message [text {:style {:color "#AAB2B2" - :fontFamily "Avenir-Roman" + :fontFamily font :fontSize 14 :marginTop 2 :paddingRight 10}} @@ -74,7 +75,7 @@ res/delivered-icon) :style {:marginTop 5}}]) ;;; datetime - [text {:style {:fontFamily "Avenir-Roman" + [text {:style {:fontFamily font :fontSize 11 :color "#AAB2B2" :letterSpacing 1 @@ -94,7 +95,7 @@ :alignSelf "flex-end"}} [text {:style {:width 18 :height 17 - :fontFamily "Avenir-Roman" + :fontFamily font :fontSize 10 :color "#FFFFFF" :lineHeight 19 diff --git a/src/syng_im/components/styles.cljs b/src/syng_im/components/styles.cljs new file mode 100644 index 0000000000..98454becb8 --- /dev/null +++ b/src/syng_im/components/styles.cljs @@ -0,0 +1,3 @@ +(ns syng-im.components.styles) + +(def font "Robot-Regular")