Skip to content

Commit

Permalink
add remove options to ff
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Son89 committed Feb 6, 2024
1 parent 466d1bd commit 506331e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
[react-native.gesture :as gesture]
[react-native.platform :as platform]
[reagent.core :as reagent]
[status-im.config :as config]
[status-im.contexts.wallet.common.sheets.account-options.style :as style]
[status-im.contexts.wallet.common.sheets.remove-account.view :as remove-account]
[status-im.contexts.wallet.common.utils :as utils]
[status-im.feature-flags :as ff]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))

Expand Down Expand Up @@ -100,13 +100,12 @@
:accessibility-label :remove-account
:label (i18n/label :t/remove-account)
:danger? true
:on-press (fn []
(if (:remove-account config/wallet-feature-flags)
(rf/dispatch [:show-bottom-sheet
{:content
(fn []
[remove-account/view])}])
(js/alert "Feature disabled in config file")))})]]]
:on-press #(ff/alert ::ff/wallet.remove-account
(fn []
(rf/dispatch [:show-bottom-sheet
{:content
(fn []
[remove-account/view])}])))})]]]
(when show-account-selector?
[:<>
[quo/divider-line {:container-style style/divider-label}]
Expand Down
15 changes: 7 additions & 8 deletions src/status_im/contexts/wallet/edit_account/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
(:require [quo.core :as quo]
[react-native.core :as rn]
[reagent.core :as reagent]
[status-im.config :as config]
[status-im.contexts.wallet.common.screen-base.create-or-edit-account.view
:as create-or-edit-account]
[status-im.contexts.wallet.common.sheets.network-preferences.view
:as network-preferences]
[status-im.contexts.wallet.common.sheets.remove-account.view :as remove-account]
[status-im.contexts.wallet.edit-account.style :as style]
[status-im.feature-flags :as ff]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))

Expand Down Expand Up @@ -66,13 +66,12 @@
{:page-nav-right-side [(when-not default-account?
{:icon-name :i/delete
:on-press
(fn []
(if (:remove-account config/wallet-feature-flags)
(rf/dispatch [:show-bottom-sheet
{:content
(fn []
[remove-account/view])}])
(js/alert "Feature disabled in config file")))})]
#(ff/alert ::ff/wallet.remove-account
(fn []
(rf/dispatch [:show-bottom-sheet
{:content
(fn []
[remove-account/view])}])))})]
:account-name account-name
:account-emoji emoji
:account-color color
Expand Down
3 changes: 2 additions & 1 deletion src/status_im/feature_flags.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
(defonce ^:private feature-flags-config
(reagent/atom
{::wallet.edit-default-keypair (enabled-in-env? :FLAG_EDIT_DEFAULT_KEYPAIR_ENABLED)
::wallet.bridge-token (enabled-in-env? :FLAG_BRIDGE_TOKEN_ENABLED)}))
::wallet.bridge-token (enabled-in-env? :FLAG_BRIDGE_TOKEN_ENABLED)
::wallet.remove-account (enabled-in-env? :FLAG_REMOVE_ACCOUNT_ENABLED)}))

(defn feature-flags [] @feature-flags-config)

Expand Down

0 comments on commit 506331e

Please sign in to comment.