added the endpoint

This commit is contained in:
Ebube
2023-04-10 12:01:59 +01:00
parent f652304468
commit cfa177eaa9
4 changed files with 101 additions and 27 deletions
+36 -19
View File
@@ -1,26 +1,48 @@
import React, {Component} from 'react';
import SiteService from './assests/utils/SiteService';
class Faqs extends React.Component {
class Faqs extends Component {
constructor({data, loading, error}){
super({data, loading, error})
this.state = {
data: null,
loading: true,
error: null
}
}
async componentDidMount() {
const apiCall = new SiteService
try {
const data = await apiCall.faqData();
this.setState = {
data: data,
loading: false
}
} catch (error) {
this.setState = {
error: error,
loading: false
}
}
}
render() {
const {data, loading, error} = this.state
console.log(data)
console.log(error)
return(
<div>
{/* PRELOADER SPINNER
============================================= */}
{/* PRELOADER SPINNER */}
<div id="loader-wrapper">
<div id="loading">
<span className="cssload-loader"><span className="cssload-loader-inner" /></span>
</div>
</div>
{/* PAGE CONTENT
============================================= */}
{/* PAGE CONTENT */}
<div id="page" className="page">
{/* HEADER
============================================= */}
{/* FAQs-2
============================================= */}
{/* HEADER */}
{/* FAQs-2 */}
<section id="faqs-2" className="bg_whitesmoke hero-offset-nav pb-100 faqs-section division">
<div className="container">
{/* SECTION TITLE */}
@@ -182,8 +204,7 @@ class Faqs extends React.Component {
{/* GEOMETRIC OVERLAY */}
<div className="bg_fixed geometric_overlay" />
</section> {/* END FAQs-2 */}
{/* DOWNLOAD-2
============================================= */}
{/* DOWNLOAD-2 */}
<section id="download-2" className="bg_whitesmoke pb-20 download-section division">
<div className="container white-color">
<div className="rel purple_gradient bg_shape_01 downloads-2-wrapper">
@@ -219,12 +240,8 @@ class Faqs extends React.Component {
</div> {/* End row */}
</div> {/* End container */}
</section> {/* END DOWNLOAD-2 */}
</div> {/* END PAGE CONTENT */}
</div>
</div>
)
}
}