Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: newfold-labs/wp-module-marketplace
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.0.2
Choose a base ref
...
head repository: newfold-labs/wp-module-marketplace
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2.1.0
Choose a head ref
  • 3 commits
  • 2 files changed
  • 1 contributor

Commits on Nov 6, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    63ab223 View commit details
  2. Copy the full SHA
    4cc1e3f View commit details

Commits on Nov 7, 2023

  1. Merge pull request #44 from newfold-labs/feature/category-subnav-helper

    Feature/category subnav helper
    circlecube authored Nov 7, 2023
    Copy the full SHA
    3f836e2 View commit details
Showing with 32 additions and 1 deletion.
  1. +4 −1 components/marketplace/index.js
  2. +28 −0 components/marketplaceSubnav/index.js
5 changes: 4 additions & 1 deletion components/marketplace/index.js
Original file line number Diff line number Diff line change
@@ -182,7 +182,10 @@ const defaults = {
title={getSectionTitle()}
subTitle={constants.text.subTitle}
/>
<Components.SectionContent className={methods.classnames('newfold-marketplace-wrapper')}>
<Components.SectionContent className={methods.classnames(
'newfold-marketplace-wrapper',
`newfold-marketplace-${marketplaceCategories[activeCategoryIndex]}`
)}>
{ isLoading &&
renderSkeleton()
}
28 changes: 28 additions & 0 deletions components/marketplaceSubnav/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { NewfoldRuntime } from '@newfold-labs/wp-module-runtime';
import apiFetch from '@wordpress/api-fetch';

/**
* Marketplace Subnav Helper Method
*
* @returns array of routes
*/
export const getMarketplaceSubnavRoutes = () => {
return apiFetch( {
url: NewfoldRuntime.createApiUrl( '/newfold-marketplace/v1/marketplace' )
}).then( ( response ) => {
let marketplaceSubnav = [];
if ( response.hasOwnProperty('categories') ) {
let marketPlaceCategories = response.categories.data;
marketPlaceCategories.forEach( (cat) => {
// format categories for subnav routes
marketplaceSubnav.push(
{
name: '/marketplace/' + cat.name,
title: cat.title
}
);
});
}
return marketplaceSubnav;
});
};