diff --git a/src/status_im/chat/handlers.cljs b/src/status_im/chat/handlers.cljs index da619eb1e0..66af0acf7c 100644 --- a/src/status_im/chat/handlers.cljs +++ b/src/status_im/chat/handlers.cljs @@ -48,7 +48,7 @@ (register-handler :leave-group-chat ;; todo order of operations tbd - (after (fn [_ _] (dispatch [:navigation-replace :chat-list]))) + (after (fn [_ _] (dispatch [:navigation-replace :home]))) (u/side-effect! (fn [{:keys [web3 current-chat-id chats current-public-key]} _] (let [{:keys [public-key private-key public?]} (chats current-chat-id)] @@ -136,7 +136,7 @@ ::save-public-chat chat ::start-watching-group (merge {:group-id topic} (select-keys db [:web3 :current-public-key]))}) - {:dispatch-n [[:navigate-to-clean :chat-list] + {:dispatch-n [[:navigate-to-clean :home] [:navigate-to-chat topic]]})))) (reg-fx @@ -207,7 +207,7 @@ ::save-chat new-chat ::start-listen-group (merge {:new-chat new-chat} (select-keys db [:web3 :current-public-key])) - :dispatch-n [[:navigate-to-clean :chat-list] + :dispatch-n [[:navigate-to-clean :home] [:navigate-to-chat (:chat-id new-chat)]]}))) (register-handler-fx diff --git a/src/status_im/ui/components/chat_preview.cljs b/src/status_im/ui/components/chat_preview.cljs index 5bad159319..1f8a0187d7 100644 --- a/src/status_im/ui/components/chat_preview.cljs +++ b/src/status_im/ui/components/chat_preview.cljs @@ -1,10 +1,10 @@ (ns status-im.ui.components.chat-preview (:require [status-im.ui.components.react :as components] - [status-im.ui.screens.chats-list.styles :as st] + [status-im.ui.screens.home.styles :as home.styles] [status-im.utils.utils :as utils])) (def default-attributes - {:style st/last-message-text + {:style home.styles/last-message-text :number-of-lines 1}) (defn text [attributes s] diff --git a/src/status_im/ui/components/icons/vector_icons.cljs b/src/status_im/ui/components/icons/vector_icons.cljs index 1bfeeb63a1..ce4e11e11e 100644 --- a/src/status_im/ui/components/icons/vector_icons.cljs +++ b/src/status_im/ui/components/icons/vector_icons.cljs @@ -23,14 +23,7 @@ (def use-def (get-class "Use")) (def defs (get-class "Defs")) -(def icons {;;NOT USED IN MVP - ;;:icons/chats (slurp-svg "./resources/icons/bottom/chats_gray.svg") - ;;:icons/chats-active (slurp-svg "./resources/icons/bottom/chats_active.svg") - ;;:icons/contacts (slurp-svg "./resources/icons/bottom/contacts_gray.svg") - ;;:icons/contacts-active (slurp-svg "./resources/icons/bottom/contacts_active.svg") - ;;:icons/discover (slurp-svg "./resources/icons/bottom/discover_gray.svg") - ;;:icons/discover-active (slurp-svg "./resources/icons/bottom/discover_active.svg") - :icons/home (slurp-svg "./resources/icons/bottom/home_gray.svg") +(def icons {:icons/home (slurp-svg "./resources/icons/bottom/home_gray.svg") :icons/home-active (slurp-svg "./resources/icons/bottom/home_blue.svg") :icons/profile (slurp-svg "./resources/icons/bottom/profile_gray.svg") :icons/profile-active (slurp-svg "./resources/icons/bottom/profile_blue.svg") diff --git a/src/status_im/ui/screens/accounts/login/events.cljs b/src/status_im/ui/screens/accounts/login/events.cljs index c8057d93cf..3ccbb3077f 100644 --- a/src/status_im/ui/screens/accounts/login/events.cljs +++ b/src/status_im/ui/screens/accounts/login/events.cljs @@ -131,8 +131,8 @@ (when (or new-account? recover-in-progress?) [[:chat-received-message/add console-chat/phone-number-request-message] [:chat-received-message/add console-chat/shake-your-phone-message]])] - [:navigate-to-clean :chat-list] + [:navigate-to-clean :home] (if new-account? [:navigate-to-chat console-chat-id] - [:navigate-to :chat-list])]} + [:navigate-to :home])]} (log/debug "Error changing acount: " error))))) diff --git a/src/status_im/ui/screens/contacts/events.cljs b/src/status_im/ui/screens/contacts/events.cljs index dfec9386dc..d88b41fcc5 100644 --- a/src/status_im/ui/screens/contacts/events.cljs +++ b/src/status_im/ui/screens/contacts/events.cljs @@ -427,7 +427,7 @@ :open-chat-with-contact (fn [_ [_ {:keys [whisper-identity dapp?] :as contact}]] {:dispatch-n (concat - [[:navigate-to-clean :chat-list] + [[:navigate-to-clean :home] [:start-chat whisper-identity]] (when-not dapp? [[::send-contact-request contact]]))})) diff --git a/src/status_im/ui/screens/contacts/views.cljs b/src/status_im/ui/screens/contacts/views.cljs index 430c0c9c2f..e2d20b4440 100644 --- a/src/status_im/ui/screens/contacts/views.cljs +++ b/src/status_im/ui/screens/contacts/views.cljs @@ -14,7 +14,7 @@ [status-im.utils.utils :as u] [status-im.i18n :refer [label]] [status-im.ui.screens.contacts.styles :as st] - [status-im.ui.screens.chats-list.styles :as chats-list.styles] + [status-im.ui.screens.home.styles :as home.styles] [status-im.ui.components.styles :refer [color-blue]])) (def ^:const contacts-limit 5) @@ -112,7 +112,7 @@ :buttonColor :#9b59b6 :onPress #(dispatch [:navigate-to :new-contact])} [ion-icon {:name :md-create - :style chats-list.styles/create-icon}]]]) + :style home.styles/create-icon}]]]) (defview contact-groups-list [_] (letsubs [contacts [:get-added-contacts-with-limit contacts-limit] diff --git a/src/status_im/ui/screens/chats_list/styles.cljs b/src/status_im/ui/screens/home/styles.cljs similarity index 98% rename from src/status_im/ui/screens/chats_list/styles.cljs rename to src/status_im/ui/screens/home/styles.cljs index e790b772e0..60440b77aa 100644 --- a/src/status_im/ui/screens/chats_list/styles.cljs +++ b/src/status_im/ui/screens/home/styles.cljs @@ -1,4 +1,4 @@ -(ns status-im.ui.screens.chats-list.styles +(ns status-im.ui.screens.home.styles (:require-macros [status-im.utils.styles :refer [defstyle defnstyle]]) (:require [status-im.ui.components.styles :as component.styles])) diff --git a/src/status_im/ui/screens/chats_list/subs.cljs b/src/status_im/ui/screens/home/subs.cljs similarity index 85% rename from src/status_im/ui/screens/chats_list/subs.cljs rename to src/status_im/ui/screens/home/subs.cljs index 9a86feef36..8a696f182a 100644 --- a/src/status_im/ui/screens/chats_list/subs.cljs +++ b/src/status_im/ui/screens/home/subs.cljs @@ -1,4 +1,4 @@ -(ns status-im.ui.screens.chats-list.subs +(ns status-im.ui.screens.home.subs (:require [re-frame.core :refer [reg-sub subscribe]] [clojure.string :as str])) @@ -13,7 +13,7 @@ :<- [:get-in [:toolbar-search :text]] :<- [:get-in [:toolbar-search :show]] (fn [[chats search-text show-search]] - (let [unordered-chats (if (and (= show-search :chat-list) search-text) + (let [unordered-chats (if (and (= show-search :home) search-text) (filter #(search-filter search-text (second %)) chats) chats)] diff --git a/src/status_im/ui/screens/chats_list/views.cljs b/src/status_im/ui/screens/home/views.cljs similarity index 89% rename from src/status_im/ui/screens/chats_list/views.cljs rename to src/status_im/ui/screens/home/views.cljs index 0966df4368..3de2c08b4d 100644 --- a/src/status_im/ui/screens/chats_list/views.cljs +++ b/src/status_im/ui/screens/home/views.cljs @@ -1,4 +1,4 @@ -(ns status-im.ui.screens.chats-list.views +(ns status-im.ui.screens.home.views (:require-macros [status-im.utils.views :as views]) (:require [re-frame.core :as re-frame] [status-im.ui.components.common.common :as components.common] @@ -9,8 +9,8 @@ [status-im.ui.components.toolbar.view :as toolbar] [status-im.ui.components.toolbar.actions :as toolbar.actions] [status-im.ui.components.sync-state.offline :refer [offline-view]] - [status-im.ui.screens.chats-list.views.inner-item :as inner-item] - [status-im.ui.screens.chats-list.styles :as styles] + [status-im.ui.screens.home.views.inner-item :as inner-item] + [status-im.ui.screens.home.styles :as styles] [status-im.i18n :as i18n] [status-im.utils.platform :as platform])) @@ -22,7 +22,7 @@ (when platform/ios? [(toolbar.actions/add #(re-frame/dispatch [:navigate-to :new-chat]))])]]) -(defn chats-action-button [] +(defn home-action-button [] [native-action-button {:button-color components.styles/color-blue :offset-x 16 :offset-y 40 @@ -36,7 +36,7 @@ [react/view [inner-item/chat-list-item-inner-view (assoc chat :chat-id chat-id) edit?]]]) -(views/defview chats-list [] +(views/defview home [] (views/letsubs [chats [:filtered-chats] edit? [:get-in [:chat-list-ui-props :edit?]] show-search [:get-in [:toolbar-search :show]] @@ -53,5 +53,5 @@ [components.common/bottom-shadow]])}] (when platform/android? - [chats-action-button]) + [home-action-button]) [offline-view]])) \ No newline at end of file diff --git a/src/status_im/ui/screens/chats_list/views/inner_item.cljs b/src/status_im/ui/screens/home/views/inner_item.cljs similarity index 98% rename from src/status_im/ui/screens/chats_list/views/inner_item.cljs rename to src/status_im/ui/screens/home/views/inner_item.cljs index e436d753d1..e3adbf4f0a 100644 --- a/src/status_im/ui/screens/chats_list/views/inner_item.cljs +++ b/src/status_im/ui/screens/home/views/inner_item.cljs @@ -1,4 +1,4 @@ -(ns status-im.ui.screens.chats-list.views.inner-item +(ns status-im.ui.screens.home.views.inner-item (:require-macros [status-im.utils.views :refer [defview letsubs]]) (:require [re-frame.core :as re-frame] [reagent.core :as reagent] @@ -7,7 +7,7 @@ [status-im.ui.components.icons.vector-icons :as vi] [status-im.ui.components.chat-icon.screen :as chat-icon-screen] [status-im.ui.components.context-menu :as context-menu] - [status-im.ui.screens.chats-list.styles :as st] + [status-im.ui.screens.home.styles :as st] [status-im.utils.utils :as utils] [status-im.commands.utils :as commands-utils] [status-im.i18n :as i18n] diff --git a/src/status_im/ui/screens/main_tabs/views.cljs b/src/status_im/ui/screens/main_tabs/views.cljs index c92d81d760..79c1751552 100644 --- a/src/status_im/ui/screens/main_tabs/views.cljs +++ b/src/status_im/ui/screens/main_tabs/views.cljs @@ -5,31 +5,25 @@ [status-im.ui.components.status-bar.view :as status-bar.view] [status-im.ui.components.styles :as common.styles] [status-im.i18n :as i18n] - [status-im.ui.screens.chats-list.views :as chats-list.views] + [status-im.ui.screens.home.views :as home.views] [status-im.ui.screens.profile.views :as profile.views] [status-im.ui.screens.wallet.main.views :as wallet.views] [status-im.ui.screens.main-tabs.styles :as styles] [re-frame.core :as re-frame])) (def tabs-list-data - {:chat-list - {:view-id :chat-list + [{:view-id :home :content {:title (i18n/label :t/home) :icon-inactive :icons/home - :icon-active :icons/home-active} - :screen chats-list.views/chats-list} - :wallet + :icon-active :icons/home-active}} {:view-id :wallet :content {:title (i18n/label :t/wallet) :icon-inactive :icons/wallet - :icon-active :icons/wallet-active} - :screen wallet.views/wallet} - :my-profile + :icon-active :icons/wallet-active}} {:view-id :my-profile :content {:title (i18n/label :t/profile) :icon-inactive :icons/profile - :icon-active :icons/profile-active} - :screen profile.views/my-profile}}) + :icon-active :icons/profile-active}}]) (defn- tab-content [{:keys [title icon-active icon-inactive]}] (fn [active?] @@ -41,7 +35,7 @@ [react/text {:style (styles/tab-title active?)} title]]])) -(def tabs-list (map #(update % :content tab-content) (vals tabs-list-data))) +(def tabs-list (map #(update % :content tab-content) tabs-list-data)) (defn tab [view-id content active?] [react/touchable-highlight {:style common.styles/flex @@ -57,9 +51,11 @@ (views/defview main-tabs [] (views/letsubs [view-id [:get :view-id]] - (let [screen (get-in tabs-list-data [view-id :screen])] - [react/view common.styles/flex - [status-bar.view/status-bar {:type (if (= view-id :wallet) :wallet :main)}] - [react/view common.styles/main-container - [screen] - [tabs view-id]]]))) \ No newline at end of file + [react/view common.styles/flex + [status-bar.view/status-bar {:type (if (= view-id :wallet) :wallet :main)}] + [react/view common.styles/main-container + [(case view-id + :home home.views/home + :wallet wallet.views/wallet + :my-profile profile.views/my-profile)] + [tabs view-id]]])) \ No newline at end of file diff --git a/src/status_im/ui/screens/navigation.cljs b/src/status_im/ui/screens/navigation.cljs index b3a59c0611..c16d5fbb80 100644 --- a/src/status_im/ui/screens/navigation.cljs +++ b/src/status_im/ui/screens/navigation.cljs @@ -12,7 +12,7 @@ (defn- replace-top-element [stack view-id] (let [stack' (if (> 2 (count stack)) - (list :chat-list) + (list :home) (pop stack))] (conj stack' view-id))) diff --git a/src/status_im/ui/screens/subs.cljs b/src/status_im/ui/screens/subs.cljs index f0d89fae23..88f277e1d6 100644 --- a/src/status_im/ui/screens/subs.cljs +++ b/src/status_im/ui/screens/subs.cljs @@ -3,7 +3,7 @@ status-im.chat.subs status-im.commands.subs status-im.ui.screens.accounts.subs - status-im.ui.screens.chats-list.subs + status-im.ui.screens.home.subs status-im.ui.screens.group.chat-settings.subs status-im.ui.screens.discover.subs status-im.ui.screens.contacts.subs @@ -39,7 +39,7 @@ :<- [:get :view-id] (fn [[search-mode? chats-edit-mode? contacts-edit-mode? view-id]] (or search-mode? - (and (= view-id :chat-list) chats-edit-mode?) + (and (= view-id :home) chats-edit-mode?) (and (= view-id :contact-list) contacts-edit-mode?)))) (reg-sub :network diff --git a/src/status_im/ui/screens/views.cljs b/src/status_im/ui/screens/views.cljs index ba6450f496..b3059b1fc3 100644 --- a/src/status_im/ui/screens/views.cljs +++ b/src/status_im/ui/screens/views.cljs @@ -73,7 +73,7 @@ (when view-id (let [current-view (validate-current-view view-id signed-up?)] (let [component (case current-view - (:wallet :chat-list :my-profile) main-tabs + (:home :wallet :my-profile) main-tabs :wallet-list wallet-list-screen :wallet-send-transaction send-transaction :wallet-transaction-sent transaction-sent diff --git a/src/status_im/ui/screens/wallet/request/events.cljs b/src/status_im/ui/screens/wallet/request/events.cljs index d0ff17dc38..a9097bccbf 100644 --- a/src/status_im/ui/screens/wallet/request/events.cljs +++ b/src/status_im/ui/screens/wallet/request/events.cljs @@ -20,7 +20,7 @@ [re-frame/trim-v] (fn [{{:keys [wallet]} :db} [{:keys [whisper-identity]}]] {:dispatch-n [[:navigate-back] - [:navigate-to-clean :chat-list] + [:navigate-to-clean :home] [:add-chat-loaded-event whisper-identity [::wallet-send-chat-request (some-> wallet :request-transaction :amount money/wei->ether str)]] [:start-chat whisper-identity]]})) diff --git a/src/status_im/ui/screens/wallet/transactions/views.cljs b/src/status_im/ui/screens/wallet/transactions/views.cljs index 4ac38fc181..01c4a30df3 100644 --- a/src/status_im/ui/screens/wallet/transactions/views.cljs +++ b/src/status_im/ui/screens/wallet/transactions/views.cljs @@ -211,9 +211,9 @@ [status-bar/status-bar] [toolbar-view current-tab unsigned-transactions-count filter-data] [tabs current-tab] - (case current-tab - :transactions-history [history-list] - :unsigned-transactions [unsigned-list])])) + [(case current-tab + :transactions-history history-list + :unsigned-transactions unsigned-list)]])) (defn- pretty-print-asset [symbol amount] (case symbol