Created
June 29, 2019 14:45
-
-
Save YaroslavW/1228ef2a0af744d804b00283e11f3cb3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import $ from 'jquery'; | |
import Header from './Components/Header'; | |
import CallToAction from "./Components/CallToAction"; | |
import About from './Components/About'; | |
import Intro from './Components/Intro'; | |
import Portfolio from "./Components/Portfolio"; | |
import Journal from "./Components/Journal"; | |
import Services from "./Components/Services"; | |
import Footer from './Components/Footer'; | |
import Map from './Components/Map'; | |
import Contact from './Components/Contact'; | |
class App extends Component { | |
state = { | |
siteData: {} | |
}; | |
getSiteData() { | |
const domenName = document.domain | |
$.ajax({ | |
url: `http://${domenName}:3000/siteData.json`, | |
dataType: "json", | |
cache: false, | |
success: function(data) { | |
this.setState({ siteData: data }); | |
}.bind(this), | |
error: function(xhr, status, err) { | |
console.log(err); | |
alert(err); | |
} | |
}); | |
} | |
componentDidMount() { | |
this.getSiteData(); | |
} | |
render() { | |
return ( | |
<div> | |
<Header data={this.state.siteData.header}/> | |
<Intro /> | |
<Services /> | |
<Portfolio /> | |
<Journal /> | |
<About /> | |
<CallToAction /> | |
<Map /> | |
<Contact /> | |
<Footer /> | |
</div> | |
); | |
} | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment