-
Notifications
You must be signed in to change notification settings - Fork 25
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
942640e
commit 2cfea42
Showing
2 changed files
with
72 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { Container } from '@newfold/ui-component-library'; | ||
import apiFetch from '@wordpress/api-fetch'; | ||
import { useState, useEffect } from '@wordpress/element'; | ||
import { NewfoldRuntime } from '@newfold-labs/wp-module-runtime'; | ||
import { default as NewfoldProducts } from '@newfold-labs/wp-module-my-products/components/product'; | ||
import { isJarvis } from '../../util/helpers'; | ||
|
||
// constants to pass to module | ||
const moduleConstants = { | ||
text: { | ||
error: __( | ||
'Oops, there was an error loading products, please try again later.', | ||
'bluehost-wordpress-plugin' | ||
), | ||
noProducts: __( | ||
'Sorry, no products. Please, try again later.', | ||
'bluehost-wordpress-plugin' | ||
), | ||
jarvisText: __( | ||
'Please login to your account manager to see products.', | ||
'bluehost-wordpress-plugin' | ||
), | ||
}, | ||
}; | ||
|
||
// methods to pass to module | ||
const moduleMethods = { | ||
apiFetch, | ||
useState, | ||
useEffect, | ||
NewfoldRuntime, | ||
isJarvis, | ||
}; | ||
|
||
const ProductSection = () => { | ||
return ( | ||
<Container className="wppbh-products-section"> | ||
<Container.Header | ||
title={ __( 'My Products', 'bluehost-wordpress-plugin' ) } | ||
> | ||
<p> | ||
{ __( | ||
'A list of products associated with your Bluehost hosting package. For more information, check out the ', | ||
'bluehost-wordpress-plugin' | ||
) } | ||
|
||
<a href="https://www.bluehost.com/my-account/renewal-center"> | ||
{ __( | ||
'Bluehost Account Manager', | ||
'bluehost-wordpress-plugin' | ||
) } | ||
</a> | ||
</p> | ||
</Container.Header> | ||
<NewfoldProducts | ||
methods={ moduleMethods } | ||
constants={ moduleConstants } | ||
/> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default ProductSection; |