From 506331eb021e6d0346897330e648c3810a339ba4 Mon Sep 17 00:00:00 2001 From: Jamie Caprani Date: Mon, 5 Feb 2024 15:33:42 +0000 Subject: [PATCH] add remove options to ff --- .../common/sheets/account_options/view.cljs | 15 +++++++-------- .../contexts/wallet/edit_account/view.cljs | 15 +++++++-------- src/status_im/feature_flags.cljs | 3 ++- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/status_im/contexts/wallet/common/sheets/account_options/view.cljs b/src/status_im/contexts/wallet/common/sheets/account_options/view.cljs index 9de634a3bcf8..d91b245c57ee 100644 --- a/src/status_im/contexts/wallet/common/sheets/account_options/view.cljs +++ b/src/status_im/contexts/wallet/common/sheets/account_options/view.cljs @@ -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])) @@ -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}] diff --git a/src/status_im/contexts/wallet/edit_account/view.cljs b/src/status_im/contexts/wallet/edit_account/view.cljs index 48bc343fa0a3..4de50783fe37 100644 --- a/src/status_im/contexts/wallet/edit_account/view.cljs +++ b/src/status_im/contexts/wallet/edit_account/view.cljs @@ -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])) @@ -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 diff --git a/src/status_im/feature_flags.cljs b/src/status_im/feature_flags.cljs index c8fbafc1612d..1b28d26ae53b 100644 --- a/src/status_im/feature_flags.cljs +++ b/src/status_im/feature_flags.cljs @@ -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)