diff options
| author | Georgios Andreadis <G.Andreadis@student.tudelft.nl> | 2017-10-04 23:23:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-04 23:23:09 +0200 |
| commit | fcaaae65d34003874c76e0c01134dedf94248e09 (patch) | |
| tree | 2aae1422168651e832a1904623f6f5b100fc17ec /src/pages/Home.js | |
| parent | 0a62dfb55c5700013d42a589b930c7448e5bff71 (diff) | |
| parent | 606d1de0be09f3597165248f65d54e158a13860c (diff) | |
Merge pull request #42 from atlarge-research/auto-reformat
Standardize code format
Diffstat (limited to 'src/pages/Home.js')
| -rw-r--r-- | src/pages/Home.js | 80 |
1 files changed, 41 insertions, 39 deletions
diff --git a/src/pages/Home.js b/src/pages/Home.js index 03df4dc5..f6479722 100644 --- a/src/pages/Home.js +++ b/src/pages/Home.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React from "react"; import DocumentTitle from "react-document-title"; import ContactSection from "../components/home/ContactSection"; import IntroSection from "../components/home/IntroSection"; @@ -13,48 +13,50 @@ import jQuery from "../util/jquery"; import "./Home.css"; class Home extends React.Component { - state = { - scrollSpySetup: false, - }; + state = { + scrollSpySetup: false + }; - componentDidMount() { - const scrollOffset = 60; - jQuery("#navbar").find("li a").click(function (e) { - if (jQuery(e.target).parents(".auth-links").length > 0) { - return; - } - e.preventDefault(); - jQuery(jQuery(this).attr('href'))[0].scrollIntoView(); - window.scrollBy(0, -scrollOffset); - }); - - if (!this.state.scrollSpySetup) { - jQuery("body").scrollspy({ - target: "#navbar", - offset: scrollOffset - }); - this.setState({scrollSpySetup: true}); + componentDidMount() { + const scrollOffset = 60; + jQuery("#navbar") + .find("li a") + .click(function(e) { + if (jQuery(e.target).parents(".auth-links").length > 0) { + return; } - } + e.preventDefault(); + jQuery(jQuery(this).attr("href"))[0].scrollIntoView(); + window.scrollBy(0, -scrollOffset); + }); - render() { - return ( - <div> - <HomeNavbar/> - <div className="body-wrapper page-container"> - <JumbotronHeader/> - <IntroSection/> - <StakeholderSection/> - <ModelingSection/> - <SimulationSection/> - <TechnologiesSection/> - <TeamSection/> - <ContactSection/> - <DocumentTitle title="OpenDC"/> - </div> - </div> - ); + if (!this.state.scrollSpySetup) { + jQuery("body").scrollspy({ + target: "#navbar", + offset: scrollOffset + }); + this.setState({ scrollSpySetup: true }); } + } + + render() { + return ( + <div> + <HomeNavbar /> + <div className="body-wrapper page-container"> + <JumbotronHeader /> + <IntroSection /> + <StakeholderSection /> + <ModelingSection /> + <SimulationSection /> + <TechnologiesSection /> + <TeamSection /> + <ContactSection /> + <DocumentTitle title="OpenDC" /> + </div> + </div> + ); + } } export default Home; |
