remove main-tabs ns

This commit is contained in:
Roman Volosovskyi 2019-02-24 18:14:45 +02:00
parent 8b01ae232c
commit 7a6a508696
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
5 changed files with 51 additions and 77 deletions

View File

@ -15,7 +15,8 @@
[status-im.ui.components.icons.vector-icons :as icons] [status-im.ui.components.icons.vector-icons :as icons]
[status-im.utils.datetime :as time] [status-im.utils.datetime :as time]
[status-im.ui.components.react :as components] [status-im.ui.components.react :as components]
[status-im.utils.utils :as utils])) [status-im.utils.utils :as utils]
[status-im.ui.components.status-bar.view :as status-bar]))
(defn- toolbar [show-welcome? show-sync-state sync-state latest-block-number logged-in?] (defn- toolbar [show-welcome? show-sync-state sync-state latest-block-number logged-in?]
(when-not (and show-welcome? (when-not (and show-welcome?
@ -113,6 +114,8 @@
#(re-frame/dispatch [:init-rest-of-chats]) #(re-frame/dispatch [:init-rest-of-chats])
100))))} 100))))}
[react/view styles/container [react/view styles/container
[status-bar/status-bar {:type :main}]
[react/view (assoc styles/container :background-color :white)
[toolbar show-welcome? (and network-initialized? (not rpc-network?)) sync-state latest-block-number (not logging-in?)] [toolbar show-welcome? (and network-initialized? (not rpc-network?)) sync-state latest-block-number (not logging-in?)]
(cond show-welcome? (cond show-welcome?
[welcome view-id] [welcome view-id]
@ -128,7 +131,7 @@
[connectivity/connectivity-view] [connectivity/connectivity-view]
[chats-list]]) [chats-list]])
(when platform/android? (when platform/android?
[home-action-button (not logging-in?)])])) [home-action-button (not logging-in?)])]]))
(views/defview home-wrapper [] (views/defview home-wrapper []
(views/letsubs [loading? [:get :chats/loading?]] (views/letsubs [loading? [:get :chats/loading?]]

View File

@ -1,33 +0,0 @@
(ns status-im.ui.screens.main-tabs.views
(:require-macros [status-im.utils.views :as views])
(:require [status-im.ui.components.react :as react]
[status-im.ui.components.status-bar.view :as status-bar.view]
[status-im.ui.components.styles :as common.styles]
[status-im.ui.screens.home.views :as home]
[status-im.ui.screens.wallet.main.views :as wallet.main]
[status-im.ui.screens.profile.user.views :as profile.user]))
(views/defview main-container [view-id]
;; :should-component-update is called only when props are changed,
;; that's why view-id is passed as a prop here. main-tabs component will be
;; rendered while next screen from stack navigator is shown, so we have
;; to prevent re-rendering to avoid no clause exception in case form
{:should-component-update
(fn [_ _ [_ new-view-id]]
(contains? #{:home :wallet :my-profile} new-view-id))}
[react/view common.styles/main-container
(case view-id
:home [home/home-wrapper]
:wallet [wallet.main/wallet]
:my-profile [profile.user/my-profile]
nil)])
(defn main-tabs [view-id]
[react/view common.styles/flex
[status-bar.view/status-bar
{:type (if (= view-id :wallet) :wallet-tab :main)}]
[main-container view-id]])
(defn get-main-tab [view-id]
(fn []
[main-tabs view-id]))

View File

@ -277,6 +277,8 @@
(js/setTimeout (js/setTimeout
#(.scrollToEnd @scroll {:animated false}) #(.scrollToEnd @scroll {:animated false})
300))] 300))]
[react/view {:flex 1}
[status-bar/status-bar {:type :main}]
[react/view profile.components.styles/profile [react/view profile.components.styles/profile
(if editing? (if editing?
[my-profile-edit-toolbar on-show-edit] [my-profile-edit-toolbar on-show-edit]
@ -298,4 +300,4 @@
[react/view styles/my-profile-info-container [react/view styles/my-profile-info-container
[my-profile-settings current-account shown-account currency (nil? login-data)]] [my-profile-settings current-account shown-account currency (nil? login-data)]]
(when (nil? login-data) (when (nil? login-data)
[advanced shown-account on-show-advanced])]]))) [advanced shown-account on-show-advanced])]]])))

