Chore: setup feature-flag for not-implemented settings (#19591)

This commit is contained in:
flexsurfer 2024-04-11 16:43:09 +02:00 committed by GitHub
parent 5badb5bdb5
commit 3164cc6a6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 88 additions and 72 deletions

1
.env
View File

@ -35,3 +35,4 @@ LOCAL_PAIRING_ENABLED=1
TEST_STATEOFUS=1 TEST_STATEOFUS=1
FAST_CREATE_COMMUNITY_ENABLED=1 FAST_CREATE_COMMUNITY_ENABLED=1
TEST_NETWORKS_ENABLED=1 TEST_NETWORKS_ENABLED=1
SHOW_NOT_IMPLEMENTED_FEATURES=1

View File

@ -34,3 +34,4 @@ STICKERS_TEST_ENABLED=1
LOCAL_PAIRING_ENABLED=1 LOCAL_PAIRING_ENABLED=1
FAST_CREATE_COMMUNITY_ENABLED=1 FAST_CREATE_COMMUNITY_ENABLED=1
TEST_NETWORKS_ENABLED=1 TEST_NETWORKS_ENABLED=1
SHOW_NOT_IMPLEMENTED_FEATURES=1

View File

@ -36,3 +36,4 @@ STICKERS_TEST_ENABLED=1
LOCAL_PAIRING_ENABLED=1 LOCAL_PAIRING_ENABLED=1
FAST_CREATE_COMMUNITY_ENABLED=1 FAST_CREATE_COMMUNITY_ENABLED=1
TEST_NETWORKS_ENABLED=1 TEST_NETWORKS_ENABLED=1
SHOW_NOT_IMPLEMENTED_FEATURES=1

View File

@ -59,6 +59,7 @@
(def swap-enabled? (enabled? (get-config :SWAP_ENABLED "0"))) (def swap-enabled? (enabled? (get-config :SWAP_ENABLED "0")))
(def stickers-test-enabled? (enabled? (get-config :STICKERS_TEST_ENABLED "0"))) (def stickers-test-enabled? (enabled? (get-config :STICKERS_TEST_ENABLED "0")))
(def local-pairing-mode-enabled? (enabled? (get-config :LOCAL_PAIRING_ENABLED "1"))) (def local-pairing-mode-enabled? (enabled? (get-config :LOCAL_PAIRING_ENABLED "1")))
(def show-not-implemented-features? (enabled? (get-config :SHOW_NOT_IMPLEMENTED_FEATURES "0")))
;; CONFIG VALUES ;; CONFIG VALUES
(def log-level (string/upper-case (get-config :LOG_LEVEL ""))) (def log-level (string/upper-case (get-config :LOG_LEVEL "")))

View File

@ -2,6 +2,7 @@
(:require [legacy.status-im.utils.core :as utils] (:require [legacy.status-im.utils.core :as utils]
[quo.foundations.colors :as colors] [quo.foundations.colors :as colors]
[status-im.common.not-implemented :as not-implemented] [status-im.common.not-implemented :as not-implemented]
[status-im.config :as config]
[status-im.contexts.profile.edit.style :as style] [status-im.contexts.profile.edit.style :as style]
[status-im.contexts.profile.utils :as profile.utils] [status-im.contexts.profile.utils :as profile.utils]
[utils.i18n :as i18n] [utils.i18n :as i18n]
@ -36,31 +37,33 @@
:action :arrow :action :arrow
:container-style style/item-container}]} :container-style style/item-container}]}
{:label (i18n/label :t/showcase) (when config/show-not-implemented-features?
:items [{:title (i18n/label :t/communities) {:label (i18n/label :t/showcase)
:on-press not-implemented/alert :items [{:title (i18n/label :t/communities)
:blur? true :on-press not-implemented/alert
:action :arrow :blur? true
:container-style style/item-container} :action :arrow
{:title (i18n/label :t/accounts) :container-style style/item-container}
:on-press not-implemented/alert {:title (i18n/label :t/accounts)
:blur? true :on-press not-implemented/alert
:action :arrow :blur? true
:container-style style/item-container} :action :arrow
{:title (i18n/label :t/collectibles) :container-style style/item-container}
:on-press not-implemented/alert {:title (i18n/label :t/collectibles)
:blur? true :on-press not-implemented/alert
:action :arrow :blur? true
:container-style style/item-container} :action :arrow
{:title (i18n/label :t/assets) :container-style style/item-container}
:on-press not-implemented/alert {:title (i18n/label :t/assets)
:blur? true :on-press not-implemented/alert
:action :arrow :blur? true
:container-style style/item-container}]} :action :arrow
:container-style style/item-container}]})
{:label (i18n/label :t/on-the-web) (when config/show-not-implemented-features?
:items [{:title (i18n/label :t/links) {:label (i18n/label :t/on-the-web)
:on-press not-implemented/alert :items [{:title (i18n/label :t/links)
:blur? true :on-press not-implemented/alert
:action :arrow :blur? true
:container-style style/item-container}]}])) :action :arrow
:container-style style/item-container}]})]))

