From bf6b328996581c77fff437efcbf9d411e00d2ef9 Mon Sep 17 00:00:00 2001 From: yenda Date: Wed, 25 Sep 2019 12:44:07 +0200 Subject: [PATCH] replace require-macro for defnstyle and defstyle - renamed the macros def and defn so that they are now used with aliased namespace `styles/def` and `styles/defn` to force user to use aliased require instead of require-macro and refer - this makes sure the cljs file is required which includes the require for platform ns needed after macroexpension Signed-off-by: yenda --- TROUBLESHOOTING.md | 2 ++ .../commands/impl/transactions/styles.cljs | 1 - .../network/ui/edit_network/styles.cljs | 1 - src/status_im/network/ui/styles.cljs | 14 ++++---- .../ui/components/common/styles.cljs | 6 ++-- .../ui/components/connectivity/styles.cljs | 3 +- src/status_im/ui/components/list/styles.cljs | 8 ++--- .../ui/components/status_bar/styles.cljs | 35 +++++++++---------- .../ui/components/tabbar/styles.cljs | 10 +++--- .../ui/components/text_input/styles.cljs | 6 ++-- .../ui/components/toolbar/styles.cljs | 3 +- .../ui/components/tooltip/styles.cljs | 7 ++-- .../add_new/new_public_chat/styles.cljs | 1 - src/status_im/ui/screens/add_new/styles.cljs | 10 +++--- .../edit_bootnode/styles.cljs | 16 ++++----- .../ui/screens/bootnodes_settings/styles.cljs | 8 ++--- .../ui/screens/browser/open_dapp/styles.cljs | 10 +++--- .../screens/browser/site_blocked/styles.cljs | 1 - src/status_im/ui/screens/browser/styles.cljs | 10 +++--- .../ui/screens/chat/styles/input/input.cljs | 16 ++++----- .../chat/styles/input/suggestions.cljs | 1 - .../screens/chat/styles/message/datemark.cljs | 1 - .../screens/chat/styles/message/message.cljs | 8 ++--- .../screens/chat/styles/message/options.cljs | 7 ++-- .../ui/screens/currency_settings/styles.cljs | 6 ++-- .../ui/screens/fleet_settings/styles.cljs | 8 ++--- src/status_im/ui/screens/group/styles.cljs | 1 - .../ui/screens/hardwallet/pin/styles.cljs | 8 ++--- .../ui/screens/hardwallet/setup/styles.cljs | 6 ++-- src/status_im/ui/screens/home/styles.cljs | 21 ++++++----- src/status_im/ui/screens/intro/styles.cljs | 1 - .../ui/screens/log_level_settings/styles.cljs | 6 ++-- .../screens/multiaccounts/login/styles.cljs | 8 ++--- .../screens/multiaccounts/recover/styles.cljs | 6 ++-- .../ui/screens/multiaccounts/styles.cljs | 5 ++- .../edit_mailserver/styles.cljs | 14 ++++---- .../offline_messaging_settings/styles.cljs | 10 +++--- src/status_im/ui/screens/pairing/styles.cljs | 15 ++++---- .../ui/screens/profile/components/styles.cljs | 15 ++++---- .../ui/screens/profile/contact/styles.cljs | 1 - .../ui/screens/qr_scanner/styles.cljs | 2 +- .../ui/screens/wallet/components/styles.cljs | 9 +++-- .../ui/screens/wallet/send/styles.cljs | 3 +- .../screens/wallet/transactions/styles.cljs | 8 ++--- src/status_im/utils/styles.clj | 11 +++--- 45 files changed, 165 insertions(+), 184 deletions(-) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index ddb405f15f..7179318a75 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -12,6 +12,8 @@ The general fix for that type of issue is to have two files for the namespace wh That way you don't need to use any magical call like `find-ns` or inline `require` with some kind of call only once switch (which was the root cause of another bug in ``defstyle`` macro because the compilation phase at which the evaluation of the switch is done was not properly considered). +You also want to make sure users are using the macro by using a aliased namespace defined in require statement rather than require-macro and refer to the macro directly. Otherwise it won't require the cljs file and the require statement of the namespace in the macroexpension might not be there. + ## Stacktrace ``` diff --git a/src/status_im/chat/commands/impl/transactions/styles.cljs b/src/status_im/chat/commands/impl/transactions/styles.cljs index 2575dabbab..4711dfea7f 100644 --- a/src/status_im/chat/commands/impl/transactions/styles.cljs +++ b/src/status_im/chat/commands/impl/transactions/styles.cljs @@ -1,5 +1,4 @@ (ns status-im.chat.commands.impl.transactions.styles - (:require-macros [status-im.utils.styles :refer [defstyle defnstyle]]) (:require [status-im.ui.components.colors :as colors])) (def asset-container diff --git a/src/status_im/network/ui/edit_network/styles.cljs b/src/status_im/network/ui/edit_network/styles.cljs index b112c41ce9..e358190789 100644 --- a/src/status_im/network/ui/edit_network/styles.cljs +++ b/src/status_im/network/ui/edit_network/styles.cljs @@ -1,5 +1,4 @@ (ns status-im.network.ui.edit-network.styles - (:require-macros [status-im.utils.styles :refer [defstyle]]) (:require [status-im.ui.components.colors :as colors] [status-im.ui.components.styles :as styles])) diff --git a/src/status_im/network/ui/styles.cljs b/src/status_im/network/ui/styles.cljs index fcbcd3dabe..4da2568d44 100644 --- a/src/status_im/network/ui/styles.cljs +++ b/src/status_im/network/ui/styles.cljs @@ -1,7 +1,7 @@ (ns status-im.network.ui.styles - (:require-macros [status-im.utils.styles :refer [defstyle defnstyle]]) (:require [status-im.ui.components.colors :as colors] - [status-im.ui.components.styles :as components.styles])) + [status-im.ui.components.styles :as components.styles] + [status-im.utils.styles :as styles])) (def wrapper {:flex 1 @@ -10,7 +10,7 @@ (def badge-name-text {:font-size 17}) -(defstyle badge-connected-text +(styles/def badge-connected-text {:color colors/gray :ios {:margin-top 5}}) @@ -39,7 +39,7 @@ :margin-top 8 :height 20}) -(defstyle network-config-container +(styles/def network-config-container {:height 160 :margin-top 8 :padding-top 16 @@ -50,7 +50,7 @@ :opacity 0.9} :android {:border-radius 4}}) -(defstyle network-config-text +(styles/def network-config-text {:font-size 17 :ios {:opacity 0.8} :android {:opacity 0.4}}) @@ -60,7 +60,7 @@ :margin-vertical 16 :margin-horizontal 16}) -(defstyle edit-button +(styles/def edit-button {:height 52 :align-items :center :justify-content :center @@ -93,7 +93,7 @@ :flex-direction :row :align-items :center}) -(defstyle network-item +(styles/def network-item {:flex-direction :row :background-color :white :align-items :center diff --git a/src/status_im/ui/components/common/styles.cljs b/src/status_im/ui/components/common/styles.cljs index a299953c12..29d9ceb4d1 100644 --- a/src/status_im/ui/components/common/styles.cljs +++ b/src/status_im/ui/components/common/styles.cljs @@ -1,11 +1,11 @@ (ns status-im.ui.components.common.styles - (:require-macros [status-im.utils.styles :refer [defstyle defnstyle]]) - (:require [status-im.ui.components.colors :as colors])) + (:require [status-im.ui.components.colors :as colors] + [status-im.utils.styles :as styles])) (def separator-wrapper {:background-color colors/white}) -(defstyle separator +(styles/def separator {:android {:height 0} :ios {:height 1 :background-color colors/black-transparent diff --git a/src/status_im/ui/components/connectivity/styles.cljs b/src/status_im/ui/components/connectivity/styles.cljs index 66416ba98f..27c79ad819 100644 --- a/src/status_im/ui/components/connectivity/styles.cljs +++ b/src/status_im/ui/components/connectivity/styles.cljs @@ -1,9 +1,8 @@ (ns status-im.ui.components.connectivity.styles - (:require-macros [status-im.utils.styles :refer [defnstyle]]) (:require [status-im.ui.components.colors :as colors] [status-im.utils.platform :as platform])) -(defnstyle text-wrapper +(defn text-wrapper [{:keys [window-width height background-color opacity transform]}] (cond-> {:flex-direction :row :justify-content :center diff --git a/src/status_im/ui/components/list/styles.cljs b/src/status_im/ui/components/list/styles.cljs index 602877087f..52be1027bf 100644 --- a/src/status_im/ui/components/list/styles.cljs +++ b/src/status_im/ui/components/list/styles.cljs @@ -1,6 +1,6 @@ (ns status-im.ui.components.list.styles - (:require-macros [status-im.utils.styles :refer [defstyle]]) - (:require [status-im.ui.components.colors :as colors])) + (:require [status-im.ui.components.colors :as colors] + [status-im.utils.styles :as styles])) (def item {:flex-direction :row @@ -146,11 +146,11 @@ base-separator {:margin-left 64})) -(defstyle list-header-footer-spacing +(styles/def list-header-footer-spacing {:android {:background-color colors/white :height 8}}) -(defstyle section-header +(styles/def section-header {:font-size 14 :color colors/gray :margin-left 16 diff --git a/src/status_im/ui/components/status_bar/styles.cljs b/src/status_im/ui/components/status_bar/styles.cljs index 07a7575969..e5da6ae3fd 100644 --- a/src/status_im/ui/components/status_bar/styles.cljs +++ b/src/status_im/ui/components/status_bar/styles.cljs @@ -1,8 +1,7 @@ (ns status-im.ui.components.status-bar.styles (:require [status-im.ui.components.colors :as colors] - [status-im.ui.components.styles :as styles] - [status-im.utils.platform :as platform]) - (:require-macros [status-im.utils.styles :refer [defstyle]])) + [status-im.utils.platform :as platform] + [status-im.utils.styles :as styles])) (defn- create-status-bar-style [{:keys [background-color bar-style translucent?] :or {bar-style "light-content"}}] @@ -17,13 +16,13 @@ :height height}) ;; :main -(defstyle status-bar-main +(styles/def status-bar-main {:ios (create-status-bar-style {:background-color colors/white :bar-style "default"}) :android (create-status-bar-style {:translucent? true :bar-style "dark-content"})}) -(defstyle status-bar-main-main +(styles/def status-bar-main-main {:ios (create-status-bar-style {:background-color colors/white :bar-style "default"}) :android (create-status-bar-style {:background-color colors/black @@ -32,13 +31,13 @@ (def view-main (create-view-style {:background-color colors/white})) -(defstyle view-modal-main +(styles/def view-modal-main {:ios (create-view-style {:background-color colors/white}) :android (create-view-style {:background-color colors/black :height 0})}) ;; :transparent -(defstyle status-bar-transparent +(styles/def status-bar-transparent {:ios (create-status-bar-style {:background-color colors/transparent}) :android (create-status-bar-style {:translucent? true})}) @@ -46,23 +45,23 @@ (create-view-style {:background-color colors/transparent})) ;; :modal -(defstyle status-bar-modal +(styles/def status-bar-modal {:ios (create-status-bar-style {:background-color "#2f3031"}) :android (create-status-bar-style {:background-color colors/black})}) -(defstyle view-modal +(styles/def view-modal {:ios (create-view-style {:background-color "#2f3031"}) :android (create-view-style {:background-color colors/black :height 0})}) ;; :modal-white -(defstyle status-bar-modal-white +(styles/def status-bar-modal-white {:ios (create-status-bar-style {:background-color colors/white :bar-style "default"}) :android (create-status-bar-style {:background-color colors/black :bar-style "light-content"})}) -(defstyle view-modal-white +(styles/def view-modal-white {:ios (create-view-style {:background-color colors/white}) :android (create-view-style {:background-color colors/black :height 0})}) @@ -71,17 +70,17 @@ (def status-bar-modal-wallet (create-status-bar-style {:background-color colors/blue})) -(defstyle view-modal-wallet +(styles/def view-modal-wallet {:ios (create-view-style {:background-color colors/blue}) :android (create-view-style {:background-color colors/blue :height 0})}) ;; :transaction -(defstyle status-bar-transaction +(styles/def status-bar-transaction {:ios (create-status-bar-style {:background-color colors/transparent}) :android (create-status-bar-style {:background-color colors/black})}) -(defstyle view-transaction +(styles/def view-transaction {:ios (create-view-style {:background-color colors/transparent}) :android (create-view-style {:background-color colors/black :height 0})}) @@ -89,7 +88,7 @@ ;; TODO(jeluard) Fix status-bar mess by removing useless view and introducing 2dn level tab-bar ;; :wallet HOME -(defstyle status-bar-wallet-tab +(styles/def status-bar-wallet-tab {:ios (create-status-bar-style {:background-color colors/blue}) :android (create-status-bar-style {:translucent? true})}) @@ -97,7 +96,7 @@ (create-view-style {:background-color colors/blue})) ;; :wallet -(defstyle status-bar-wallet +(styles/def status-bar-wallet {:ios (create-status-bar-style {:background-color colors/blue}) :android (create-status-bar-style {:translucent? true})}) @@ -105,11 +104,11 @@ (create-view-style {:background-color colors/blue})) ;; :default -(defstyle status-bar-default +(styles/def status-bar-default {:ios (create-status-bar-style {:background-color colors/white :bar-style "default"}) :android (create-status-bar-style {:translucent? true :bar-style "dark-content"})}) -(defstyle view-default +(def view-default (create-view-style {})) diff --git a/src/status_im/ui/components/tabbar/styles.cljs b/src/status_im/ui/components/tabbar/styles.cljs index fe40858f76..ed75e94c10 100644 --- a/src/status_im/ui/components/tabbar/styles.cljs +++ b/src/status_im/ui/components/tabbar/styles.cljs @@ -1,8 +1,8 @@ (ns status-im.ui.components.tabbar.styles - (:require [status-im.ui.components.colors :as colors] + (:require [status-im.ui.components.animation :as animation] + [status-im.ui.components.colors :as colors] [status-im.utils.platform :as platform] - [status-im.ui.components.animation :as animation]) - (:require-macros [status-im.utils.styles :refer [defnstyle defstyle]])) + [status-im.utils.styles :as styles])) (def tabs-height (cond @@ -31,7 +31,7 @@ :justify-content :center :align-items :center}) -(defnstyle tab-title [active?] +(styles/defn tab-title [active?] {:ios {:font-size 11} :android {:font-size 11} :desktop {:font-size 12 @@ -79,7 +79,7 @@ {:color (if active? colors/blue colors/gray) :font-size 11}) -(defstyle new-tabs-container +(styles/def new-tabs-container {:height tabs-height :align-self :stretch :ios {:background-color :white diff --git a/src/status_im/ui/components/text_input/styles.cljs b/src/status_im/ui/components/text_input/styles.cljs index db2955861d..18455f987b 100644 --- a/src/status_im/ui/components/text_input/styles.cljs +++ b/src/status_im/ui/components/text_input/styles.cljs @@ -1,7 +1,7 @@ (ns status-im.ui.components.text-input.styles - (:require-macros [status-im.utils.styles :refer [defstyle defnstyle]]) (:require [status-im.ui.components.colors :as colors] - [status-im.utils.platform :as p])) + [status-im.utils.platform :as p] + [status-im.utils.styles :as styles])) (defn label [editable] (merge @@ -19,7 +19,7 @@ {:border-color colors/gray-lighter :border-width 1}))) -(defstyle input +(styles/def input {:padding 0 :text-align-vertical :top :desktop {:height 52}}) diff --git a/src/status_im/ui/components/toolbar/styles.cljs b/src/status_im/ui/components/toolbar/styles.cljs index 3bf0889c5c..d8305d1159 100644 --- a/src/status_im/ui/components/toolbar/styles.cljs +++ b/src/status_im/ui/components/toolbar/styles.cljs @@ -1,5 +1,4 @@ (ns status-im.ui.components.toolbar.styles - (:require-macros [status-im.utils.styles :refer [defstyle defnstyle]]) (:require [status-im.ui.components.colors :as colors])) (def toolbar-height 56) @@ -40,7 +39,7 @@ (def item-text {:color colors/blue}) -(defstyle item-text-action +(def item-text-action {:color colors/blue}) (def toolbar-text-action-disabled diff --git a/src/status_im/ui/components/tooltip/styles.cljs b/src/status_im/ui/components/tooltip/styles.cljs index 27fbd0e3e8..472eefc922 100644 --- a/src/status_im/ui/components/tooltip/styles.cljs +++ b/src/status_im/ui/components/tooltip/styles.cljs @@ -1,7 +1,6 @@ (ns status-im.ui.components.tooltip.styles - (:require-macros [status-im.utils.styles :refer [defstyle defnstyle]]) - (:require [status-im.ui.components.styles :as styles] - [status-im.ui.components.colors :as colors])) + (:require [status-im.ui.components.colors :as colors] + [status-im.utils.styles :as styles])) (def tooltip-container {:position :absolute @@ -10,7 +9,7 @@ :right 0 :top 0}) -(defstyle bottom-tooltip-container +(styles/def bottom-tooltip-container {:position :absolute :align-items :center :left 12 diff --git a/src/status_im/ui/screens/add_new/new_public_chat/styles.cljs b/src/status_im/ui/screens/add_new/new_public_chat/styles.cljs index e0fa81a935..e375b24768 100644 --- a/src/status_im/ui/screens/add_new/new_public_chat/styles.cljs +++ b/src/status_im/ui/screens/add_new/new_public_chat/styles.cljs @@ -1,5 +1,4 @@ (ns status-im.ui.screens.add-new.new-public-chat.styles - (:require-macros [status-im.utils.styles :refer [defstyle]]) (:require [status-im.ui.components.colors :as colors])) (def group-chat-name-input diff --git a/src/status_im/ui/screens/add_new/styles.cljs b/src/status_im/ui/screens/add_new/styles.cljs index 830dda2c9b..ce9966a98a 100644 --- a/src/status_im/ui/screens/add_new/styles.cljs +++ b/src/status_im/ui/screens/add_new/styles.cljs @@ -1,7 +1,7 @@ (ns status-im.ui.screens.add-new.styles - (:require-macros [status-im.utils.styles :refer [defstyle defnstyle]]) (:require [status-im.ui.components.colors :as colors] - [status-im.ui.components.styles :as styles])) + [status-im.ui.components.styles :as components.styles] + [status-im.utils.styles :as styles])) (def new-chat-container {:flex-direction :row @@ -10,7 +10,7 @@ (def input-container {:flex-direction :row :align-items :center - :border-radius styles/border-radius + :border-radius components.styles/border-radius :height 52 :background-color colors/gray-lighter :margin-horizontal 14 @@ -25,7 +25,7 @@ (def button-container {:justify-content :center - :border-radius styles/border-radius + :border-radius components.styles/border-radius :height 52 :background-color colors/gray-lighter :padding-horizontal 15 @@ -33,7 +33,7 @@ :margin-left 3 :margin-top 24}) -(defnstyle input [w] +(styles/defn input [w] {:padding-horizontal 14 :width w :desktop {:height 30 diff --git a/src/status_im/ui/screens/bootnodes_settings/edit_bootnode/styles.cljs b/src/status_im/ui/screens/bootnodes_settings/edit_bootnode/styles.cljs index 4544d4e580..30075e0a35 100644 --- a/src/status_im/ui/screens/bootnodes_settings/edit_bootnode/styles.cljs +++ b/src/status_im/ui/screens/bootnodes_settings/edit_bootnode/styles.cljs @@ -1,17 +1,17 @@ (ns status-im.ui.screens.bootnodes-settings.edit-bootnode.styles - (:require-macros [status-im.utils.styles :refer [defstyle]]) - (:require [status-im.ui.components.styles :as styles] - [status-im.ui.components.colors :as colors])) + (:require [status-im.ui.components.colors :as colors] + [status-im.ui.components.styles :as components.styles] + [status-im.utils.styles :as styles])) (def input-container {:flex-direction :row :align-items :center :justify-content :space-between - :border-radius styles/border-radius + :border-radius components.styles/border-radius :height 52 :margin-top 15}) -(defstyle input +(styles/def input {:flex 1 :android {:padding 0}}) @@ -33,7 +33,7 @@ :margin-bottom 16 :margin-horizontal 16}) -(def button +(styles/def button {:height 52 :align-items :center :justify-content :center @@ -44,11 +44,11 @@ {:color colors/white :font-size 17}) -(defstyle delete-button +(def delete-button (assoc button :background-color colors/red)) (def container (merge - styles/flex + components.styles/flex {:background-color colors/white})) diff --git a/src/status_im/ui/screens/bootnodes_settings/styles.cljs b/src/status_im/ui/screens/bootnodes_settings/styles.cljs index 12fc4a24a0..a9f4c293c2 100644 --- a/src/status_im/ui/screens/bootnodes_settings/styles.cljs +++ b/src/status_im/ui/screens/bootnodes_settings/styles.cljs @@ -1,6 +1,6 @@ (ns status-im.ui.screens.bootnodes-settings.styles - (:require [status-im.ui.components.colors :as colors]) - (:require-macros [status-im.utils.styles :refer [defstyle]])) + (:require [status-im.ui.components.colors :as colors] + [status-im.utils.styles :as styles])) (def wrapper {:flex 1 @@ -9,7 +9,7 @@ (def bootnode-item-inner {:padding-horizontal 16}) -(defstyle bootnode-item +(styles/def bootnode-item {:flex-direction :row :background-color :white :align-items :center @@ -20,7 +20,7 @@ (def bootnode-item-name-text {:font-size 17}) -(defstyle switch-container +(def switch-container {:height 50 :background-color colors/white :padding-left 15}) diff --git a/src/status_im/ui/screens/browser/open_dapp/styles.cljs b/src/status_im/ui/screens/browser/open_dapp/styles.cljs index 894ea4c13d..6da7d88710 100644 --- a/src/status_im/ui/screens/browser/open_dapp/styles.cljs +++ b/src/status_im/ui/screens/browser/open_dapp/styles.cljs @@ -1,10 +1,10 @@ (ns status-im.ui.screens.browser.open-dapp.styles - (:require-macros [status-im.utils.styles :refer [defnstyle defstyle]]) (:require [status-im.ui.components.colors :as colors] - [status-im.ui.components.styles :as styles])) + [status-im.ui.components.styles :as components.styles] + [status-im.utils.styles :as styles])) -(defstyle input - {:border-radius styles/border-radius +(styles/def input + {:border-radius components.styles/border-radius :background-color colors/gray-lighter :margin-horizontal 16 :margin-bottom 9 @@ -62,4 +62,4 @@ :font-weight "500" :color colors/gray :line-height 18 - :margin-top 2}) \ No newline at end of file + :margin-top 2}) diff --git a/src/status_im/ui/screens/browser/site_blocked/styles.cljs b/src/status_im/ui/screens/browser/site_blocked/styles.cljs index 8c31cd864e..da1e7545c1 100644 --- a/src/status_im/ui/screens/browser/site_blocked/styles.cljs +++ b/src/status_im/ui/screens/browser/site_blocked/styles.cljs @@ -1,5 +1,4 @@ (ns status-im.ui.screens.browser.site-blocked.styles - (:require-macros [status-im.utils.styles :refer [defstyle defnstyle]]) (:require [status-im.ui.components.colors :as colors])) (def container diff --git a/src/status_im/ui/screens/browser/styles.cljs b/src/status_im/ui/screens/browser/styles.cljs index 6a1353f5c1..e85fe1e5f1 100644 --- a/src/status_im/ui/screens/browser/styles.cljs +++ b/src/status_im/ui/screens/browser/styles.cljs @@ -1,10 +1,10 @@ (ns status-im.ui.screens.browser.styles - (:require [status-im.ui.components.colors :as colors]) - (:require-macros [status-im.utils.styles :refer [defnstyle defstyle]])) + (:require [status-im.ui.components.colors :as colors] + [status-im.utils.styles :as styles])) (def browser {:flex 1}) -(defstyle dapp-name +(styles/def dapp-name {:flex 1 :justify-content :center :margin-left 12 @@ -13,7 +13,7 @@ (def dapp-name-text {:font-size 16}) -(defstyle dapp-text +(styles/def dapp-text {:color colors/gray :ios {:margin-top 4} :android {:font-size 13}}) @@ -63,7 +63,7 @@ :margin-top 10 :margin-left 56}) -(defstyle url-input +(def url-input {:flex 1 :text-align-vertical :center :margin 0 diff --git a/src/status_im/ui/screens/chat/styles/input/input.cljs b/src/status_im/ui/screens/chat/styles/input/input.cljs index 2365207660..585489f5bf 100644 --- a/src/status_im/ui/screens/chat/styles/input/input.cljs +++ b/src/status_im/ui/screens/chat/styles/input/input.cljs @@ -1,14 +1,14 @@ (ns status-im.ui.screens.chat.styles.input.input - (:require-macros [status-im.utils.styles :refer [defstyle defnstyle]]) (:require [status-im.ui.components.colors :as colors] - [status-im.ui.screens.chat.styles.message.message :refer [message-author-name]])) + [status-im.ui.screens.chat.styles.message.message :refer [message-author-name]] + [status-im.utils.styles :as styles])) (def min-input-height 36) (def padding-vertical 8) (def border-height 1) (def max-input-height (* 5 min-input-height)) -(defnstyle root [margin-bottom] +(defn root [margin-bottom] {:background-color colors/white :margin-bottom margin-bottom :flex-direction :column @@ -75,7 +75,7 @@ :min-height min-input-height :max-height max-input-height}) -(defnstyle input-view [single-line-input?] +(styles/defn input-view [single-line-input?] {:flex 1 :padding-top 9 :padding-bottom 5 @@ -92,7 +92,7 @@ :background-color :transparent :color :transparent}) -(defnstyle invisible-input-text-height [container-width] +(styles/defn invisible-input-text-height [container-width] {:width container-width :flex 1 :padding-top 5 @@ -103,7 +103,7 @@ :background-color :transparent :color :transparent}) -(defnstyle input-helper-view [left opacity] +(styles/defn input-helper-view [left opacity] {:opacity opacity :position :absolute :height min-input-height @@ -111,7 +111,7 @@ :ios {:left left} :desktop {:left left}}) -(defnstyle input-helper-text [left] +(styles/defn input-helper-text [left] {:color colors/gray :text-align-vertical :center :flex 1 @@ -119,7 +119,7 @@ :ios {:line-height min-input-height} :desktop {:line-height min-input-height}}) -(defnstyle seq-input-text [left container-width] +(styles/defn seq-input-text [left container-width] {:min-width (- container-width left) :position :absolute :text-align-vertical :center diff --git a/src/status_im/ui/screens/chat/styles/input/suggestions.cljs b/src/status_im/ui/screens/chat/styles/input/suggestions.cljs index 5146243f7e..033c6752d0 100644 --- a/src/status_im/ui/screens/chat/styles/input/suggestions.cljs +++ b/src/status_im/ui/screens/chat/styles/input/suggestions.cljs @@ -1,5 +1,4 @@ (ns status-im.ui.screens.chat.styles.input.suggestions - (:require-macros [status-im.utils.styles :refer [defnstyle]]) (:require [status-im.ui.components.colors :as colors])) (def item-height 52) diff --git a/src/status_im/ui/screens/chat/styles/message/datemark.cljs b/src/status_im/ui/screens/chat/styles/message/datemark.cljs index 6c6d258a35..477edfe85f 100644 --- a/src/status_im/ui/screens/chat/styles/message/datemark.cljs +++ b/src/status_im/ui/screens/chat/styles/message/datemark.cljs @@ -1,5 +1,4 @@ (ns status-im.ui.screens.chat.styles.message.datemark - (:require-macros [status-im.utils.styles :refer [defstyle]]) (:require [status-im.ui.components.colors :as colors])) (def datemark-wrapper diff --git a/src/status_im/ui/screens/chat/styles/message/message.cljs b/src/status_im/ui/screens/chat/styles/message/message.cljs index d9f81ff72f..6f42de0af0 100644 --- a/src/status_im/ui/screens/chat/styles/message/message.cljs +++ b/src/status_im/ui/screens/chat/styles/message/message.cljs @@ -1,9 +1,9 @@ (ns status-im.ui.screens.chat.styles.message.message - (:require-macros [status-im.utils.styles :refer [defstyle defnstyle]]) - (:require [status-im.ui.components.colors :as colors] + (:require [status-im.constants :as constants] + [status-im.ui.components.colors :as colors] [status-im.ui.screens.chat.styles.photos :as photos] [status-im.utils.platform :as platform] - [status-im.constants :as constants])) + [status-im.utils.styles :as styles])) (defn style-message-text [outgoing] @@ -132,7 +132,7 @@ :line-height 22 :margin-bottom (if collapsed? 2 0))) -(defnstyle emoji-message +(styles/defn emoji-message [{:keys [incoming-group]}] {:font-size 40 :desktop {:line-height 46} diff --git a/src/status_im/ui/screens/chat/styles/message/options.cljs b/src/status_im/ui/screens/chat/styles/message/options.cljs index 18b6ad9383..82909addd3 100644 --- a/src/status_im/ui/screens/chat/styles/message/options.cljs +++ b/src/status_im/ui/screens/chat/styles/message/options.cljs @@ -1,9 +1,8 @@ (ns status-im.ui.screens.chat.styles.message.options - (:require-macros [status-im.utils.styles :refer [defstyle defnstyle]]) - (:require [status-im.ui.components.styles :as styles] - [status-im.ui.components.colors :as colors])) + (:require [status-im.ui.components.colors :as colors] + [status-im.utils.styles :as styles])) -(defstyle row +(styles/def row {:flex-direction :row :background-color :white :align-items :center diff --git a/src/status_im/ui/screens/currency_settings/styles.cljs b/src/status_im/ui/screens/currency_settings/styles.cljs index 0587bfa3b6..c1a178d549 100644 --- a/src/status_im/ui/screens/currency_settings/styles.cljs +++ b/src/status_im/ui/screens/currency_settings/styles.cljs @@ -1,12 +1,12 @@ (ns status-im.ui.screens.currency-settings.styles - (:require-macros [status-im.utils.styles :refer [defstyle]]) - (:require [status-im.ui.components.colors :as colors])) + (:require [status-im.ui.components.colors :as colors] + [status-im.utils.styles :as styles])) (def wrapper {:flex 1 :background-color :white}) -(defstyle currency-item +(styles/def currency-item {:flex-direction :row :justify-content :space-between :background-color :white diff --git a/src/status_im/ui/screens/fleet_settings/styles.cljs b/src/status_im/ui/screens/fleet_settings/styles.cljs index 2d2e0155e7..dae449f0c9 100644 --- a/src/status_im/ui/screens/fleet_settings/styles.cljs +++ b/src/status_im/ui/screens/fleet_settings/styles.cljs @@ -1,7 +1,7 @@ (ns status-im.ui.screens.fleet-settings.styles (:require [status-im.ui.components.colors :as colors] - [status-im.utils.platform :as platform]) - (:require-macros [status-im.utils.styles :refer [defstyle]])) + [status-im.utils.platform :as platform] + [status-im.utils.styles :as styles])) (def wrapper {:flex 1 @@ -10,7 +10,7 @@ (def fleet-item-inner {:padding-horizontal 16}) -(defstyle fleet-item +(styles/def fleet-item {:flex-direction :row :background-color :white :align-items :center @@ -21,7 +21,7 @@ (def fleet-item-name-text {:font-size 17}) -(defstyle fleet-item-connected-text +(def fleet-item-connected-text {:color colors/gray :font-size 14 :margin-top 6}) diff --git a/src/status_im/ui/screens/group/styles.cljs b/src/status_im/ui/screens/group/styles.cljs index a153aacfa3..26a22228a9 100644 --- a/src/status_im/ui/screens/group/styles.cljs +++ b/src/status_im/ui/screens/group/styles.cljs @@ -1,5 +1,4 @@ (ns status-im.ui.screens.group.styles - (:require-macros [status-im.utils.styles :refer [defstyle]]) (:require [status-im.ui.components.colors :as colors])) (defn toolbar-icon [enabled?] diff --git a/src/status_im/ui/screens/hardwallet/pin/styles.cljs b/src/status_im/ui/screens/hardwallet/pin/styles.cljs index 3fdaa5ce9b..8e894d9819 100644 --- a/src/status_im/ui/screens/hardwallet/pin/styles.cljs +++ b/src/status_im/ui/screens/hardwallet/pin/styles.cljs @@ -1,19 +1,19 @@ (ns status-im.ui.screens.hardwallet.pin.styles - (:require-macros [status-im.utils.styles :refer [defstyle]]) - (:require [status-im.ui.components.colors :as colors])) + (:require [status-im.ui.components.colors :as colors] + [status-im.utils.styles :as styles])) (def container {:flex 1 :background-color colors/white}) -(defstyle pin-container +(styles/def pin-container {:flex 1 :flex-direction :column :justify-content :space-between :android {:margin-top 10} :ios {:margin-top 10}}) -(defstyle error-container +(styles/def error-container {:height 22}) (def error-text diff --git a/src/status_im/ui/screens/hardwallet/setup/styles.cljs b/src/status_im/ui/screens/hardwallet/setup/styles.cljs index 23d85aa87c..5491979811 100644 --- a/src/status_im/ui/screens/hardwallet/setup/styles.cljs +++ b/src/status_im/ui/screens/hardwallet/setup/styles.cljs @@ -1,6 +1,6 @@ (ns status-im.ui.screens.hardwallet.setup.styles - (:require-macros [status-im.utils.styles :refer [defstyle]]) - (:require [status-im.ui.components.colors :as colors])) + (:require [status-im.ui.components.colors :as colors] + [status-im.utils.styles :as styles])) (def container {:flex 1 @@ -249,7 +249,7 @@ :text-align :center :border-color colors/gray-lighter}) -(defstyle puk-code-numbers-inner-container +(styles/def puk-code-numbers-inner-container {:width "85%" :android {:margin-horizontal 16} :height 94 diff --git a/src/status_im/ui/screens/home/styles.cljs b/src/status_im/ui/screens/home/styles.cljs index 254fc21efb..d9cbcdb5d4 100644 --- a/src/status_im/ui/screens/home/styles.cljs +++ b/src/status_im/ui/screens/home/styles.cljs @@ -1,15 +1,15 @@ (ns status-im.ui.screens.home.styles - (:require-macros [status-im.utils.styles :refer [defstyle defnstyle]]) (:require [status-im.ui.components.colors :as colors] - [status-im.utils.platform :as platform])) + [status-im.utils.styles :as styles])) (defn toolbar [] {:background-color colors/white}) -(defstyle sync-wrapper +(def sync-wrapper {:flex-direction :row}) -(defstyle sync-info {:margin-horizontal 15}) +(def sync-info + {:margin-horizontal 15}) (def last-message-container {:flex-shrink 1}) @@ -39,11 +39,10 @@ :justify-content :center :border-radius 8}) -(def search-input - (merge {:flex 1} - (when platform/android? - {:margin 0 - :padding 0}))) +(styles/def search-input + {:flex 1 + :android {:margin 0 + :padding 0}}) (def filter-section-title {:margin-left 16 @@ -62,7 +61,7 @@ :width 16 :height 16}) -(defstyle datetime-text +(def datetime-text {:color colors/text-gray :font-size 10 :text-align :right @@ -70,7 +69,7 @@ :align-items :center :line-height 12}) -(defstyle new-messages-text +(styles/def new-messages-text {:left 0 :font-size 12 :color colors/blue diff --git a/src/status_im/ui/screens/intro/styles.cljs b/src/status_im/ui/screens/intro/styles.cljs index 161673a720..bda963e442 100644 --- a/src/status_im/ui/screens/intro/styles.cljs +++ b/src/status_im/ui/screens/intro/styles.cljs @@ -1,5 +1,4 @@ (ns status-im.ui.screens.intro.styles - (:require-macros [status-im.utils.styles :refer [defnstyle defstyle]]) (:require [status-im.ui.components.colors :as colors])) (def intro-view diff --git a/src/status_im/ui/screens/log_level_settings/styles.cljs b/src/status_im/ui/screens/log_level_settings/styles.cljs index f1104d790e..0488fdc1db 100644 --- a/src/status_im/ui/screens/log_level_settings/styles.cljs +++ b/src/status_im/ui/screens/log_level_settings/styles.cljs @@ -1,7 +1,7 @@ (ns status-im.ui.screens.log-level-settings.styles (:require [status-im.ui.components.colors :as colors] - [status-im.utils.platform :as platform]) - (:require-macros [status-im.utils.styles :refer [defstyle]])) + [status-im.utils.platform :as platform] + [status-im.utils.styles :as styles])) (def wrapper {:flex 1 @@ -10,7 +10,7 @@ (def log-level-item-inner {:padding-horizontal 16}) -(defstyle log-level-item +(styles/def log-level-item {:flex-direction :row :background-color :white :align-items :center diff --git a/src/status_im/ui/screens/multiaccounts/login/styles.cljs b/src/status_im/ui/screens/multiaccounts/login/styles.cljs index c2e7da8dd7..cd13468f4c 100644 --- a/src/status_im/ui/screens/multiaccounts/login/styles.cljs +++ b/src/status_im/ui/screens/multiaccounts/login/styles.cljs @@ -1,13 +1,11 @@ (ns status-im.ui.screens.multiaccounts.login.styles - (:require-macros [status-im.utils.styles :refer [defnstyle defstyle]]) - (:require [status-im.ui.components.styles :as st] - [status-im.ui.components.colors :as colors])) + (:require [status-im.ui.components.colors :as colors])) -(defstyle login-view +(def login-view {:flex 1 :margin-horizontal 16}) -(defstyle login-badge-container +(def login-badge-container {:margin-top 24}) (def processing-view diff --git a/src/status_im/ui/screens/multiaccounts/recover/styles.cljs b/src/status_im/ui/screens/multiaccounts/recover/styles.cljs index 8d7f99580a..245990ac05 100644 --- a/src/status_im/ui/screens/multiaccounts/recover/styles.cljs +++ b/src/status_im/ui/screens/multiaccounts/recover/styles.cljs @@ -1,11 +1,11 @@ (ns status-im.ui.screens.multiaccounts.recover.styles - (:require-macros [status-im.utils.styles :refer [defstyle]]) - (:require [status-im.ui.components.colors :as colors])) + (:require [status-im.ui.components.colors :as colors] + [status-im.utils.styles :as styles])) (def screen-container {:flex 1}) -(defstyle inputs-container +(styles/def inputs-container {:margin 16 :desktop {:padding-top 15}}) diff --git a/src/status_im/ui/screens/multiaccounts/styles.cljs b/src/status_im/ui/screens/multiaccounts/styles.cljs index 5b06186452..a7e3d0ae45 100644 --- a/src/status_im/ui/screens/multiaccounts/styles.cljs +++ b/src/status_im/ui/screens/multiaccounts/styles.cljs @@ -1,5 +1,4 @@ (ns status-im.ui.screens.multiaccounts.styles - (:require-macros [status-im.utils.styles :refer [defnstyle defstyle]]) (:require [status-im.ui.components.styles :as common] [status-im.ui.components.colors :as colors])) @@ -21,11 +20,11 @@ {:color :black :font-size 17}) -(defstyle multiaccounts-list-container +(def multiaccounts-list-container {:flex 1 :padding-bottom 8}) -(defstyle multiaccount-view +(def multiaccount-view {:background-color :white :flex-direction :row :align-items :center diff --git a/src/status_im/ui/screens/offline_messaging_settings/edit_mailserver/styles.cljs b/src/status_im/ui/screens/offline_messaging_settings/edit_mailserver/styles.cljs index 0438b7a0c5..a2992dbe4a 100644 --- a/src/status_im/ui/screens/offline_messaging_settings/edit_mailserver/styles.cljs +++ b/src/status_im/ui/screens/offline_messaging_settings/edit_mailserver/styles.cljs @@ -1,7 +1,7 @@ (ns status-im.ui.screens.offline-messaging-settings.edit-mailserver.styles - (:require-macros [status-im.utils.styles :refer [defstyle]]) - (:require [status-im.ui.components.styles :as styles] - [status-im.ui.components.colors :as colors])) + (:require [status-im.ui.components.styles :as components.styles] + [status-im.ui.components.colors :as colors] + [status-im.utils.styles :as styles])) (def edit-mailserver-view {:flex 1 @@ -12,11 +12,11 @@ {:flex-direction :row :align-items :center :justify-content :space-between - :border-radius styles/border-radius + :border-radius components.styles/border-radius :height 52 :margin-top 15}) -(defstyle input +(styles/def input {:flex 1 :android {:padding 0}}) @@ -40,11 +40,11 @@ :border-radius 8 :ios {:opacity 0.9}}) -(defstyle connect-button +(styles/def connect-button (assoc button :background-color colors/blue)) -(defstyle delete-button +(styles/def delete-button (assoc button :background-color colors/red)) diff --git a/src/status_im/ui/screens/offline_messaging_settings/styles.cljs b/src/status_im/ui/screens/offline_messaging_settings/styles.cljs index 40110c8189..8d65634c52 100644 --- a/src/status_im/ui/screens/offline_messaging_settings/styles.cljs +++ b/src/status_im/ui/screens/offline_messaging_settings/styles.cljs @@ -1,8 +1,7 @@ (ns status-im.ui.screens.offline-messaging-settings.styles (:require [status-im.ui.components.colors :as colors] - [status-im.utils.platform :as platform]) - (:require-macros [status-im.utils.styles :refer [defnstyle - defstyle]])) + [status-im.utils.platform :as platform] + [status-im.utils.styles :as styles])) (def wrapper {:flex 1 @@ -11,7 +10,7 @@ (def mailserver-item-inner {:padding-horizontal 16}) -(defnstyle mailserver-item [pinned?] +(styles/defn mailserver-item [pinned?] {:flex-direction :row :background-color :white :align-items :center @@ -36,7 +35,8 @@ :justify-content :center}) (defn mailserver-icon [connected?] - (hash-map (if platform/desktop? :tint-color :color) (if connected? :white :gray))) + (hash-map (if platform/desktop? :tint-color :color) + (if connected? :white :gray))) (def mailserver-pinned {:padding-horizontal 16 diff --git a/src/status_im/ui/screens/pairing/styles.cljs b/src/status_im/ui/screens/pairing/styles.cljs index 09eae253e9..7d9051364a 100644 --- a/src/status_im/ui/screens/pairing/styles.cljs +++ b/src/status_im/ui/screens/pairing/styles.cljs @@ -1,8 +1,7 @@ (ns status-im.ui.screens.pairing.styles - (:require - [status-im.ui.components.styles :as styles] - [status-im.ui.components.colors :as colors]) - (:require-macros [status-im.utils.styles :refer [defnstyle defstyle]])) + (:require [status-im.ui.components.colors :as colors] + [status-im.ui.components.styles :as components.styles] + [status-im.utils.styles :as styles])) (def wrapper {:flex 1 @@ -12,7 +11,7 @@ {:flex 1 :flex-direction :row}) -(defstyle installation-item +(styles/def installation-item {:flex-direction :row :background-color :white :align-items :center @@ -73,7 +72,7 @@ {:color colors/blue :margin-bottom 6}) -(defnstyle pairing-button-icon [enabled?] +(styles/defn pairing-button-icon [enabled?] (let [color (if enabled? colors/blue colors/gray)] @@ -94,10 +93,10 @@ {:flex-direction :row :align-items :center :justify-content :space-between - :border-radius styles/border-radius + :border-radius components.styles/border-radius :height 52 :margin-top 15}) -(defstyle input +(styles/def input {:flex 1 :android {:padding 0}}) diff --git a/src/status_im/ui/screens/profile/components/styles.cljs b/src/status_im/ui/screens/profile/components/styles.cljs index d24b9957a1..3e13459a60 100644 --- a/src/status_im/ui/screens/profile/components/styles.cljs +++ b/src/status_im/ui/screens/profile/components/styles.cljs @@ -1,7 +1,6 @@ (ns status-im.ui.screens.profile.components.styles - (:require-macros [status-im.utils.styles :refer [defstyle]]) - (:require [status-im.ui.components.styles :as styles] - [status-im.ui.components.colors :as colors])) + (:require [status-im.ui.components.colors :as colors] + [status-im.utils.styles :as styles])) ;; profile header elements @@ -14,21 +13,21 @@ {:flex-direction :column :justify-content :center}) -(defstyle profile-name-text +(def profile-name-text {:typography :header :line-height 28 :text-align :left}) -(defstyle profile-name-text-with-subtitle +(def profile-name-text-with-subtitle {:margin-vertical 5 :typography :header :line-height 28 :text-align :left}) -(defstyle profile-three-words +(def profile-three-words {:color colors/gray}) -(defstyle profile-name-input-text +(styles/def profile-name-input-text {:text-align :center :flex 1 :desktop {:height 20 @@ -120,4 +119,4 @@ {:color colors/gray :padding 24 :line-height 22 - :font-size 15}) \ No newline at end of file + :font-size 15}) diff --git a/src/status_im/ui/screens/profile/contact/styles.cljs b/src/status_im/ui/screens/profile/contact/styles.cljs index 4f6f220325..b8823942eb 100644 --- a/src/status_im/ui/screens/profile/contact/styles.cljs +++ b/src/status_im/ui/screens/profile/contact/styles.cljs @@ -1,5 +1,4 @@ (ns status-im.ui.screens.profile.contact.styles - (:require-macros [status-im.utils.styles :refer [defstyle]]) (:require [status-im.ui.components.colors :as colors])) (def action-container diff --git a/src/status_im/ui/screens/qr_scanner/styles.cljs b/src/status_im/ui/screens/qr_scanner/styles.cljs index b394b72caa..fc7736790d 100644 --- a/src/status_im/ui/screens/qr_scanner/styles.cljs +++ b/src/status_im/ui/screens/qr_scanner/styles.cljs @@ -7,7 +7,7 @@ {:flex 1 :background-color :white}) -(styles/defstyle barcode-scanner +(styles/def barcode-scanner {:flex 1 :elevation -10 :android {:marginTop 10}}) diff --git a/src/status_im/ui/screens/wallet/components/styles.cljs b/src/status_im/ui/screens/wallet/components/styles.cljs index 24f7d77a7f..9329e7c868 100644 --- a/src/status_im/ui/screens/wallet/components/styles.cljs +++ b/src/status_im/ui/screens/wallet/components/styles.cljs @@ -1,7 +1,6 @@ (ns status-im.ui.screens.wallet.components.styles - (:require-macros [status-im.utils.styles :refer [defnstyle defstyle]]) (:require [status-im.ui.components.colors :as colors] - [status-im.ui.components.styles :as styles])) + [status-im.ui.components.styles :as components.styles])) (def cartouche-container {:flex 1 @@ -12,7 +11,7 @@ (merge {:flex-direction :row :margin-top 8 - :border-radius styles/border-radius + :border-radius components.styles/border-radius :padding-left 14 :padding-right 8} (if disabled? @@ -101,7 +100,7 @@ (def asset-text {:color colors/white}) -(defstyle container-disabled +(def container-disabled {:border-width 1 :border-color colors/white-transparent-10 :border-radius 8}) @@ -176,4 +175,4 @@ :border-radius (/ 40 2) :background-color colors/green :align-items :center - :justify-content :center}) \ No newline at end of file + :justify-content :center}) diff --git a/src/status_im/ui/screens/wallet/send/styles.cljs b/src/status_im/ui/screens/wallet/send/styles.cljs index 5b022a2fdd..e00763e1e7 100644 --- a/src/status_im/ui/screens/wallet/send/styles.cljs +++ b/src/status_im/ui/screens/wallet/send/styles.cljs @@ -1,5 +1,4 @@ (ns status-im.ui.screens.wallet.send.styles - (:require-macros [status-im.utils.styles :refer [defstyle]]) (:require [status-im.ui.components.colors :as colors] [status-im.ui.screens.wallet.components.styles :as wallet.components.styles])) @@ -54,4 +53,4 @@ :placeholder "0.000" :placeholder-text-color colors/white-transparent :selection-color colors/white - :style wallet.components.styles/text-input}) \ No newline at end of file + :style wallet.components.styles/text-input}) diff --git a/src/status_im/ui/screens/wallet/transactions/styles.cljs b/src/status_im/ui/screens/wallet/transactions/styles.cljs index 5c6c0934c7..8e39adfe12 100644 --- a/src/status_im/ui/screens/wallet/transactions/styles.cljs +++ b/src/status_im/ui/screens/wallet/transactions/styles.cljs @@ -1,9 +1,9 @@ (ns status-im.ui.screens.wallet.transactions.styles - (:require-macros [status-im.utils.styles :refer [defnstyle defstyle]]) (:require [status-im.ui.components.colors :as colors] - [status-im.ui.components.tabbar.styles :as tabs.styles])) + [status-im.ui.components.tabbar.styles :as tabs.styles] + [status-im.utils.styles :as styles])) -(defnstyle tab [active?] +(defn tab [active?] {:flex 1 :height tabs.styles/tab-height :justify-content :center @@ -38,7 +38,7 @@ :margin-top 22 :margin-horizontal 92}) -(defstyle amount-time +(styles/def amount-time {:flex-direction :row :justify-content :space-between :padding-right 22 diff --git a/src/status_im/utils/styles.clj b/src/status_im/utils/styles.clj index 282f588d93..d1463fc4df 100644 --- a/src/status_im/utils/styles.clj +++ b/src/status_im/utils/styles.clj @@ -1,6 +1,7 @@ -(ns status-im.utils.styles) +(ns status-im.utils.styles + (:refer-clojure :exclude [defn def])) -(defn body [style] +(defn- body [style] `(let [style# ~style common# (dissoc style# :android :ios :desktop) platform# (keyword status-im.utils.platform/os) @@ -9,7 +10,7 @@ (merge common# platform-specific#) common#))) -(defmacro defstyle +(defmacro def "Defines style symbol. Style parameter may contain platform specific style: {:width 100 @@ -29,7 +30,7 @@ `(def ~style-name ~(body style))) -(defmacro defnstyle +(defmacro defn "Defines style function. Style parameter may contain platform specific style: {:width 100 @@ -46,6 +47,6 @@ {:width 100 :height 5}" [style-name params style] - `(defn ~style-name + `(clojure.core/defn ~style-name [~@params] ~(body style)))