From 0c2bb97a6a441c6ea560e63761164eb364a145f7 Mon Sep 17 00:00:00 2001 From: Piotr Stankowski <6437642+trakos@users.noreply.github.com> Date: Tue, 4 Feb 2025 23:54:31 +0100 Subject: [PATCH] Jetpack Search: hide module toggle on wpcom (#41492) --- .../fix-disable-search-toggle-on-wpcom | 4 +++ .../components/module-control/index.jsx | 35 ++++++++++--------- 2 files changed, 23 insertions(+), 16 deletions(-) create mode 100644 projects/packages/search/changelog/fix-disable-search-toggle-on-wpcom diff --git a/projects/packages/search/changelog/fix-disable-search-toggle-on-wpcom b/projects/packages/search/changelog/fix-disable-search-toggle-on-wpcom new file mode 100644 index 0000000000000..d95a7ef42d8cf --- /dev/null +++ b/projects/packages/search/changelog/fix-disable-search-toggle-on-wpcom @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + + diff --git a/projects/packages/search/src/dashboard/components/module-control/index.jsx b/projects/packages/search/src/dashboard/components/module-control/index.jsx index 8b031f0d00ade..b61c79b91586b 100644 --- a/projects/packages/search/src/dashboard/components/module-control/index.jsx +++ b/projects/packages/search/src/dashboard/components/module-control/index.jsx @@ -279,25 +279,28 @@ const SearchToggle = ( { const isSearchToggleChecked = isModuleEnabled && supportsSearch && ! isDisabledFromOverLimit; const isSearchToggleDisabled = isSavingEitherOption || ! supportsSearch || isDisabledFromOverLimit; + const isWpcom = useSelect( select => select( STORE_ID ).isWpcom(), [] ); return (