Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 43fa698c43 | |||
| cfa177eaa9 |
@@ -8,4 +8,4 @@ REACT_APP_APIGATE='http://float-gat.dev.chiefsoft.net'
|
|||||||
REACT_APP_APPLE_LINK='https://apps.apple.com/us/app/float-mobility/id1465369130'
|
REACT_APP_APPLE_LINK='https://apps.apple.com/us/app/float-mobility/id1465369130'
|
||||||
REACT_APP_GOOGLE_PLAY_LINK='https://apps.apple.com/us/app/float-mobility/id1465369130'
|
REACT_APP_GOOGLE_PLAY_LINK='https://apps.apple.com/us/app/float-mobility/id1465369130'
|
||||||
|
|
||||||
REACT_APP_AUX_ENDPOINT='https://float-gat.dev.chiefsoft.net/en/floatweb/api/v1/'
|
REACT_APP_AUX_ENDPOINT='https://float-gat.dev.chiefsoft.net/en/floatweb/api/v1/'
|
||||||
|
|||||||
@@ -20,14 +20,6 @@ import GetStarted from './pages/GetStarted';
|
|||||||
import FindEv from "./pages/FindEv";
|
import FindEv from "./pages/FindEv";
|
||||||
import FindMobility from "./pages/FindMobility";
|
import FindMobility from "./pages/FindMobility";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// import {
|
|
||||||
// BrowserRouter as Router,
|
|
||||||
// Routes,
|
|
||||||
// Route
|
|
||||||
// } from "react-router-dom";
|
|
||||||
|
|
||||||
import { Routes, Route } from "react-router-dom";
|
import { Routes, Route } from "react-router-dom";
|
||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import SiteService from "./svs/SiteService";
|
import SiteService from "./svs/SiteService";
|
||||||
|
|||||||
+36
-19
@@ -1,26 +1,48 @@
|
|||||||
import React, {Component} from 'react';
|
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() {
|
render() {
|
||||||
|
const {data, loading, error} = this.state
|
||||||
|
console.log(data)
|
||||||
|
console.log(error)
|
||||||
return(
|
return(
|
||||||
<div>
|
<div>
|
||||||
|
{/* PRELOADER SPINNER */}
|
||||||
|
|
||||||
{/* PRELOADER SPINNER
|
|
||||||
============================================= */}
|
|
||||||
<div id="loader-wrapper">
|
<div id="loader-wrapper">
|
||||||
<div id="loading">
|
<div id="loading">
|
||||||
<span className="cssload-loader"><span className="cssload-loader-inner" /></span>
|
<span className="cssload-loader"><span className="cssload-loader-inner" /></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* PAGE CONTENT
|
{/* PAGE CONTENT */}
|
||||||
============================================= */}
|
|
||||||
<div id="page" className="page">
|
<div id="page" className="page">
|
||||||
{/* HEADER
|
{/* HEADER */}
|
||||||
============================================= */}
|
{/* FAQs-2 */}
|
||||||
|
|
||||||
{/* FAQs-2
|
|
||||||
============================================= */}
|
|
||||||
<section id="faqs-2" className="bg_whitesmoke hero-offset-nav pb-100 faqs-section division">
|
<section id="faqs-2" className="bg_whitesmoke hero-offset-nav pb-100 faqs-section division">
|
||||||
<div className="container">
|
<div className="container">
|
||||||
{/* SECTION TITLE */}
|
{/* SECTION TITLE */}
|
||||||
@@ -182,8 +204,7 @@ class Faqs extends React.Component {
|
|||||||
{/* GEOMETRIC OVERLAY */}
|
{/* GEOMETRIC OVERLAY */}
|
||||||
<div className="bg_fixed geometric_overlay" />
|
<div className="bg_fixed geometric_overlay" />
|
||||||
</section> {/* END FAQs-2 */}
|
</section> {/* END FAQs-2 */}
|
||||||
{/* DOWNLOAD-2
|
{/* DOWNLOAD-2 */}
|
||||||
============================================= */}
|
|
||||||
<section id="download-2" className="bg_whitesmoke pb-20 download-section division">
|
<section id="download-2" className="bg_whitesmoke pb-20 download-section division">
|
||||||
<div className="container white-color">
|
<div className="container white-color">
|
||||||
<div className="rel purple_gradient bg_shape_01 downloads-2-wrapper">
|
<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 row */}
|
||||||
</div> {/* End container */}
|
</div> {/* End container */}
|
||||||
</section> {/* END DOWNLOAD-2 */}
|
</section> {/* END DOWNLOAD-2 */}
|
||||||
|
|
||||||
</div> {/* END PAGE CONTENT */}
|
</div> {/* END PAGE CONTENT */}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
class SiteService {
|
||||||
|
constructor(){
|
||||||
|
console.log("Launched!!")
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET REQUEST
|
||||||
|
// Faq Data
|
||||||
|
faqData(){
|
||||||
|
return this.getEndPoint("/faq", null)
|
||||||
|
}
|
||||||
|
|
||||||
|
// POST REQUEST
|
||||||
|
// Contact Data
|
||||||
|
contactData(){
|
||||||
|
return this.postEndPoint("/contact")
|
||||||
|
}
|
||||||
|
|
||||||
|
getEndPoint(uri, req){
|
||||||
|
const endPoint = process.env.REACT_APP_AUX_ENDPOINT + uri;
|
||||||
|
return axios.get(endPoint)
|
||||||
|
.then((res) => {
|
||||||
|
console.log('==> GET REQUEST <==')
|
||||||
|
console.log(res)
|
||||||
|
return res
|
||||||
|
}).catch((err) => {
|
||||||
|
if (err.response) {
|
||||||
|
//response status is an error code
|
||||||
|
console.log(err.response.status);
|
||||||
|
} else if (err.request) {
|
||||||
|
//response not received though the request was sent
|
||||||
|
console.log(err.request);
|
||||||
|
} else {
|
||||||
|
//an error occurred when setting up the request
|
||||||
|
console.log(err.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
postEndPoint(uri, req){
|
||||||
|
const endPoint = process.env.REACT_APP_AUX_ENDPOINT + uri;
|
||||||
|
return axios.get(endPoint, req)
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res)
|
||||||
|
console.log('==> POST REQUEST <==')
|
||||||
|
return res
|
||||||
|
}).catch((err) => {
|
||||||
|
if (err.response) {
|
||||||
|
//response status is an error code
|
||||||
|
console.log(err.response.status);
|
||||||
|
} else if (err.request) {
|
||||||
|
//response not received though the request was sent
|
||||||
|
console.log(err.request);
|
||||||
|
} else {
|
||||||
|
//an error occurred when setting up the request
|
||||||
|
console.log(err.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SiteService
|
||||||
Reference in New Issue
Block a user