-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Plugins on starter: adds the announcement modal in customer home. (#6…
…5494) * Announcement modal: prevent widow words. * Plugins on starter: adds the announcement modal in plugins browser. * Plugins on starter: adds the announcement modal in customer home. * Plugins on starter: accounts of /plugins generic page. * Announcement modal: CSS changes Co-authored-by: cpap <[email protected]>
- Loading branch information
1 parent
cf802e1
commit a1a450f
Showing
6 changed files
with
137 additions
and
36 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
47 changes: 47 additions & 0 deletions
47
client/my-sites/plugins/plugins-announcement-modal/index.jsx
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,47 @@ | ||
import { isStarter } from '@automattic/calypso-products'; | ||
import { useTranslate } from 'i18n-calypso'; | ||
import { useSelector } from 'react-redux'; | ||
import announcementImage from 'calypso/assets/images/marketplace/plugins-browser.svg'; | ||
import AnnouncementModal from 'calypso/blocks/announcement-modal'; | ||
import isAtomicSite from 'calypso/state/selectors/is-site-automated-transfer'; | ||
import { isJetpackSite, getSitePlan } from 'calypso/state/sites/selectors'; | ||
import { getSelectedSiteId } from 'calypso/state/ui/selectors'; | ||
|
||
const PluginsAnnouncementModal = () => { | ||
const translate = useTranslate(); | ||
const siteId = useSelector( getSelectedSiteId ); | ||
const jetpackNonAtomic = useSelector( | ||
( state ) => isJetpackSite( state, siteId ) && ! isAtomicSite( state, siteId ) | ||
); | ||
const sitePlan = useSelector( ( state ) => getSitePlan( state, siteId ) ); | ||
|
||
if ( jetpackNonAtomic ) { | ||
// Buying plugins is not yet available to self hosted sites. | ||
return null; | ||
} | ||
|
||
if ( ! siteId || ! isStarter( sitePlan ) ) { | ||
return null; | ||
} | ||
|
||
const announcementPages = [ | ||
{ | ||
headline: translate( 'NEW' ), | ||
heading: translate( 'Install premium plugins on your site' ), | ||
content: translate( | ||
"You can now extend your site's capabilities with premium plugins. Available for purchase on the plugins page." | ||
), | ||
featureImage: announcementImage, | ||
}, | ||
]; | ||
|
||
return ( | ||
<AnnouncementModal | ||
announcementId="plugins-page-starter-plan-launch" | ||
pages={ announcementPages } | ||
finishButtonText={ translate( 'Explore now' ) } | ||
/> | ||
); | ||
}; | ||
|
||
export default PluginsAnnouncementModal; |
Oops, something went wrong.