From ca53bf73884d06350a35bceaf9871e2d4661c2ce Mon Sep 17 00:00:00 2001 From: Sean Hagstrom Date: Fri, 19 Apr 2024 10:01:02 +0200 Subject: [PATCH] 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 --- .env | 2 +- src/quo/components/tabs/tabs/view.cljs | 14 ++++++++------ .../contexts/shell/activity_center/tabs/view.cljs | 14 ++++++++------ 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.env b/.env index 40f08de8c8..47d294f460 100644 --- a/.env +++ b/.env @@ -35,4 +35,4 @@ LOCAL_PAIRING_ENABLED=1 TEST_STATEOFUS=1 FAST_CREATE_COMMUNITY_ENABLED=1 TEST_NETWORKS_ENABLED=1 -SHOW_NOT_IMPLEMENTED_FEATURES=1 +SHOW_NOT_IMPLEMENTED_FEATURES=0 diff --git a/src/quo/components/tabs/tabs/view.cljs b/src/quo/components/tabs/tabs/view.cljs index cd26e51aba..74b8cb0451 100644 --- a/src/quo/components/tabs/tabs/view.cljs +++ b/src/quo/components/tabs/tabs/view.cljs @@ -116,6 +116,8 @@ set-active-tab-id] (rn/use-state default-active) [fading set-fading] (rn/use-state fade-end-percentage) flat-list-ref (rn/use-ref-atom nil) + tabs-data (rn/use-memo (fn [] (filterv some? data)) + [data]) clean-props (dissoc props :default-active :fade-end-percentage @@ -142,8 +144,8 @@ :index (utils.collection/first-index #(= active-tab-id (:id %)) - data)})))) - [active-tab-id data]) + tabs-data)})))) + [active-tab-id tabs-data]) on-tab-press (rn/use-callback (fn [id index] (set-active-tab-id id) (when (and scroll-on-press? @flat-list-ref) @@ -175,7 +177,7 @@ :horizontal true :scroll-event-throttle 64 :shows-horizontal-scroll-indicator false - :data data + :data tabs-data :key-fn (comp str :id) :on-scroll-to-index-failed identity :on-scroll on-scroll @@ -184,7 +186,7 @@ :render-data {:active-tab-id active-tab-id :blur? blur? :customization-color customization-color - :number-of-items (count data) + :number-of-items (count tabs-data) :size size :on-press on-tab-press :style style}})]]] @@ -195,8 +197,8 @@ {:active-tab-id active-tab-id :blur? blur? :customization-color customization-color - :number-of-items (count data) + :number-of-items (count tabs-data) :size size :on-press on-tab-press :style style}]) - data)]))) + tabs-data)]))) diff --git a/src/status_im/contexts/shell/activity_center/tabs/view.cljs b/src/status_im/contexts/shell/activity_center/tabs/view.cljs index 934224476d..7cb42260cb 100644 --- a/src/status_im/contexts/shell/activity_center/tabs/view.cljs +++ b/src/status_im/contexts/shell/activity_center/tabs/view.cljs @@ -2,6 +2,7 @@ (:require [clojure.set :as set] [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.style :as style] [utils.i18n :as i18n] @@ -48,12 +49,13 @@ :accessibility-label :tab-contact-request :notification-dot? (when-not is-mark-all-as-read-undoable? (contains? types-with-unread types/contact-request))} - {:id types/contact-verification - :label (i18n/label :t/identity-verification) - :accessibility-label :tab-contact-verification - :notification-dot? (when-not is-mark-all-as-read-undoable? - (contains? types-with-unread - types/contact-verification))} + (when config/show-not-implemented-features? + {:id types/contact-verification + :label (i18n/label :t/identity-verification) + :accessibility-label :tab-contact-verification + :notification-dot? (when-not is-mark-all-as-read-undoable? + (contains? types-with-unread + types/contact-verification))}) {:id types/tx :label (i18n/label :t/transactions) :accessibility-label :tab-tx