diff --git a/plugins/woocommerce-admin/client/marketplace/components/constants.ts b/plugins/woocommerce-admin/client/marketplace/components/constants.ts index 548249734e2..4666ee78804 100644 --- a/plugins/woocommerce-admin/client/marketplace/components/constants.ts +++ b/plugins/woocommerce-admin/client/marketplace/components/constants.ts @@ -1,3 +1,5 @@ export const DEFAULT_TAB_KEY = 'discover'; +export const MARKETPLACE_API_HOST = 'https://woocommerce.com'; export const MARKETPLACE_PATH = '/extensions'; -export const MARKETPLACE_URL = 'https://woocommerce.com'; +export const MARKETPLACE_SEARCH_API_PATH = '/wp-json/wccom-extensions/1.0/search'; +export const MARKETPLACE_CATEGORY_API_PATH = '/wp-json/wccom-extensions/1.0/categories'; diff --git a/plugins/woocommerce-admin/client/marketplace/components/content/content.tsx b/plugins/woocommerce-admin/client/marketplace/components/content/content.tsx index 9c9af5fb837..4149b5291f1 100644 --- a/plugins/woocommerce-admin/client/marketplace/components/content/content.tsx +++ b/plugins/woocommerce-admin/client/marketplace/components/content/content.tsx @@ -1,6 +1,7 @@ /** * External dependencies */ +import { useContext } from '@wordpress/element'; /** * Internal dependencies @@ -8,12 +9,7 @@ import './content.scss'; import Discover from '../discover/discover'; import Extensions from '../extensions/extensions'; -import Footer from '../footer/footer'; -import FeedbackModal from '../feedback-modal/feedback-modal'; - -export interface ContentProps { - selectedTab?: string | undefined; -} +import { MarketplaceContext } from '../../contexts/marketplace-context'; const renderContent = ( selectedTab?: string ): JSX.Element => { switch ( selectedTab ) { @@ -24,15 +20,12 @@ const renderContent = ( selectedTab?: string ): JSX.Element => { } }; -export default function Content( props: ContentProps ): JSX.Element { - const { selectedTab } = props; +export default function Content(): JSX.Element { + const marketplaceContextValue = useContext( MarketplaceContext ); + const { selectedTab } = marketplaceContextValue; return ( - <> -
- { renderContent( selectedTab ) } -
-