-
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.
Customize Woo Express and free trial themes screen (#78570)
* Tweak Woo Express and free trial selector to use site for faster performance * Force theme upsell banner for free trial sites, hide theme categories for Woo Express and free trial sites * Add hidden theme filters to force woo-on-plans filter * Redirect woo-on-plan themes to congrats page on theme activation * Customize upsell nudge arrangement for Woo Express and free trial * Add back current plan to selectors as a backup * Update client/my-sites/themes/theme-showcase.jsx Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com> * Fix hiddenFilters inserting empty array into join breaking other filters * Hardcode store filter instead since 5 WooCommerce only themes is too small to choose from --------- Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
- Loading branch information
Showing
8 changed files
with
83 additions
and
25 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { isSiteOnECommerceTrial, isSiteOnWooExpress } from 'calypso/state/sites/plans/selectors'; | ||
|
||
/** | ||
* Returns theme filters that are not shown in the UI nor navigation URL. | ||
* | ||
* @param {Object} state Global state tree | ||
* @param {?number} siteId Site ID to optionally use as context | ||
* @returns {Array} Array of filter slugs | ||
*/ | ||
export function getThemeHiddenFilters( state, siteId ) { | ||
const filters = []; | ||
|
||
if ( isSiteOnECommerceTrial( state, siteId ) || isSiteOnWooExpress( state, siteId ) ) { | ||
filters.push( 'store' ); | ||
} | ||
|
||
return filters; | ||
} |
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