From b18a04414675b7598a8746bb5a99488f19c39d88 Mon Sep 17 00:00:00 2001 From: Andrey Shovkoplyas Date: Mon, 2 Sep 2019 08:43:18 +0200 Subject: [PATCH] ui elements --- .../src/status_im/ui/components/react.cljs | 44 +------- fiddle/README.md | 2 + fiddle/prepare.clj | 4 +- fiddle/resources/public/index.html | 5 +- fiddle/src/fiddle/events.cljs | 12 +- fiddle/src/fiddle/subs.cljs | 2 - fiddle/src/fiddle/views/list_items.cljs | 45 +++----- fiddle/src/fiddle/views/main.cljs | 47 ++++++-- fiddle/src/fiddle/views/toolbar.cljs | 25 +++++ fiddle/src/fiddle/views/ui.cljs | 72 ++++++++++++ .../react_native/js_dependencies.cljs | 2 +- fiddle/src/status_im/ui/components/react.cljs | 1 + src/status_im/subs.cljs | 2 +- .../action_button/action_button.cljs | 34 ------ .../ui/components/action_button/styles.cljs | 44 -------- src/status_im/ui/components/badge.cljs | 13 +++ .../ui/components/bottom_buttons/styles.cljs | 23 ---- .../ui/components/bottom_buttons/view.cljs | 21 ---- src/status_im/ui/components/button.cljs | 68 ++++++++++++ .../ui/components/button/styles.cljs | 95 ---------------- src/status_im/ui/components/button/view.cljs | 45 -------- .../ui/components/chat_icon/screen.cljs | 2 + .../ui/components/checkbox/styles.cljs | 16 +-- .../ui/components/checkbox/view.cljs | 17 +-- .../ui/components/common/common.cljs | 66 +++-------- .../ui/components/common/styles.cljs | 69 +----------- src/status_im/ui/components/desktop/tabs.cljs | 2 +- .../ui/components/desktop/views.cljs | 12 +- src/status_im/ui/components/list/views.cljs | 33 +++--- .../ui/components/list_header/views.cljs | 7 -- .../ui/components/list_item/styles.cljs | 29 ++--- .../ui/components/list_item/views.cljs | 46 ++------ .../ui/components/lists/cell/styles.cljs | 50 --------- .../ui/components/lists/cell/view.cljs | 26 ----- .../ui/components/qr_code_viewer/views.cljs | 38 +------ src/status_im/ui/components/radio.cljs | 2 +- .../ui/components/status_bar/view.cljs | 59 ++-------- .../{bottom_bar => tabbar}/core.cljs | 6 +- .../{bottom_bar => tabbar}/styles.cljs | 2 +- src/status_im/ui/components/toolbar.cljs | 14 +++ src/status_im/ui/screens/add_new/views.cljs | 65 +++++------ .../ui/screens/browser/open_dapp/views.cljs | 2 +- src/status_im/ui/screens/chat/views.cljs | 11 +- .../screens/desktop/main/tabs/home/views.cljs | 23 ++-- src/status_im/ui/screens/group/views.cljs | 9 +- .../ui/screens/home/sheet/views.cljs | 84 +++++++------- src/status_im/ui/screens/home/views.cljs | 2 +- src/status_im/ui/screens/keycard/views.cljs | 18 ++- .../mobile_network_settings/sheets.cljs | 30 ++--- .../screens/multiaccounts/recover/views.cljs | 26 ++--- src/status_im/ui/screens/pairing/views.cljs | 8 +- .../ui/screens/profile/user/sheet/views.cljs | 71 ++++++------ .../ui/screens/profile/user/views.cljs | 13 +-- src/status_im/ui/screens/routing/core.cljs | 14 +-- src/status_im/ui/screens/signing/sheets.cljs | 17 +-- src/status_im/ui/screens/signing/views.cljs | 61 ++++------ .../ui/screens/wallet/account/views.cljs | 2 +- .../ui/screens/wallet/accounts/sheets.cljs | 104 ++++++++++-------- .../ui/screens/wallet/accounts/views.cljs | 2 +- .../wallet/choose_recipient/views.cljs | 36 +++--- .../collectibles/cryptokitties/views.cljs | 10 +- .../collectibles/cryptostrikers/views.cljs | 12 +- .../wallet/collectibles/etheremon/views.cljs | 12 +- .../wallet/collectibles/kudos/views.cljs | 10 +- .../wallet/collectibles/superrare/views.cljs | 12 +- .../ui/screens/wallet/components/styles.cljs | 55 +++++---- .../ui/screens/wallet/components/views.cljs | 72 ++++++------ .../screens/wallet/custom_tokens/views.cljs | 11 +- .../ui/screens/wallet/request/views.cljs | 28 ++--- .../ui/screens/wallet/send/views.cljs | 43 +++----- .../ui/screens/wallet/settings/views.cljs | 37 +++---- .../screens/wallet/transactions/styles.cljs | 2 +- src/status_im/utils/label.cljs | 23 ++++ 73 files changed, 779 insertions(+), 1248 deletions(-) create mode 100644 fiddle/src/fiddle/views/toolbar.cljs create mode 100644 fiddle/src/fiddle/views/ui.cljs delete mode 100644 src/status_im/ui/components/action_button/action_button.cljs delete mode 100644 src/status_im/ui/components/action_button/styles.cljs create mode 100644 src/status_im/ui/components/badge.cljs delete mode 100644 src/status_im/ui/components/bottom_buttons/styles.cljs delete mode 100644 src/status_im/ui/components/bottom_buttons/view.cljs create mode 100644 src/status_im/ui/components/button.cljs delete mode 100644 src/status_im/ui/components/button/styles.cljs delete mode 100644 src/status_im/ui/components/button/view.cljs delete mode 100644 src/status_im/ui/components/list_header/views.cljs delete mode 100644 src/status_im/ui/components/lists/cell/styles.cljs delete mode 100644 src/status_im/ui/components/lists/cell/view.cljs rename src/status_im/ui/components/{bottom_bar => tabbar}/core.cljs (98%) rename src/status_im/ui/components/{bottom_bar => tabbar}/styles.cljs (98%) create mode 100644 src/status_im/ui/components/toolbar.cljs create mode 100644 src/status_im/utils/label.cljs diff --git a/components/src/status_im/ui/components/react.cljs b/components/src/status_im/ui/components/react.cljs index 1693ed655b..9553758a04 100644 --- a/components/src/status_im/ui/components/react.cljs +++ b/components/src/status_im/ui/components/react.cljs @@ -152,10 +152,10 @@ (when (:ref options) ((:ref options) r))) :value text} - (-> options - (dissoc :ref) - (update :style typography/get-style) - (update :style dissoc :line-height)))])}))) + (-> options + (dissoc :ref) + (update :style typography/get-style) + (update :style dissoc :line-height)))])}))) (defn i18n-text [{:keys [style key]}] @@ -196,7 +196,7 @@ (when enabled {:enabled enabled}) (when on-change {:on-value-change on-change}) (when selected {:selected-value selected}))] - (map value->picker-item data))) + (map value->picker-item data))) ;; Image picker @@ -301,39 +301,7 @@ (defmethod create-main-screen-view :iphone-x [current-view] (fn [props & children] - (let [props (merge props - {:background-color - (case current-view - (:wallet-send-transaction - :wallet-request-transaction - :wallet-send-assets - :wallet-request-assets - :choose-recipient - :recent-recipients - :select-account - :wallet-send-transaction-request - :contact-code - :wallet-settings-hook) - colors/blue - - (:qr-viewer - :recipient-qr-code) - "#2f3031" - - colors/white)}) - bottom-background (when (#{:recent-recipients - :select-account - :wallet-send-assets - :wallet-request-assets} current-view) - [view {:background-color colors/white - :position :absolute - :bottom 0 - :right 0 - :left 0 - :height 100 - :z-index -1000}]) - children (conj children bottom-background)] - (apply vector safe-area-view props children)))) + (apply vector safe-area-view props children))) (defmethod create-main-screen-view :default [_] view) diff --git a/fiddle/README.md b/fiddle/README.md index 030ac43e71..c54f4742c6 100644 --- a/fiddle/README.md +++ b/fiddle/README.md @@ -2,4 +2,6 @@ `yarn install` +`clj prepare.clj` + `clj -A:dev` \ No newline at end of file diff --git a/fiddle/prepare.clj b/fiddle/prepare.clj index a5954f9329..bf9f8f1025 100644 --- a/fiddle/prepare.clj +++ b/fiddle/prepare.clj @@ -13,6 +13,6 @@ (fn [fl] (let [n (first (str/split (.getName fl) #".png"))] (when (.isFile fl) - (io/copy (io/file (.getPath fl)) (io/file (str "./resources/public/" n))) - n))) + (io/copy (io/file (.getPath fl)) (io/file (str "./resources/public/" (str/replace n #"_" "-")))) + (str/replace n #"_" "-")))) fls))))) diff --git a/fiddle/resources/public/index.html b/fiddle/resources/public/index.html index ab90d0ec42..599275c359 100644 --- a/fiddle/resources/public/index.html +++ b/fiddle/resources/public/index.html @@ -8,10 +8,7 @@