diff --git a/composer.json b/composer.json index 67a877180..6091163db 100644 --- a/composer.json +++ b/composer.json @@ -85,7 +85,7 @@ "newfold-labs/wp-module-global-ctb": "^1.0.12", "newfold-labs/wp-module-help-center": "^2.0.0", "newfold-labs/wp-module-loader": "^1.0.10", - "newfold-labs/wp-module-marketplace": "^2.2.4", + "newfold-labs/wp-module-marketplace": "^2.3.0", "newfold-labs/wp-module-notifications": "^1.3.0", "newfold-labs/wp-module-onboarding": "^2.3.4", "newfold-labs/wp-module-patterns": "2.0.0 as 1.9.9", diff --git a/composer.lock b/composer.lock index 3b5fa8141..cdb1bba8a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f551bf74dd2e6a4bb35402b7c8dd56d7", + "content-hash": "4e69c566ef2d352d5ea535c70ed8d41b", "packages": [ { "name": "doctrine/inflector", @@ -1009,20 +1009,20 @@ }, { "name": "newfold-labs/wp-module-marketplace", - "version": "2.2.4", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-marketplace.git", - "reference": "3b1864b75d069ca896e205792209a797a24f2abb" + "reference": "2d5064b3a935246f4e05f826b97663bdaa251d3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-marketplace/zipball/3b1864b75d069ca896e205792209a797a24f2abb", - "reference": "3b1864b75d069ca896e205792209a797a24f2abb", + "url": "https://api.github.com/repos/newfold-labs/wp-module-marketplace/zipball/2d5064b3a935246f4e05f826b97663bdaa251d3e", + "reference": "2d5064b3a935246f4e05f826b97663bdaa251d3e", "shasum": "" }, "require": { - "newfold-labs/wp-module-data": "^2.0.0" + "newfold-labs/wp-module-data": "^2.5.2" }, "require-dev": { "newfold-labs/wp-php-standards": "^1.2" @@ -1059,10 +1059,10 @@ ], "description": "A module for rendering product data and interacting with the Hiive marketplace API.", "support": { - "source": "https://github.com/newfold-labs/wp-module-marketplace/tree/2.2.4", + "source": "https://github.com/newfold-labs/wp-module-marketplace/tree/2.3.0", "issues": "https://github.com/newfold-labs/wp-module-marketplace/issues" }, - "time": "2024-02-27T17:01:06+00:00" + "time": "2024-06-18T05:06:33+00:00" }, { "name": "newfold-labs/wp-module-migration", diff --git a/src/app/pages/marketplace/index.js b/src/app/pages/marketplace/index.js index 02e8cf6f6..a920acd52 100644 --- a/src/app/pages/marketplace/index.js +++ b/src/app/pages/marketplace/index.js @@ -1,11 +1,11 @@ import apiFetch from '@wordpress/api-fetch'; import { useState, useEffect } from '@wordpress/element'; -import { useLocation } from 'react-router-dom'; +import { useLocation, useMatch, useNavigate } from 'react-router-dom'; import classnames from 'classnames'; import { Container, Page } from '@newfold/ui-component-library'; import { NewfoldRuntime } from '@newfold-labs/wp-module-runtime'; // component sourced from marketplace module -import { default as NewfoldMarketplace } from '@modules/wp-module-marketplace/components/marketplace/'; +import { default as NewfoldMarketplace } from '@modules/wp-module-marketplace/components/'; const MarketplacePage = () => { // constants to pass to module @@ -26,6 +26,18 @@ const MarketplacePage = () => { 'bluehost-wordpress-plugin' ), loadMore: __( 'Load More', 'bluehost-wordpress-plugin' ), + productPage: { + error: { + title: __( + 'Oops! Something Went Wrong', + 'bluehost-wordpress-plugin' + ), + description: __( + 'An error occurred while loading the content. Please try again later.', + 'bluehost-wordpress-plugin' + ), + }, + }, }, }; @@ -36,12 +48,18 @@ const MarketplacePage = () => { useState, useEffect, useLocation, + useMatch, + useNavigate, NewfoldRuntime, }; return ( - + { const getFbDetails = () => { getFacebookUserProfileDetails().then( ( res ) => { setFbLogin( res === 'token not found!' ? false : true ); - if ( Array.isArray( res ) ) setLoginInfo( res[ 0 ] ); - else setLoginInfo( res ); + if ( Array.isArray( res ) ) { + setLoginInfo( res[ 0 ] ); + } else { + setLoginInfo( res ); + } } ); };