Custom HTML Review Widgets
If you don't want to use the Enrich Review Widget view provided by Cloutly. You can design the review widgets yourself.
React.js
import React from 'react'
const SupplierPage = () => {
const [reviews, setReviews] = React.useState([]);
React.useEffect(() => {
// ** 1
// This call is your backend endpoint which pulls reviews
// from Cloutly API for the given vendor ID.
getReviewsForSupplier("VENDOR_ID", options)
.then((data) => setReviews(data));
}, []);
// ** 2
// You can display reviews however you like using your own components
return (
<div>
MY Supplier
{reviews && <CustomReviewComponent reviews={reviews}/>}
</div>
);
}
const MyApp = () => {
return (
<MainApp>
<head>
<title>Your Marketplace Website</title>
</head>
<SupplierPage />
</MainApp>
);
};Next.js
Last updated