From 0bdc4fc692f08e986f5f1ffbee86189e053b895b Mon Sep 17 00:00:00 2001 From: Aleksej Date: Thu, 10 Oct 2024 12:05:07 +0200 Subject: [PATCH] Update per CR feedback. --- .../components/KeyMetrics/MetricsSelectionPanel/Footer.js | 6 ++---- assets/js/googlesitekit/widgets/datastore/widgets.js | 2 +- assets/js/googlesitekit/widgets/index.js | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/assets/js/components/KeyMetrics/MetricsSelectionPanel/Footer.js b/assets/js/components/KeyMetrics/MetricsSelectionPanel/Footer.js index d5d71379e91..c149a4313c0 100644 --- a/assets/js/components/KeyMetrics/MetricsSelectionPanel/Footer.js +++ b/assets/js/components/KeyMetrics/MetricsSelectionPanel/Footer.js @@ -52,7 +52,7 @@ import { ERROR_CODE_MISSING_REQUIRED_SCOPE } from '../../../util/errors'; import useViewContext from '../../../hooks/useViewContext'; import { trackEvent } from '../../../util'; import { SelectionPanelFooter } from '../../SelectionPanel'; -import { isFeatureEnabled } from '../../../features'; +import { useFeature } from '../../../hooks/useFeature'; export default function Footer( { isOpen, @@ -61,9 +61,7 @@ export default function Footer( { onNavigationToOAuthURL = () => {}, } ) { const viewContext = useViewContext(); - const isConversionReportingEnabled = isFeatureEnabled( - 'conversionReporting' - ); + const isConversionReportingEnabled = useFeature( 'conversionReporting' ); const selectedMetrics = useSelect( ( select ) => select( CORE_FORMS ).getValue( diff --git a/assets/js/googlesitekit/widgets/datastore/widgets.js b/assets/js/googlesitekit/widgets/datastore/widgets.js index 74ae761d046..c1d25fa5f17 100644 --- a/assets/js/googlesitekit/widgets/datastore/widgets.js +++ b/assets/js/googlesitekit/widgets/datastore/widgets.js @@ -83,7 +83,7 @@ export const actions = { * @param {string|Array.} [settings.modules] Optional. Widget's associated modules. * @param {Function} [settings.isActive] Optional. Callback function to determine if the widget is active. * @param {Function} [settings.isPreloaded] Optional. Callback function to determine if the widget should be preloaded if not active (requires isActive). - * @param {string|Array.} [settings.hideOnBreakpoints] Optional. Hide widget on selected breakpoints. One of: "BREAKPOINT_SMALL", "BREAKPOINT_TABLET", "BREAKPOINT_DESKTOP", "BREAKPOINT_XLARGE". + * @param {Array.} [settings.hideOnBreakpoints] Optional. Hide widget on selected breakpoints. Array with any of: `BREAKPOINT_SMALL`, `BREAKPOINT_TABLET`, `BREAKPOINT_DESKTOP`, `BREAKPOINT_XLARGE`. * @return {Object} Redux-style action. */ registerWidget( diff --git a/assets/js/googlesitekit/widgets/index.js b/assets/js/googlesitekit/widgets/index.js index 6619db2092a..d30ca1a269e 100644 --- a/assets/js/googlesitekit/widgets/index.js +++ b/assets/js/googlesitekit/widgets/index.js @@ -89,7 +89,7 @@ export function createWidgets( registry ) { * @param {string|Array.} [settings.width] Optional. Widget's maximum width to occupy. Default is: "quarter". One of: "quarter", "half", "full". * @param {boolean} [settings.wrapWidget] Optional. Whether to wrap the component with the wrapper. Default is: true. * @param {string|Array.} [settings.modules] Optional. Widget's associated moduels. - * @param {string|Array.} [settings.hideOnBreakpoints] Optional. Hide widget on selected breakpoints. One of: "BREAKPOINT_SMALL", "BREAKPOINT_TABLET", "BREAKPOINT_DESKTOP", "BREAKPOINT_XLARGE". + * @param {Array.} [settings.hideOnBreakpoints] Optional. Hide widget on selected breakpoints. Array with any of: `BREAKPOINT_SMALL`, `BREAKPOINT_TABLET`, `BREAKPOINT_DESKTOP`, `BREAKPOINT_XLARGE`. * @param {(string|Array)} [widgetAreaSlugs] Optional. Widget area slug(s). */ registerWidget( slug, settings, widgetAreaSlugs ) {