diff --git a/projects/js-packages/publicize-components/changelog/update-social-initial-stat-migrate-shares-data b/projects/js-packages/publicize-components/changelog/update-social-initial-stat-migrate-shares-data new file mode 100644 index 0000000000000..b1cfb12b7f277 --- /dev/null +++ b/projects/js-packages/publicize-components/changelog/update-social-initial-stat-migrate-shares-data @@ -0,0 +1,4 @@ +Significance: minor +Type: removed + +Social: Removed share limits UI and data logic diff --git a/projects/js-packages/publicize-components/index.ts b/projects/js-packages/publicize-components/index.ts index c24bfa53c11b8..ae4ab198d4d45 100644 --- a/projects/js-packages/publicize-components/index.ts +++ b/projects/js-packages/publicize-components/index.ts @@ -31,9 +31,7 @@ export * from './src/social-store'; export * from './src/utils'; export * from './src/components/share-post'; export * from './src/hooks/use-sync-post-data-to-store'; -export * from './src/components/share-limits-bar'; export * from './src/hooks/use-saving-post'; -export * from './src/hooks/use-share-limits'; export * from './src/hooks/use-post-meta'; export * from './src/components/share-buttons'; export * from './src/components/manage-connections-modal'; diff --git a/projects/js-packages/publicize-components/src/components/form/enhanced-features-nudge.tsx b/projects/js-packages/publicize-components/src/components/form/enhanced-features-nudge.tsx new file mode 100644 index 0000000000000..ce90b960e33a2 --- /dev/null +++ b/projects/js-packages/publicize-components/src/components/form/enhanced-features-nudge.tsx @@ -0,0 +1,44 @@ +import { getRedirectUrl } from '@automattic/jetpack-components'; +import { + getSiteFragment, + isAtomicSite, + isSimpleSite, +} from '@automattic/jetpack-shared-extension-utils'; +import { Button, PanelRow } from '@wordpress/components'; +import { useSelect } from '@wordpress/data'; +import { _x } from '@wordpress/i18n'; +import { store as socialStore } from '../../social-store'; +import styles from './styles.module.scss'; +import { useAutoSaveAndRedirect } from './use-auto-save-and-redirect'; + +export const EnhancedFeaturesNudge: React.FC = () => { + const hasPaidFeatures = useSelect( select => select( socialStore ).hasPaidFeatures(), [] ); + + const autosaveAndRedirect = useAutoSaveAndRedirect(); + + const isWpcom = isSimpleSite() || isAtomicSite(); + + if ( isWpcom || hasPaidFeatures ) { + return null; + } + + return ( + +