-
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.
- Loading branch information
1 parent
0040ea6
commit 1535c21
Showing
6 changed files
with
31 additions
and
13 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
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