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} :wallet-send-transaction {:type :wallet-tab}
:sign-message-modal {:type :modal-wallet} :sign-message-modal {:type :modal-wallet}
:wallet-transaction-fee {:type :modal-wallet} :wallet-transaction-fee {:type :modal-wallet}
:wallet-modal {:type :modal-wallet}
:wallet-onboarding-setup-modal {:type :modal-wallet} :wallet-onboarding-setup-modal {:type :modal-wallet}
:wallet-send-transaction-modal {:type :modal-wallet} :wallet-send-transaction-modal {:type :modal-wallet}
:wallet-settings-assets {:type :modal-wallet} :wallet-settings-assets {:type :modal-wallet}

View File

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

View File

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

View File

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

View File

@ -18,14 +18,6 @@
(re-frame/dispatch [:update-wallet]) (re-frame/dispatch [:update-wallet])
(assoc-in db [:wallet :current-tab] 0)) (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 (defmethod navigation/preload-data! :transactions-history
[db _] [db _]
(re-frame/dispatch [:update-transactions]) (re-frame/dispatch [:update-transactions])