From 30fb48523e9a027723f9cf870618453b2cbab24a Mon Sep 17 00:00:00 2001 From: alealejandro Date: Wed, 25 Jan 2017 09:20:37 -0800 Subject: [PATCH] Refactor colors, remove unneeded (src/status_im) issue #278 --- .gitignore | 2 +- src/status_im/accounts/login/screen.cljs | 5 +---- src/status_im/accounts/login/styles.cljs | 7 ++++--- src/status_im/accounts/recover/screen.cljs | 17 +++++++++-------- src/status_im/accounts/recover/styles.cljs | 10 ++++++---- src/status_im/accounts/screen.cljs | 5 +---- .../chat/styles/content_suggestions.cljs | 11 ++--------- src/status_im/chat/styles/input.cljs | 5 +---- src/status_im/chat/styles/message.cljs | 4 +--- src/status_im/chat/styles/plain_message.cljs | 5 +++-- src/status_im/chat/styles/response.cljs | 6 +----- src/status_im/chat/styles/screen.cljs | 5 +---- src/status_im/chat/styles/suggestions.cljs | 10 ++-------- src/status_im/chat/views/new_message.cljs | 2 +- src/status_im/components/drawer/styles.cljs | 9 +-------- .../components/image_button/styles.cljs | 7 ++++--- .../components/selectable_field/styles.cljs | 6 +++--- src/status_im/components/status_view/view.cljs | 7 ++++--- src/status_im/components/styles.cljs | 2 -- src/status_im/components/text_field/view.cljs | 7 ++++--- src/status_im/components/toolbar/styles.cljs | 8 +++++--- src/status_im/contacts/screen.cljs | 3 +-- src/status_im/contacts/styles.cljs | 10 +++------- src/status_im/contacts/views/contact_list.cljs | 4 ---- src/status_im/contacts/views/new_contact.cljs | 6 +++--- src/status_im/discover/styles.cljs | 10 +++++----- src/status_im/new_group/screen.cljs | 7 ++++--- src/status_im/profile/styles.cljs | 11 ++++------- src/status_im/protocol/listeners.cljs | 2 +- src/status_im/transactions/styles.cljs | 8 +++++--- .../transactions/views/transaction_page.cljs | 3 +-- 31 files changed, 82 insertions(+), 122 deletions(-) diff --git a/.gitignore b/.gitignore index 4e18fe503c..ebd1ed73ad 100644 --- a/.gitignore +++ b/.gitignore @@ -69,7 +69,7 @@ figwheel_server.log out doo-index.html -# Re-natal +# Re-natal re-natal # status-go diff --git a/src/status_im/accounts/login/screen.cljs b/src/status_im/accounts/login/screen.cljs index 34fe5c178a..1c0444c776 100644 --- a/src/status_im/accounts/login/screen.cljs +++ b/src/status_im/accounts/login/screen.cljs @@ -13,11 +13,8 @@ [status-im.components.toolbar.styles :refer [toolbar-title-container toolbar-title-text]] [status-im.components.text-field.view :refer [text-field]] - [status-im.components.styles :refer [color-purple - color-white + [status-im.components.styles :refer [color-white icon-search - icon-back - icon-qr button-input]] [status-im.i18n :refer [label]] [status-im.accounts.login.styles :as st])) diff --git a/src/status_im/accounts/login/styles.cljs b/src/status_im/accounts/login/styles.cljs index d3ed4c7afa..988aaa4992 100644 --- a/src/status_im/accounts/login/styles.cljs +++ b/src/status_im/accounts/login/styles.cljs @@ -1,5 +1,6 @@ (ns status-im.accounts.login.styles - (:require [status-im.components.styles :refer [color-white]])) + (:require [status-im.components.styles :refer [color-white + color-blue]])) (defn screen-container [height] @@ -40,7 +41,7 @@ :paddingHorizontal 28}) (def connect-button-text - {:color "#7099e6" + {:color color-blue :fontSize 16}) (def input-style @@ -51,4 +52,4 @@ {:color :white}) (def address-input-wrapper - {}) \ No newline at end of file + {}) diff --git a/src/status_im/accounts/recover/screen.cljs b/src/status_im/accounts/recover/screen.cljs index 7009255286..b679a32ff4 100644 --- a/src/status_im/accounts/recover/screen.cljs +++ b/src/status_im/accounts/recover/screen.cljs @@ -13,8 +13,9 @@ [status-im.components.toolbar.styles :refer [toolbar-gradient toolbar-title-container toolbar-title-text]] - [status-im.components.styles :refer [color-purple - color-white + [status-im.components.styles :refer [color-blue + color-gray + separator-color button-input]] [status-im.components.react :refer [linear-gradient]] [status-im.i18n :refer [label]] @@ -40,10 +41,10 @@ [text-field {:value passphrase :error error - :error-color "#7099e6" + :error-color color-blue :label (label :t/passphrase) - :label-color "#838c93de" - :line-color "#0000001f" + :label-color color-gray + :line-color separator-color :input-style st/input-style :wrapper-style (merge button-input st/address-input-wrapper) :on-change-text #(dispatch [:set-in [:recover :passphrase] %])}]])) @@ -59,10 +60,10 @@ {:value password :secure-text-entry true :error error - :error-color "#7099e6" + :error-color color-blue :label (label :t/password) - :label-color "#838c93de" - :line-color "#0000001f" + :label-color color-gray + :line-color separator-color :input-style st/input-style :on-change-text #(dispatch [:set-in [:recover :password] %])}]])) diff --git a/src/status_im/accounts/recover/styles.cljs b/src/status_im/accounts/recover/styles.cljs index 773dded88b..1637012d5d 100644 --- a/src/status_im/accounts/recover/styles.cljs +++ b/src/status_im/accounts/recover/styles.cljs @@ -1,5 +1,7 @@ (ns status-im.accounts.recover.styles - (:require [status-im.components.styles :refer [color-white]])) + (:require [status-im.components.styles :refer [color-white + color-gray + color-blue]])) (def screen-container @@ -20,7 +22,7 @@ :justify-content :center}) (def recover-explain-text - {:color "#838c93de" + {:color color-gray :font-size 16 :line-height 20 :text-align :center}) @@ -45,7 +47,7 @@ {:flex 1}) (defn recover-button [valid-form?] - {:backgroundColor (if valid-form? "#7099e6" :gray) + {:backgroundColor (if valid-form? color-blue :gray) :color :white :flex 1 :alignItems :center @@ -64,4 +66,4 @@ {:color :white}) (def address-input-wrapper - {}) \ No newline at end of file + {}) diff --git a/src/status_im/accounts/screen.cljs b/src/status_im/accounts/screen.cljs index 8bcac849e2..5b07f99ee7 100644 --- a/src/status_im/accounts/screen.cljs +++ b/src/status_im/accounts/screen.cljs @@ -12,11 +12,8 @@ [status-im.components.status-bar :refer [status-bar]] [status-im.components.toolbar.view :refer [toolbar]] [status-im.components.toolbar.actions :as act] - [status-im.components.styles :refer [color-purple - color-white + [status-im.components.styles :refer [color-white icon-search - icon-back - icon-qr icon-plus white-form-text-input]] [status-im.components.toolbar.styles :refer [toolbar-title-container diff --git a/src/status_im/chat/styles/content_suggestions.cljs b/src/status_im/chat/styles/content_suggestions.cljs index 869c0b68b5..0ac59e30ed 100644 --- a/src/status_im/chat/styles/content_suggestions.cljs +++ b/src/status_im/chat/styles/content_suggestions.cljs @@ -1,15 +1,8 @@ (ns status-im.chat.styles.content-suggestions - (:require [status-im.components.styles :refer [color-light-blue-transparent - color-white - color-black - color-blue - color-blue-transparent - selected-message-color - online-color + (:require [status-im.components.styles :refer [color-white separator-color text1-color - text2-color - text3-color]])) + text2-color]])) (def suggestion-height 56) diff --git a/src/status_im/chat/styles/input.cljs b/src/status_im/chat/styles/input.cljs index f50a2c4e92..5db5d1b335 100644 --- a/src/status_im/chat/styles/input.cljs +++ b/src/status_im/chat/styles/input.cljs @@ -1,10 +1,7 @@ (ns status-im.chat.styles.input (:require [status-im.components.styles :refer [color-white color-blue - text1-color - text2-color - chat-background - color-black]])) + text1-color]])) (def command-input-and-suggestions-container {:flexDirection :column}) diff --git a/src/status_im/chat/styles/message.cljs b/src/status_im/chat/styles/message.cljs index 75339a514e..21ab45c1d4 100644 --- a/src/status_im/chat/styles/message.cljs +++ b/src/status_im/chat/styles/message.cljs @@ -1,10 +1,8 @@ (ns status-im.chat.styles.message - (:require [status-im.components.styles :refer [color-light-blue-transparent - color-white + (:require [status-im.components.styles :refer [color-white color-black color-blue selected-message-color - online-color text1-color text2-color]] [status-im.constants :refer [text-content-type diff --git a/src/status_im/chat/styles/plain_message.cljs b/src/status_im/chat/styles/plain_message.cljs index cf4a26b090..abf2642a5f 100644 --- a/src/status_im/chat/styles/plain_message.cljs +++ b/src/status_im/chat/styles/plain_message.cljs @@ -1,5 +1,6 @@ (ns status-im.chat.styles.plain-message - (:require [status-im.components.styles :refer [text1-color]] + (:require [status-im.components.styles :refer [text1-color + color-blue]] [status-im.chat.constants :refer [max-input-height min-input-height]])) @@ -34,7 +35,7 @@ :position :absolute}) (def requests-icon - {:background-color :#7099e6 + {:background-color color-blue :margin 2 :width 8 :height 8 diff --git a/src/status_im/chat/styles/response.cljs b/src/status_im/chat/styles/response.cljs index 73e9b0ba3c..1e23a8e040 100644 --- a/src/status_im/chat/styles/response.cljs +++ b/src/status_im/chat/styles/response.cljs @@ -1,10 +1,6 @@ (ns status-im.chat.styles.response (:require [status-im.components.styles :refer [color-white - color-blue - text1-color - text2-color - chat-background - color-black]] + text1-color]] [status-im.chat.constants :refer [input-height request-info-height response-height-normal]])) diff --git a/src/status_im/chat/styles/screen.cljs b/src/status_im/chat/styles/screen.cljs index 95d138bb26..a65f73f385 100644 --- a/src/status_im/chat/styles/screen.cljs +++ b/src/status_im/chat/styles/screen.cljs @@ -1,8 +1,5 @@ (ns status-im.chat.styles.screen - (:require [status-im.components.styles :refer [color-white - color-black - chat-background - online-color + (:require [status-im.components.styles :refer [chat-background selected-message-color separator-color text1-color diff --git a/src/status_im/chat/styles/suggestions.cljs b/src/status_im/chat/styles/suggestions.cljs index ac7dc1e1f5..e35294a599 100644 --- a/src/status_im/chat/styles/suggestions.cljs +++ b/src/status_im/chat/styles/suggestions.cljs @@ -1,16 +1,10 @@ (ns status-im.chat.styles.suggestions - (:require [status-im.components.styles :refer [color-light-blue-transparent - color-white + (:require [status-im.components.styles :refer [color-white color-black color-gray - color-blue - color-blue-transparent - selected-message-color - online-color separator-color text1-color - text2-color - text3-color]])) + text2-color]])) (def suggestion-height 60) diff --git a/src/status_im/chat/views/new_message.cljs b/src/status_im/chat/views/new_message.cljs index 71ddf6c7a1..ee0ae5f947 100644 --- a/src/status_im/chat/views/new_message.cljs +++ b/src/status_im/chat/views/new_message.cljs @@ -18,7 +18,7 @@ :password {:input-options {:secure-text-entry true}} :number {:input-options {:keyboard-type "numeric"}} ;; todo maybe nil is fine for now :) - nil #_(throw (js/Error. "Uknown command type")))] + nil #_(throw (js/Error. "Unknown command type")))] (if (= :response command-type) (if placeholder (assoc-in options [:input-options :placeholder] placeholder) diff --git a/src/status_im/components/drawer/styles.cljs b/src/status_im/components/drawer/styles.cljs index d2723dbd59..24e95b4d5b 100644 --- a/src/status_im/components/drawer/styles.cljs +++ b/src/status_im/components/drawer/styles.cljs @@ -1,12 +1,5 @@ (ns status-im.components.drawer.styles - (:require [status-im.components.styles :refer [color-light-blue-transparent - color-white - color-black - color-blue - color-blue-transparent - selected-message-color - online-color - separator-color + (:require [status-im.components.styles :refer [color-white text1-color text2-color text3-color diff --git a/src/status_im/components/image_button/styles.cljs b/src/status_im/components/image_button/styles.cljs index 75782a54aa..32905a9f66 100644 --- a/src/status_im/components/image_button/styles.cljs +++ b/src/status_im/components/image_button/styles.cljs @@ -1,4 +1,5 @@ -(ns status-im.components.image-button.styles) +(ns status-im.components.image-button.styles + (:require [status-im.components.styles :refer [color-blue]])) (def image-button {:position :absolute @@ -22,7 +23,7 @@ :margin-left 8}) (def scan-button-text - (merge image-button-text {:color "#7099e6"})) + (merge image-button-text {:color color-blue})) (def show-qr-button-text - (merge image-button-text {:color "#838c93"})) \ No newline at end of file + (merge image-button-text {:color "#838c93"})) diff --git a/src/status_im/components/selectable_field/styles.cljs b/src/status_im/components/selectable_field/styles.cljs index 98b4e02894..2a220942ba 100644 --- a/src/status_im/components/selectable_field/styles.cljs +++ b/src/status_im/components/selectable_field/styles.cljs @@ -1,5 +1,6 @@ (ns status-im.components.selectable-field.styles - (:require [status-im.utils.platform :refer [platform-specific]])) + (:require [status-im.utils.platform :refer [platform-specific]] + [status-im.components.styles :refer [text1-disabled-color]])) (def selectable-field-container @@ -20,7 +21,7 @@ (def text {:font-size 16 - :color "#555555" + :color text1-disabled-color :margin-right 16 :text-align-vertical :top}) @@ -35,4 +36,3 @@ :padding-left 0 :margin-left 0 :padding-bottom 0}))) - diff --git a/src/status_im/components/status_view/view.cljs b/src/status_im/components/status_view/view.cljs index 7fb752da85..431546a054 100644 --- a/src/status_im/components/status_view/view.cljs +++ b/src/status_im/components/status_view/view.cljs @@ -3,10 +3,11 @@ (:require [re-frame.core :refer [subscribe dispatch]] [clojure.string :as str] [status-im.components.react :refer [view text]] - [status-im.utils.platform :refer [platform-specific]])) + [status-im.utils.platform :refer [platform-specific]] + [status-im.components.styles :refer [color-blue]])) (defn tag-view [tag] - [text {:style {:color "#7099e6"} + [text {:style {:color color-blue} :font :medium} (str tag " ")]) @@ -25,4 +26,4 @@ ^{:key (str "item-" message-id "-" i)} [tag-view status] ^{:key (str "item-" message-id "-" i)} - (str status " ")))]) \ No newline at end of file + (str status " ")))]) diff --git a/src/status_im/components/styles.cljs b/src/status_im/components/styles.cljs index 05dea54728..b6df42eaf0 100644 --- a/src/status_im/components/styles.cljs +++ b/src/status_im/components/styles.cljs @@ -19,8 +19,6 @@ (def text1-disabled-color "#555555") (def text2-color color-gray) (def text3-color color-blue) -(def text4-color color-white) -(def text5-color "#838c938f") (def online-color color-blue) (def new-messages-count-color color-blue-transparent) (def chat-background color-light-gray) diff --git a/src/status_im/components/text_field/view.cljs b/src/status_im/components/text_field/view.cljs index f586bf42d5..f80b7f7152 100644 --- a/src/status_im/components/text_field/view.cljs +++ b/src/status_im/components/text_field/view.cljs @@ -12,7 +12,8 @@ [status-im.components.text-field.styles :as st] [status-im.i18n :refer [label]] [status-im.components.animation :as anim] - [taoensso.timbre :as log])) + [taoensso.timbre :as log] + [status-im.components.styles :refer [separator-color]])) (def config {:label-top 16 @@ -26,8 +27,8 @@ :line-style {} :editable true :label-color "#838c93" - :line-color "#0000001f" - :focus-line-color "#0000001f" + :line-color separator-color + :focus-line-color separator-color :error-color "#d50000" :secure-text-entry false :on-focus #() diff --git a/src/status_im/components/toolbar/styles.cljs b/src/status_im/components/toolbar/styles.cljs index 82a5f0db45..de800ccc25 100644 --- a/src/status_im/components/toolbar/styles.cljs +++ b/src/status_im/components/toolbar/styles.cljs @@ -1,7 +1,9 @@ (ns status-im.components.toolbar.styles (:require [status-im.components.styles :refer [text1-color color-white - color-light-gray]])) + color-light-gray + color-blue + color-black]])) (def toolbar-background1 color-white) (def toolbar-background2 color-light-gray) @@ -73,10 +75,10 @@ :margin-left 18 :margin-top 2 :font-size 14 - :color "#7099e6"}) + :color color-blue}) (def toolbar-with-search-title - {:color "#000000de" + {:color color-black :align-self :center :text-align :center :font-size 16}) diff --git a/src/status_im/contacts/screen.cljs b/src/status_im/contacts/screen.cljs index 5187116b74..f1821308e2 100644 --- a/src/status_im/contacts/screen.cljs +++ b/src/status_im/contacts/screen.cljs @@ -23,8 +23,7 @@ [status-im.i18n :refer [label]] [status-im.contacts.styles :as st] [status-im.components.styles :refer [color-blue - create-icon - icon-search]])) + create-icon]])) (def contacts-limit 50) diff --git a/src/status_im/contacts/styles.cljs b/src/status_im/contacts/styles.cljs index 3867077c30..fb4aca24c3 100644 --- a/src/status_im/contacts/styles.cljs +++ b/src/status_im/contacts/styles.cljs @@ -2,12 +2,10 @@ (:require [status-im.components.styles :refer [text1-color text2-color text3-color - text5-color color-white - color-black - color-light-gray color-separator - color-gray2]] + color-gray2 + color-gray]] [status-im.components.toolbar.styles :refer [toolbar-background2]] [status-im.utils.platform :as p])) @@ -201,7 +199,7 @@ (def address-explication {:textAlign :center - :color "#838c93de"}) + :color color-gray}) (def buttons-container {:position :absolute @@ -238,5 +236,3 @@ :background-color color-white :align-items :center :justify-content :center}) - - diff --git a/src/status_im/contacts/views/contact_list.cljs b/src/status_im/contacts/views/contact_list.cljs index 9e80631646..2af30c7069 100644 --- a/src/status_im/contacts/views/contact_list.cljs +++ b/src/status_im/contacts/views/contact_list.cljs @@ -13,10 +13,6 @@ [status-im.components.toolbar.actions :as act] [status-im.components.toolbar.styles :refer [toolbar-background1]] [status-im.components.drawer.view :refer [drawer-view open-drawer]] - [status-im.components.styles :refer [icon-search - icon-back - button-input-container - button-input]] [status-im.components.image-button.view :refer [scan-button]] [status-im.contacts.styles :as st] [status-im.utils.listview :as lw] diff --git a/src/status_im/contacts/views/new_contact.cljs b/src/status_im/contacts/views/new_contact.cljs index 170d5b1b28..e70bdb31a3 100644 --- a/src/status_im/contacts/views/new_contact.cljs +++ b/src/status_im/contacts/views/new_contact.cljs @@ -17,9 +17,9 @@ toolbar-background1]] [status-im.utils.utils :refer [log http-post]] [status-im.components.styles :refer [icon-ok - icon-back button-input-container - button-input]] + button-input + color-blue]] [status-im.components.image-button.view :refer [scan-button]] [status-im.i18n :refer [label]] [cljs.spec :as s] @@ -87,7 +87,7 @@ [view button-input-container [text-field {:error error - :error-color "#7099e6" + :error-color color-blue :input-style st/qr-input :value whisper-identity :wrapper-style button-input diff --git a/src/status_im/discover/styles.cljs b/src/status_im/discover/styles.cljs index acc19e856d..8954947ba5 100644 --- a/src/status_im/discover/styles.cljs +++ b/src/status_im/discover/styles.cljs @@ -1,7 +1,7 @@ (ns status-im.discover.styles - (:require [status-im.components.styles :refer [color-gray2 - color-white - color-light-gray]] + (:require [status-im.components.styles :refer [color-white + color-light-gray + color-blue]] [status-im.components.toolbar.styles :refer [toolbar-background2]])) ;; Common @@ -38,7 +38,7 @@ {}) (def tag-name - {:color "#7099e6" + {:color color-blue :font-size 14 :padding-right 5 :padding-bottom 2 @@ -124,7 +124,7 @@ :flex-direction "row"}) (def tag-title - {:color "#7099e6" + {:color color-blue :font-size 14 :padding-right 5 :padding-bottom 2}) diff --git a/src/status_im/new_group/screen.cljs b/src/status_im/new_group/screen.cljs index 29a537df75..eaf2a750cc 100644 --- a/src/status_im/new_group/screen.cljs +++ b/src/status_im/new_group/screen.cljs @@ -10,7 +10,8 @@ list-view list-item]] [status-im.components.text-field.view :refer [text-field]] - [status-im.components.styles :refer [color-purple]] + [status-im.components.styles :refer [color-blue + separator-color]] [status-im.components.status-bar :refer [status-bar]] [status-im.components.toolbar.view :refer [toolbar]] [status-im.utils.listview :refer [to-datasource]] @@ -42,8 +43,8 @@ (not (s/valid? ::v/not-illegal-name new-chat-name)) (label :t/illegal-group-chat-name)) :wrapper-style st/group-chat-name-wrapper - :error-color "#7099e6" - :line-color "#0000001f" + :error-color color-blue + :line-color separator-color :label-hidden? true :input-style st/group-chat-name-input :auto-focus true diff --git a/src/status_im/profile/styles.cljs b/src/status_im/profile/styles.cljs index 545e99022b..befa265d27 100644 --- a/src/status_im/profile/styles.cljs +++ b/src/status_im/profile/styles.cljs @@ -1,17 +1,14 @@ (ns status-im.profile.styles - (:require [status-im.components.styles :refer [color-light-blue-transparent - color-white + (:require [status-im.components.styles :refer [color-white color-gray color-black color-blue color-blue-transparent - selected-message-color - online-color - separator-color text1-color text1-disabled-color text2-color - color-red]] + color-red + separator-color]] [status-im.utils.platform :as p])) (def profile @@ -165,7 +162,7 @@ :elevation 4}) (def underline-container - {:background-color "#0000001f" + {:background-color separator-color :margin-bottom 18 :height 1 :align-items :center}) diff --git a/src/status_im/protocol/listeners.cljs b/src/status_im/protocol/listeners.cljs index dd81faf6da..2f0b48dee0 100644 --- a/src/status_im/protocol/listeners.cljs +++ b/src/status_im/protocol/listeners.cljs @@ -19,7 +19,7 @@ (defn- parse-content [key {:keys [content]} was-encrypted?] (debug :parse-content - "Key exitsts:" (not (nil? key)) + "Key exists:" (not (nil? key)) "Content exists:" (not (nil? content))) (if (and (not was-encrypted?) key content) (decrypt key content) diff --git a/src/status_im/transactions/styles.cljs b/src/status_im/transactions/styles.cljs index f904fbe31e..cfb7ad8cf5 100644 --- a/src/status_im/transactions/styles.cljs +++ b/src/status_im/transactions/styles.cljs @@ -1,4 +1,6 @@ -(ns status-im.transactions.styles) +(ns status-im.transactions.styles + (:require [status-im.components.styles :refer [color-gray + color-black]])) (def transactions-screen {:flex 1 @@ -83,12 +85,12 @@ (def transaction-info-title {:textAlign :right - :color "#838c93de" + :color color-gray :fontSize 14 :lineHeight 20}) (def transaction-info-value - {:color "#000000de" + {:color color-black :fontSize 14 :lineHeight 20 }) diff --git a/src/status_im/transactions/views/transaction_page.cljs b/src/status_im/transactions/views/transaction_page.cljs index 21572a15ca..46e948a17a 100644 --- a/src/status_im/transactions/views/transaction_page.cljs +++ b/src/status_im/transactions/views/transaction_page.cljs @@ -8,8 +8,7 @@ scroll-view touchable-highlight touchable-opacity]] - [status-im.components.styles :refer [icon-ok - icon-close]] + [status-im.components.styles :refer [icon-close]] [status-im.transactions.styles :as st] [status-im.i18n :refer [label label-pluralize]]))