From c7ff1f4b2a8e03e9de3159898063c79d539ea786 Mon Sep 17 00:00:00 2001 From: Sam Seay Date: Fri, 4 Jun 2021 07:59:11 +1200 Subject: [PATCH] Deprecate the no longer used Count component (https://github.com/woocommerce/woocommerce-admin/pull/7115) --- .../woocommerce-admin/packages/components/CHANGELOG.md | 1 + .../packages/components/src/count/index.js | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/plugins/woocommerce-admin/packages/components/CHANGELOG.md b/plugins/woocommerce-admin/packages/components/CHANGELOG.md index 9c4de22e7b7..3405327944d 100644 --- a/plugins/woocommerce-admin/packages/components/CHANGELOG.md +++ b/plugins/woocommerce-admin/packages/components/CHANGELOG.md @@ -4,6 +4,7 @@ - Fix styling of the advanced filter operator selection. #7005 - Remove the use of Dashicons and replace with @wordpress/icons or gridicons #7020 - Add tree shaking support to this package. #7034 +- Deprecate the Count component, with plan to remove in next major version. #7115 - Remove the long deprecated Card component (use Card from `@wordpress/components` instead). #7114 # 6.2.0 diff --git a/plugins/woocommerce-admin/packages/components/src/count/index.js b/plugins/woocommerce-admin/packages/components/src/count/index.js index c3e6e7039e4..113f83859d1 100644 --- a/plugins/woocommerce-admin/packages/components/src/count/index.js +++ b/plugins/woocommerce-admin/packages/components/src/count/index.js @@ -3,6 +3,7 @@ */ import { __, sprintf } from '@wordpress/i18n'; import PropTypes from 'prop-types'; +import deprecated from '@wordpress/deprecated'; /** * Display a number with a styled border. @@ -13,6 +14,13 @@ import PropTypes from 'prop-types'; * @return {Object} - */ const Count = ( { count, label } ) => { + deprecated( 'Count', { + version: '7.2.0', + alternative: '@woocommerce/components Badge', + plugin: 'WooCommerce', + hint: 'Use `import { Badge } from "@woocommerce/components"`', + } ); + if ( ! label ) { label = sprintf( __( 'Total %d', 'woocommerce-admin' ), count ); }