Remove Identity Verification tab in Activity Center (#19667)

* tweak: hide the identity verification tab inside the activity center

* tweak: hide not-implemented features by default in dev

* fix: remove nil tabs from when rendering quo tabs
This commit is contained in:
Sean Hagstrom 2024-04-19 10:01:02 +02:00 committed by GitHub
parent 2e2104d4d1
commit ca53bf7388
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 13 deletions

2
.env
View File

@ -35,4 +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 SHOW_NOT_IMPLEMENTED_FEATURES=0

View File

@ -116,6 +116,8 @@
set-active-tab-id] (rn/use-state default-active) set-active-tab-id] (rn/use-state default-active)
[fading set-fading] (rn/use-state fade-end-percentage) [fading set-fading] (rn/use-state fade-end-percentage)
flat-list-ref (rn/use-ref-atom nil) flat-list-ref (rn/use-ref-atom nil)
tabs-data (rn/use-memo (fn [] (filterv some? data))
[data])
clean-props (dissoc props clean-props (dissoc props
:default-active :default-active
:fade-end-percentage :fade-end-percentage
@ -142,8 +144,8 @@
:index :index
(utils.collection/first-index (utils.collection/first-index
#(= active-tab-id (:id %)) #(= active-tab-id (:id %))
data)})))) tabs-data)}))))
[active-tab-id data]) [active-tab-id tabs-data])
on-tab-press (rn/use-callback (fn [id index] on-tab-press (rn/use-callback (fn [id index]
(set-active-tab-id id) (set-active-tab-id id)
(when (and scroll-on-press? @flat-list-ref) (when (and scroll-on-press? @flat-list-ref)
@ -175,7 +177,7 @@
:horizontal true :horizontal true
:scroll-event-throttle 64 :scroll-event-throttle 64
:shows-horizontal-scroll-indicator false :shows-horizontal-scroll-indicator false
:data data :data tabs-data
:key-fn (comp str :id) :key-fn (comp str :id)
:on-scroll-to-index-failed identity :on-scroll-to-index-failed identity
:on-scroll on-scroll :on-scroll on-scroll
@ -184,7 +186,7 @@
:render-data {:active-tab-id active-tab-id :render-data {:active-tab-id active-tab-id
:blur? blur? :blur? blur?
:customization-color customization-color :customization-color customization-color
:number-of-items (count data) :number-of-items (count tabs-data)
:size size :size size
:on-press on-tab-press :on-press on-tab-press
:style style}})]]] :style style}})]]]
@ -195,8 +197,8 @@
{:active-tab-id active-tab-id {:active-tab-id active-tab-id
:blur? blur? :blur? blur?
:customization-color customization-color :customization-color customization-color
:number-of-items (count data) :number-of-items (count tabs-data)
:size size :size size
:on-press on-tab-press :on-press on-tab-press
:style style}]) :style style}])
data)]))) tabs-data)])))

View File

@ -2,6 +2,7 @@
(:require (:require
[clojure.set :as set] [clojure.set :as set]
[quo.core :as quo] [quo.core :as quo]
[status-im.config :as config]
[status-im.contexts.shell.activity-center.notification-types :as types] [status-im.contexts.shell.activity-center.notification-types :as types]
[status-im.contexts.shell.activity-center.style :as style] [status-im.contexts.shell.activity-center.style :as style]
[utils.i18n :as i18n] [utils.i18n :as i18n]
@ -48,12 +49,13 @@
:accessibility-label :tab-contact-request :accessibility-label :tab-contact-request
:notification-dot? (when-not is-mark-all-as-read-undoable? :notification-dot? (when-not is-mark-all-as-read-undoable?
(contains? types-with-unread types/contact-request))} (contains? types-with-unread types/contact-request))}
(when config/show-not-implemented-features?
{:id types/contact-verification {:id types/contact-verification
:label (i18n/label :t/identity-verification) :label (i18n/label :t/identity-verification)
:accessibility-label :tab-contact-verification :accessibility-label :tab-contact-verification
:notification-dot? (when-not is-mark-all-as-read-undoable? :notification-dot? (when-not is-mark-all-as-read-undoable?
(contains? types-with-unread (contains? types-with-unread
types/contact-verification))} types/contact-verification))})
{:id types/tx {:id types/tx
:label (i18n/label :t/transactions) :label (i18n/label :t/transactions)
:accessibility-label :tab-tx :accessibility-label :tab-tx