-
Notifications
You must be signed in to change notification settings - Fork 901
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21839 from Yoast/528-dashboard-add-footer-upsell-…
…like-in-the-alert-center Extract upsell to sidebar-layout.js
- Loading branch information
Showing
5 changed files
with
30 additions
and
21 deletions.
There are no files selected for viewing
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
24 changes: 24 additions & 0 deletions
24
packages/js/src/general/components/connected-premium-upsell-list.js
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,24 @@ | ||
import { useSelect } from "@wordpress/data"; | ||
import { PremiumUpsellList } from "../../shared-admin/components"; | ||
import { STORE_NAME } from "../constants"; | ||
import { useSelectGeneralPage } from "../hooks"; | ||
|
||
/** | ||
* @returns {JSX.Element|null} The premium upsell list or null if not applicable. | ||
*/ | ||
export const ConnectedPremiumUpsellList = () => { | ||
const isPremium = useSelectGeneralPage( "selectPreference", [], "isPremium" ); | ||
const premiumUpsellConfig = useSelectGeneralPage( "selectUpsellSettingsAsProps" ); | ||
const { isPromotionActive } = useSelect( STORE_NAME ); | ||
const premiumLinkList = useSelectGeneralPage( "selectLink", [], "https://yoa.st/17h" ); | ||
|
||
if ( isPremium ) { | ||
return null; | ||
} | ||
return <PremiumUpsellList | ||
premiumLink={ premiumLinkList } | ||
premiumUpsellConfig={ premiumUpsellConfig } | ||
isPromotionActive={ isPromotionActive } | ||
/>; | ||
}; | ||
|
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
4 changes: 2 additions & 2 deletions
4
packages/js/src/shared-admin/components/premium-upsell-list.js
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