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 BusinessPage = () => {
const [reviews, setReviews] = React.useState([]);
React.useEffect(() => {
// ** 1
// This call is your backend endpoint which pulls reviews
// from Cloutly API for the given business ID.
getReviewsForBusiness("BUSINESS_ID", options)
.then((data) => setReviews(data));
}, []);
// ** 2
// You can display reviews however you like using your own components
return (
<div>
MY Business
{reviews && <CustomReviewComponent reviews={reviews}/>}
</div>
);
}
const MyApp = () => {
return (
<MainApp>
<head>
<title>Your Marketplace Website</title>
</head>
<BusinessPage />
</MainApp>
);
};Next.js
Last updated