View File

@ -1,6 +1,5 @@
(ns status-im.ui.screens.routing.screens (ns status-im.ui.screens.routing.screens
(:require (:require
[status-im.ui.screens.main-tabs.views :as main-tabs]
[status-im.ui.screens.accounts.login.views :as login] [status-im.ui.screens.accounts.login.views :as login]
[status-im.ui.screens.accounts.recover.views :as recover] [status-im.ui.screens.accounts.recover.views :as recover]
[status-im.ui.screens.accounts.views :as accounts] [status-im.ui.screens.accounts.views :as accounts]
@ -55,7 +54,8 @@
[status-im.ui.screens.about-app.views :as about-app] [status-im.ui.screens.about-app.views :as about-app]
[status-im.ui.screens.stickers.views :as stickers] [status-im.ui.screens.stickers.views :as stickers]
[status-im.ui.screens.dapps-permissions.views :as dapps-permissions] [status-im.ui.screens.dapps-permissions.views :as dapps-permissions]
[status-im.ui.screens.mobile-network-settings.view :as mobile-network-settings])) [status-im.ui.screens.mobile-network-settings.view :as mobile-network-settings]
[status-im.ui.screens.home.views :as home]))
(def all-screens (def all-screens
{:login login/login {:login login/login
@ -69,7 +69,7 @@
:enter-pin hardwallet.pin/enter-pin :enter-pin hardwallet.pin/enter-pin
:hardwallet-setup hardwallet.setup/hardwallet-setup :hardwallet-setup hardwallet.setup/hardwallet-setup
:hardwallet-success hardwallet.success/hardwallet-success :hardwallet-success hardwallet.success/hardwallet-success
:home (main-tabs/get-main-tab :home) :home home/home-wrapper
:chat chat/chat :chat chat/chat
:profile profile.contact/profile :profile profile.contact/profile
:new add-new/add-new :new add-new/add-new
@ -96,7 +96,7 @@
:wallet-transaction-fee [:modal wallet.transaction-fee/transaction-fee] :wallet-transaction-fee [:modal wallet.transaction-fee/transaction-fee]
:wallet-onboarding-setup-modal [:modal wallet.onboarding/modal] :wallet-onboarding-setup-modal [:modal wallet.onboarding/modal]
:wallet-sign-message-modal [:modal send/sign-message-modal] :wallet-sign-message-modal [:modal send/sign-message-modal]
:wallet (main-tabs/get-main-tab :wallet) :wallet wallet.main/wallet
:collectibles-list collectibles/collectibles-list :collectibles-list collectibles/collectibles-list
:wallet-onboarding-setup wallet.onboarding/screen :wallet-onboarding-setup wallet.onboarding/screen
:wallet-send-transaction-chat send/send-transaction :wallet-send-transaction-chat send/send-transaction
@ -116,7 +116,7 @@
:selection-modal-screen [:modal screens.extensions/selection-modal-screen] :selection-modal-screen [:modal screens.extensions/selection-modal-screen]
:wallet-settings-assets [:modal wallet-settings/manage-assets] :wallet-settings-assets [:modal wallet-settings/manage-assets]
:wallet-transactions-filter [:modal wallet-transactions/filter-history] :wallet-transactions-filter [:modal wallet-transactions/filter-history]
:my-profile (main-tabs/get-main-tab :my-profile) :my-profile profile.user/my-profile
:contacts-list contacts-list/contacts-list :contacts-list contacts-list/contacts-list
:blocked-users-list contacts-list/blocked-users-list :blocked-users-list contacts-list/blocked-users-list
:profile-photo-capture photo-capture/profile-photo-capture :profile-photo-capture photo-capture/profile-photo-capture

View File

@ -160,6 +160,8 @@
error-message [:wallet/error-message] error-message [:wallet/error-message]
address-hex [:account/hex-address]] address-hex [:account/hex-address]]
[react/view styles/main-section [react/view styles/main-section
(when-not modal?
[status-bar.view/status-bar {:type :wallet-tab}])
(if modal? (if modal?
[toolbar-modal modal-history?] [toolbar-modal modal-history?]
[settings/toolbar-view]) [settings/toolbar-view])