Skip to content

Commit

Permalink
chore: remove mock data from wallet and feature flag incomplete features
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Son89 authored and pavloburykh committed Jan 23, 2024
1 parent 5bb4f36 commit 1c6ec2f
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 159 deletions.
4 changes: 4 additions & 0 deletions src/status_im/config.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,7 @@

(def community-accounts-selection-enabled? false)
(def fetch-messages-enabled? (enabled? (get-config :FETCH_MESSAGES_ENABLED "1")))

(def wallet-feature-flags
{:edit-default-keypair false
:bridge-token false})
5 changes: 4 additions & 1 deletion src/status_im/contexts/wallet/account/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[quo.core :as quo]
[react-native.core :as rn]
[reagent.core :as reagent]
[status-im.config :as config]
[status-im.contexts.wallet.account.style :as style]
[status-im.contexts.wallet.account.tabs.view :as tabs]
[status-im.contexts.wallet.common.account-switcher.view :as account-switcher]
Expand Down Expand Up @@ -52,7 +53,9 @@
:receive-action #(rf/dispatch [:open-modal :wallet-share-address {:status :receive}])
:buy-action #(rf/dispatch [:show-bottom-sheet
{:content buy-drawer}])
:bridge-action #(rf/dispatch [:open-modal :wallet-bridge])}])
:bridge-action (if (:bridge-token config/wallet-feature-flags)
#(rf/dispatch [:open-modal :wallet-bridge])
#(js/alert "feature disabled in config file"))}])
[quo/tabs
{:style style/tabs
:size 32
Expand Down
19 changes: 10 additions & 9 deletions src/status_im/contexts/wallet/collectible/tabs/about/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[quo.theme]
[react-native.core :as rn]
[status-im.contexts.wallet.collectible.tabs.about.style :as style]
[status-im.contexts.wallet.temp :as temp]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))

Expand All @@ -14,7 +13,8 @@
(let [window-width (rf/sub [:dimensions/window-width])
item-width (- (/ window-width 2) link-card-space)
{:keys [collectible-data]} (rf/sub [:wallet/last-collectible-details])
link-card-container-style (style/link-card item-width)]
link-card-container-style (style/link-card item-width)
collectible-about {:cards []}]
[:<>
[rn/view {:style style/title}
[quo/text
Expand All @@ -25,12 +25,13 @@
[quo/text
{:size :paragraph-2}
(:description collectible-data)]]
[quo/section-label
{:container-style style/section-label
:section (i18n/label :t/on-the-web)}]
[rn/view {:style style/link-cards-container}
(for [item (:cards temp/collectible-about)]
^{:key (:title item)}
[quo/link-card (assoc item :container-style link-card-container-style)])]]))
(when (count collectible-about)
[quo/section-label
{:container-style style/section-label
:section (i18n/label :t/on-the-web)}]
[rn/view {:style style/link-cards-container}
(for [item (:cards collectible-about)]
^{:key (:title item)}
[quo/link-card (assoc item :container-style link-card-container-style)])])]))

(def view (quo.theme/with-theme view-internal))
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
(ns status-im.contexts.wallet.collectible.tabs.activity.view
(:require [quo.core :as quo]
[react-native.core :as rn]
[status-im.contexts.wallet.temp :as temp]))
[react-native.core :as rn]))

(defn activity-item
[item]
Expand All @@ -12,6 +11,6 @@
(defn view
[]
[rn/flat-list
{:data temp/collectible-activities
{:data nil
:style {:flex 1}
:render-fn activity-item}])
5 changes: 4 additions & 1 deletion src/status_im/contexts/wallet/create_account/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
[reagent.core :as reagent]
[status-im.common.emoji-picker.utils :as emoji-picker.utils]
[status-im.common.standard-authentication.core :as standard-auth]
[status-im.config :as config]
[status-im.constants :as constants]
[status-im.contexts.wallet.common.utils :as utils]
[status-im.contexts.wallet.create-account.style :as style]
Expand All @@ -31,7 +32,9 @@
:size :xxs
:customization-color account-color}
:action :button
:action-props {:on-press #(rf/dispatch [:navigate-to :wallet-select-keypair])
:action-props {:on-press (if (:edit-default-keypair config/wallet-feature-flags)
#(rf/dispatch [:navigate-to :wallet-select-keypair])
#(js/alert "feature disabled in config file"))
:button-text (i18n/label :t/edit)
:alignment :flex-start}
:description :text
Expand Down
26 changes: 5 additions & 21 deletions src/status_im/contexts/wallet/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
[status-im.contexts.wallet.data-store :as data-store]
[status-im.contexts.wallet.events.collectibles]
[status-im.contexts.wallet.item-types :as item-types]
[status-im.contexts.wallet.temp :as temp]
[taoensso.timbre :as log]
[utils.ethereum.chain :as chain]
[utils.ethereum.eip.eip55 :as eip55]
Expand Down Expand Up @@ -242,30 +241,15 @@


(rf/reg-event-fx :wallet/fetch-address-suggestions
(fn [{:keys [db]} [address]]
(fn [{:keys [db]} [_address]]
{:db (assoc db
:wallet/local-suggestions
(cond
(= address
(get-in
temp/address-local-suggestion-saved-contact-address-mock
[:accounts 0 :address]))
[temp/address-local-suggestion-saved-contact-address-mock]
(= address
(get temp/address-local-suggestion-saved-address-mock
:address))
[temp/address-local-suggestion-saved-address-mock]
:else (temp/find-matching-addresses address))
:wallet/valid-ens-or-address?
false)}))
:wallet/local-suggestions nil
:wallet/valid-ens-or-address? false)}))

(rf/reg-event-fx :wallet/ens-validation-success
(fn [{:keys [db]} [ens]]
(fn [{:keys [db]} [_ens]]
{:db (assoc db
:wallet/local-suggestions (if (= ens
(:ens temp/ens-local-suggestion-saved-address-mock))
[temp/ens-local-suggestion-saved-address-mock]
[temp/ens-local-suggestion-mock])
:wallet/local-suggestions nil
:wallet/valid-ens-or-address? true)}))

(rf/reg-event-fx :wallet/address-validation-success
Expand Down
124 changes: 0 additions & 124 deletions src/status_im/contexts/wallet/temp.cljs

This file was deleted.

0 comments on commit 1c6ec2f

Please sign in to comment.