diff --git a/src/App.js b/src/App.js index 1aa3b1b..e284587 100644 --- a/src/App.js +++ b/src/App.js @@ -20,20 +20,13 @@ import GetStarted from './pages/GetStarted'; import FindEv from "./pages/FindEv"; import FindMobility from "./pages/FindMobility"; - - -// import { -// BrowserRouter as Router, -// Routes, -// Route -// } from "react-router-dom"; - import { Routes, Route } from "react-router-dom"; import { useState, useEffect } from "react"; import SiteService from "./svs/SiteService"; function App() { const [blogData, setBlogData] = useState([]) // for holding + const [faqData, setFaqData] = useState([]) // for holding const siteApi = new SiteService(); // instantiating the API SERVICE const getBlogData = async () => { try { @@ -48,8 +41,24 @@ function App() { } }; + const getFaqData = async () => { + try { + const res = await siteApi.faqData(); + if(res.status == 200 /* && res.data.status > 0*/){ + let data = await res.data + console.log(data); + + setFaqData(data) + return + } + } catch (error) { + console.log(error) + } + } + useEffect(() => { getBlogData(); + getFaqData(); }, []); return ( @@ -57,9 +66,9 @@ function App() {
- } /> + } /> } /> - } /> + } /> } /> } /> } /> diff --git a/src/components/Footer.js b/src/components/Footer.js index d9b1cf8..0399da2 100644 --- a/src/components/Footer.js +++ b/src/components/Footer.js @@ -45,10 +45,10 @@ class Footer extends React.Component {
- + appstore-badge - + googleplay-badge
diff --git a/src/index.js b/src/index.js index c7ea92f..c984790 100644 --- a/src/index.js +++ b/src/index.js @@ -1,18 +1,18 @@ import React from 'react'; -import ReactDOM from 'react-dom'; +import ReactDOM from 'react-dom/client'; import './index.css'; import App from './App'; import reportWebVitals from './reportWebVitals'; import { BrowserRouter } from "react-router-dom"; -ReactDOM.render( - // basename='/usr/src/app/build' +const rootElement = document.getElementById('root'); +const root = ReactDOM.createRoot(rootElement); + +root.render( - , - - document.getElementById('root') + ); // If you want to start measuring performance in your app, pass a function diff --git a/src/pages/About.js b/src/pages/About.js index 9ad89cc..0bed2a1 100644 --- a/src/pages/About.js +++ b/src/pages/About.js @@ -5,21 +5,16 @@ class About extends React.Component { render() { return(
- - - {/* PRELOADER SPINNER - ============================================= */} + {/* PRELOADER SPINNER */}
- {/* PAGE CONTENT - ============================================= */} + {/* PAGE CONTENT */}
- {/* PAGE HERO - ============================================= */} + {/* PAGE HERO */}
@@ -34,8 +29,7 @@ class About extends React.Component {
{/* End row */}
{/* End container */}
{/* END PAGE HERO */} - {/* ABOUT-2 - ============================================= */} + {/* ABOUT-2 */}
{/* TEXT BLOCK */} @@ -111,11 +105,8 @@ class About extends React.Component {
{/* END BUTTON */}
{/* End container */} -
{/* END ABOUT-2 */} - - - {/* TEAM-1 - ============================================= */} +
{/* END ABOUT-2 */} + {/* TEAM-1 */}
{/* SECTION TITLE */} @@ -133,8 +124,6 @@ class About extends React.Component {
{Testimonial.map(({name, title, image, link: {domain, href}}, idx) => ( - <> - {/* TEAM MEMBER #1 */}
{/* Team Member Photo */} @@ -148,16 +137,13 @@ class About extends React.Component { @{domain}
-
- {/* END TEAM MEMBER #1 */} - +
))}
{/* End row */} {/* TEAM MEMBERS HOLDER */} {/* End container */}
{/* END TEAM-1 */} - {/* NEWSLETTER-1 - ============================================= */} + {/* NEWSLETTER-1 */}
@@ -187,8 +173,7 @@ class About extends React.Component {
{/* End row */}
{/* End newsletter-holder */} {/* End container */} -
{/* END NEWSLETTER-1 */} - + {/* END NEWSLETTER-1 */} {/* END PAGE CONTENT */} ) diff --git a/src/pages/Contacts.js b/src/pages/Contacts.js index cb99c1e..22b4608 100644 --- a/src/pages/Contacts.js +++ b/src/pages/Contacts.js @@ -1,25 +1,94 @@ -import React, {Component} from 'react'; +import React, {Component, useState, useEffect} from 'react'; +import SiteService from '../svs/SiteService'; -class Contacts extends React.Component { +class Contacts extends Component { + constructor(props){ + super(props) + + this.state = { + formData: { + name: '', + email: '', + country: '', + phone: '', + message: '' + }, + loading: false, + submitError: null, + submitSuccess: false, + }; + } + + handleInputChange = (event) => { + const { name, value } = event.target; + this.setState((prevState) => ({ + formData: { + ...prevState.formData, + [name]: value, + }, + })); + }; + + handleSubmit = async(e) => { + e.preventDefault(); + const apiCall = new SiteService(); + const { formData } = this.state; + + this.setState({ loading: true }); + + if(!formData.name && !formData.email && !formData.message) return; + + console.log(formData) + + try { + await apiCall.contactData(formData) + + console.log('Success') + + this.setState({ + formData: { + name: '', + email: '', + country: '', + phone: '', + message: '' + }, + loading: false, + submitError: null, + submitSuccess: false, + }); + + // if(res.status == 200){ + + // } else { + // throw new Error('Error submitting form'); + // } + } catch (error) { + this.setState({ + loading: false, + submitSuccess: false, + submitError: error, + }); + console.log(error) + } + } + + render() { + const {formData, loading, submitError, submitSuccess} = this.state + console.log(submitSuccess) return(
- - - {/* PRELOADER SPINNER - ============================================= */} + {/* PRELOADER SPINNER */}
- {/* PAGE CONTENT - ============================================= */} + {/* PAGE CONTENT */}
- {/* HEADER - ============================================= */} - {/* CONTACTS-2 - ============================================= */} + {/* HEADER */} + {/* CONTACTS-2 */}
{/* SECTION TITLE */} @@ -39,7 +108,7 @@ class Contacts extends React.Component {
-
+ {/* Form Select */}

This question is about:

@@ -57,21 +126,23 @@ class Contacts extends React.Component {

Your Name:

Please enter your real name: - +

Your Email Address:

Please carefully check your email address for accuracy - +

Explain your question in details:

- Your OS version, NordEx version & build, steps you did. Be VERY precise! -