Remove :wallet-modal screen as it is not used anymore

This commit is contained in:
Roman Volosovskyi 2019-03-01 14:26:42 +02:00
parent ac10166f98
commit b7b221daff
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
5 changed files with 29 additions and 56 deletions

View File

@ -64,7 +64,6 @@
:wallet-send-transaction {:type :wallet-tab}
:sign-message-modal {:type :modal-wallet}
:wallet-transaction-fee {:type :modal-wallet}
:wallet-modal {:type :modal-wallet}
:wallet-onboarding-setup-modal {:type :modal-wallet}
:wallet-send-transaction-modal {:type :modal-wallet}
:wallet-settings-assets {:type :modal-wallet}

View File

@ -25,7 +25,6 @@
config/hardwallet-enabled?
(concat [:hardwallet-connect :enter-pin]))
:config {:initialRouteName :home}}
:wallet-modal
:chat-modal
:show-extension-modal
:stickers-pack-modal

View File

@ -90,7 +90,6 @@
:stickers stickers/packs
:stickers-pack stickers/pack
:stickers-pack-modal [:modal stickers/pack-modal]
:wallet-modal [:modal wallet.main/wallet-modal]
:chat-modal [:modal chat/chat-modal]
:show-extension-modal [:modal extensions.add/show-extension-modal]
:wallet-send-transaction-modal [:modal send/send-transaction-modal]

View File

@ -102,9 +102,9 @@
:style {:width 12}
:icon-opts {:color :gray}}])
(defn- render-collectible [address-hex {:keys [symbol name icon amount] :as collectible} modal?]
(defn- render-collectible [address-hex {:keys [symbol name icon amount] :as collectible}]
(let [items-number (money/to-fixed amount)
details? (and (pos? items-number) (not modal?))]
details? (pos? items-number)]
[react/touchable-highlight
(when details?
{:on-press #(re-frame/dispatch [:show-collectibles-list address-hex collectible])})
@ -127,7 +127,7 @@
(defn group-assets [v]
(group-by #(if (:nft? %) :nfts :tokens) v))
(defn- asset-section [assets currency address-hex modal?]
(defn- asset-section [assets currency address-hex]
(let [{:keys [tokens nfts]} (group-assets assets)]
[react/view styles/asset-section
[list/section-list
@ -144,7 +144,7 @@
{:title (i18n/label :t/wallet-collectibles)
:key :collectibles
:data nfts
:render-fn #(render-collectible address-hex % modal?)}]}]]))
:render-fn #(render-collectible address-hex %)}]}]]))
(defn snackbar [error-message]
[react/view styles/snackbar-container
@ -155,53 +155,37 @@
(views/letsubs [assets [:wallet/visible-assets-with-amount]
currency [:wallet/currency]
portfolio-value [:portfolio-value]
{:keys [modal-history?]} [:get :wallet]
{:keys [seed-backed-up?]} [:account/account]
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])
(if (and modal? modal-history?)
[react/view styles/modal-history
[transactions.views/history-list true]]
[react/scroll-view {:refresh-control
(reagent/as-element
[react/refresh-control {:on-refresh #(re-frame/dispatch [:wallet.ui/pull-to-refresh])
:tint-color :white
:refreshing false}])}
(if error-message
[snackbar error-message]
[total-section portfolio-value currency])
(when (and (not modal?)
(not seed-backed-up?)
(some (fn [{:keys [amount]}]
(and amount (not (.isZero amount))))
assets))
[backup-seed-phrase])
(if modal?
[react/view styles/address-section
[react/text {:style styles/wallet-address
:accessibility-label :address-text
:selectable true}
address-hex]]
[react/view (merge {:background-color colors/blue} styles/action-section)
[list/flat-list
{:data actions
:key-fn (fn [_ i] (str i))
:render-fn #(list/render-action % {:action-label-style {:font-size 17}})}]])
[asset-section assets currency address-hex modal?]
;; Hack to allow different colors for bottom scroll view (iOS only)
[react/view {:style styles/scroll-bottom}]])]))
(views/defview wallet-modal []
[wallet-root true])
[status-bar.view/status-bar {:type :wallet-tab}]
[settings/toolbar-view]
[react/scroll-view {:refresh-control
(reagent/as-element
[react/refresh-control {:on-refresh #(re-frame/dispatch [:wallet.ui/pull-to-refresh])
:tint-color :white
:refreshing false}])}
(if error-message
[snackbar error-message]
[total-section portfolio-value currency])
(when (and (not modal?)
(not seed-backed-up?)
(some (fn [{:keys [amount]}]
(and amount (not (.isZero amount))))
assets))
[backup-seed-phrase])
[react/view (merge {:background-color colors/blue} styles/action-section)
[list/flat-list
{:data actions
:key-fn (fn [_ i] (str i))
:render-fn #(list/render-action % {:action-label-style {:font-size 17}})}]]
[asset-section assets currency address-hex]
;; Hack to allow different colors for bottom scroll view (iOS only)
[react/view {:style styles/scroll-bottom}]]]))
(views/defview wallet []
(views/letsubs [{:keys [wallet-set-up-passed?]} [:account/account]]
(if (not wallet-set-up-passed?)
[onboarding.views/onboarding]
[wallet-root false])))
[wallet-root])))

View File

@ -18,14 +18,6 @@
(re-frame/dispatch [:update-wallet])
(assoc-in db [:wallet :current-tab] 0))
(defmethod navigation/preload-data! :wallet-modal
[db _]
;;TODO(goranjovic) - get rid of this preload hook completely
(re-frame/dispatch [:wallet.ui/pull-to-refresh])
(re-frame/dispatch [:update-wallet])
(re-frame/dispatch [:update-transactions])
(assoc-in db [:wallet :modal-history?] false))
(defmethod navigation/preload-data! :transactions-history
[db _]
(re-frame/dispatch [:update-transactions])