View File

@ -4,6 +4,7 @@
[react-native.core :as rn] [react-native.core :as rn]
[react-native.safe-area :as safe-area] [react-native.safe-area :as safe-area]
[status-im.common.not-implemented :as not-implemented] [status-im.common.not-implemented :as not-implemented]
[status-im.config :as config]
[status-im.contexts.profile.edit.header.view :as header] [status-im.contexts.profile.edit.header.view :as header]
[status-im.contexts.profile.edit.list-items :as edit.items] [status-im.contexts.profile.edit.list-items :as edit.items]
[status-im.contexts.profile.edit.style :as style] [status-im.contexts.profile.edit.style :as style]
@ -33,7 +34,8 @@
:background :blur :background :blur
:icon-name :i/arrow-left :icon-name :i/arrow-left
:on-press #(rf/dispatch [:navigate-back]) :on-press #(rf/dispatch [:navigate-back])
:right-side [{:icon-name :i/reveal :on-press not-implemented/alert}]}] :right-side (when config/show-not-implemented-features?
[{:icon-name :i/reveal :on-press not-implemented/alert}])}]
[rn/flat-list [rn/flat-list
{:key :list {:key :list
:header [header/view] :header [header/view]

View File

@ -17,36 +17,41 @@
:image :icon :image :icon
:blur? true :blur? true
:action :arrow}] :action :arrow}]
[{:title (i18n/label :t/messages) [(when config/show-not-implemented-features?
:on-press not-implemented/alert {:title (i18n/label :t/messages)
:image-props :i/messages :on-press not-implemented/alert
:image :icon :image-props :i/messages
:blur? true :image :icon
:action :arrow} :blur? true
{:title (i18n/label :t/wallet) :action :arrow})
:on-press not-implemented/alert (when config/show-not-implemented-features?
:image-props :i/wallet {:title (i18n/label :t/wallet)
:image :icon :on-press not-implemented/alert
:blur? true :image-props :i/wallet
:action :arrow} :image :icon
{:title (i18n/label :t/dapps) :blur? true
:on-press not-implemented/alert :action :arrow})
:image-props :i/placeholder (when config/show-not-implemented-features?
:image :icon {:title (i18n/label :t/dapps)
:blur? true :on-press not-implemented/alert
:action :arrow} :image-props :i/placeholder
{:title (i18n/label :t/browser) :image :icon
:on-press not-implemented/alert :blur? true
:image-props :i/browser :action :arrow})
:image :icon (when config/show-not-implemented-features?
:blur? true {:title (i18n/label :t/browser)
:action :arrow} :on-press not-implemented/alert
{:title (i18n/label :t/keycard) :image-props :i/browser
:on-press not-implemented/alert :image :icon
:image-props :i/keycard :blur? true
:image :icon :action :arrow})
:blur? true (when config/show-not-implemented-features?
:action :arrow}] {:title (i18n/label :t/keycard)
:on-press not-implemented/alert
:image-props :i/keycard
:image :icon
:blur? true
:action :arrow})]
[{:title (i18n/label :t/syncing) [{:title (i18n/label :t/syncing)
:on-press #(rf/dispatch [:open-modal :settings-syncing]) :on-press #(rf/dispatch [:open-modal :settings-syncing])
:image-props :i/syncing :image-props :i/syncing
@ -65,18 +70,20 @@
:image :icon :image :icon
:blur? true :blur? true
:action :arrow} :action :arrow}
{:title (i18n/label :t/language-and-currency) (when config/show-not-implemented-features?
:on-press not-implemented/alert {:title (i18n/label :t/language-and-currency)
:image-props :i/globe :on-press not-implemented/alert
:image :icon :image-props :i/globe
:blur? true :image :icon
:action :arrow}] :blur? true
[{:title (i18n/label :t/data-usage) :action :arrow})]
:on-press not-implemented/alert [(when config/show-not-implemented-features?
:image-props :i/mobile {:title (i18n/label :t/data-usage)
:image :icon :on-press not-implemented/alert
:blur? true :image-props :i/mobile
:action :arrow} :image :icon
:blur? true
:action :arrow})
{:title (i18n/label :t/advanced) {:title (i18n/label :t/advanced)
:on-press #(rf/dispatch [:open-modal :advanced-settings]) :on-press #(rf/dispatch [:open-modal :advanced-settings])
:image-props :i/settings :image-props :i/settings
@ -105,8 +112,8 @@
:blur? true :blur? true
:image-props :i/light})] :image-props :i/light})]
[{:title (i18n/label :t/about) [{:title (i18n/label :t/about)
:on-press not-implemented/alert :on-press #(rf/dispatch [:open-modal :about-app])
:action :arrow} :action :arrow}
{:title (i18n/label :t/status-help) {:title (i18n/label :t/status-help)
:on-press not-implemented/alert :on-press #(rf/dispatch [:open-modal :help-center])
:action :arrow}]]) :action :arrow}]])