-
Notifications
You must be signed in to change notification settings - Fork 800
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Social: Remove share limits UI and data logic (#38904)
* Remove unused show_advanced_plan_upgrade_nudge * Remove share limits UI and data store logic * Add changelog * Fix up versions * Restore upgrade nudge from share count info * Hide advanced features nudge on WPCOM
- Loading branch information
1 parent
a950c3f
commit accb8c6
Showing
21 changed files
with
76 additions
and
876 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
...js-packages/publicize-components/changelog/update-social-initial-stat-migrate-shares-data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: removed | ||
|
||
Social: Removed share limits UI and data logic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
projects/js-packages/publicize-components/src/components/form/enhanced-features-nudge.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
<PanelRow className={ styles[ 'enhanced-features-nudge' ] }> | ||
<Button | ||
key="upgrade" | ||
variant="link" | ||
onClick={ autosaveAndRedirect } | ||
href={ getRedirectUrl( 'jetpack-social-basic-plan-block-editor', { | ||
site: getSiteFragment() || '', | ||
query: 'redirect_to=' + encodeURIComponent( window.location.href ), | ||
} ) } | ||
> | ||
{ _x( | ||
'Unlock enhanced media sharing features.', | ||
'Call to action to buy a new plan', | ||
'jetpack' | ||
) } | ||
</Button> | ||
</PanelRow> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 0 additions & 87 deletions
87
projects/js-packages/publicize-components/src/components/form/share-count-info.tsx
This file was deleted.
Oops, something went wrong.
41 changes: 0 additions & 41 deletions
41
projects/js-packages/publicize-components/src/components/form/share-count-notice.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 0 additions & 82 deletions
82
projects/js-packages/publicize-components/src/components/share-limits-bar/index.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.