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.utils.datetime :as time]
[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?]
(when-not (and show-welcome?
@ -113,22 +114,24 @@
#(re-frame/dispatch [:init-rest-of-chats])
100))))}
[react/view styles/container
[toolbar show-welcome? (and network-initialized? (not rpc-network?)) sync-state latest-block-number (not logging-in?)]
(cond show-welcome?
[welcome view-id]
loading?
[react/view {:style {:flex 1
:justify-content :center
:align-items :center}}
[connectivity/connectivity-view]
[components/activity-indicator {:flex 1
:animating true}]]
:else
[react/view {:style {:flex 1}}
[connectivity/connectivity-view]
[chats-list]])
(when platform/android?
[home-action-button (not logging-in?)])]))
[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?)]
(cond show-welcome?
[welcome view-id]
loading?
[react/view {:style {:flex 1
:justify-content :center
:align-items :center}}
[connectivity/connectivity-view]
[components/activity-indicator {:flex 1
:animating true}]]
:else
[react/view {:style {:flex 1}}
[connectivity/connectivity-view]
[chats-list]])
(when platform/android?
[home-action-button (not logging-in?)])]]))
(views/defview home-wrapper []
(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,25 +277,27 @@
(js/setTimeout
#(.scrollToEnd @scroll {:animated false})
300))]
[react/view profile.components.styles/profile
(if editing?
[my-profile-edit-toolbar on-show-edit]
[my-profile-toolbar])
[react/scroll-view {:ref #(reset! scroll %)
:keyboard-should-persist-taps :handled}
[react/view profile.components.styles/profile-form
[profile.components/profile-header
{:contact current-account
:edited-contact changed-account
:editing? editing?
:allow-icon-change? true
:options (if (not= (identicon/identicon public-key) photo-path)
(profile-icon-options-ext)
profile-icon-options)
:on-change-text-event :my-profile/update-name}]]
[share-profile-item (dissoc current-account :mnemonic)]
[contacts-list-item active-contacts-count]
[react/view styles/my-profile-info-container
[my-profile-settings current-account shown-account currency (nil? login-data)]]
(when (nil? login-data)
[advanced shown-account on-show-advanced])]])))
[react/view {:flex 1}
[status-bar/status-bar {:type :main}]
[react/view profile.components.styles/profile
(if editing?
[my-profile-edit-toolbar on-show-edit]
[my-profile-toolbar])
[react/scroll-view {:ref #(reset! scroll %)
:keyboard-should-persist-taps :handled}
[react/view profile.components.styles/profile-form
[profile.components/profile-header
{:contact current-account
:edited-contact changed-account
:editing? editing?
:allow-icon-change? true
:options (if (not= (identicon/identicon public-key) photo-path)
(profile-icon-options-ext)
profile-icon-options)
:on-change-text-event :my-profile/update-name}]]
[share-profile-item (dissoc current-account :mnemonic)]
[contacts-list-item active-contacts-count]
[react/view styles/my-profile-info-container
[my-profile-settings current-account shown-account currency (nil? login-data)]]
(when (nil? login-data)
[advanced shown-account on-show-advanced])]]])))

View File

@ -1,6 +1,5 @@
(ns status-im.ui.screens.routing.screens
(: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.recover.views :as recover]
[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.stickers.views :as stickers]
[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
{:login login/login
@ -69,7 +69,7 @@
:enter-pin hardwallet.pin/enter-pin
:hardwallet-setup hardwallet.setup/hardwallet-setup
:hardwallet-success hardwallet.success/hardwallet-success
:home (main-tabs/get-main-tab :home)
:home home/home-wrapper
:chat chat/chat
:profile profile.contact/profile
:new add-new/add-new
@ -96,7 +96,7 @@
:wallet-transaction-fee [:modal wallet.transaction-fee/transaction-fee]
:wallet-onboarding-setup-modal [:modal wallet.onboarding/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
:wallet-onboarding-setup wallet.onboarding/screen
:wallet-send-transaction-chat send/send-transaction
@ -116,7 +116,7 @@
:selection-modal-screen [:modal screens.extensions/selection-modal-screen]
:wallet-settings-assets [:modal wallet-settings/manage-assets]
: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
:blocked-users-list contacts-list/blocked-users-list
:profile-photo-capture photo-capture/profile-photo-capture

View File

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