summaryrefslogtreecommitdiff
path: root/frontend/src/pages/Home.js
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2020-10-28 13:29:54 +0100
committerGitHub <noreply@github.com>2020-10-28 13:29:54 +0100
commit93fa55749c40ed1f1a7bee9157bce81708988656 (patch)
treec386e6f0cbac347d15cc10a64d044cb70a6df7f0 /frontend/src/pages/Home.js
parent44342c83b886c4d65ef8b74a3bea1d0e12b37f38 (diff)
parent34b45675b3de56c847818dbcc829f7ce02ddce56 (diff)
Merge pull request #52 from atlarge-research/refactor/jquery
Eliminate jQuery from frontend dependencies
Diffstat (limited to 'frontend/src/pages/Home.js')
-rw-r--r--frontend/src/pages/Home.js61
1 files changed, 16 insertions, 45 deletions
diff --git a/frontend/src/pages/Home.js b/frontend/src/pages/Home.js
index 1bdfc5c7..5000ebfe 100644
--- a/frontend/src/pages/Home.js
+++ b/frontend/src/pages/Home.js
@@ -9,54 +9,25 @@ import StakeholderSection from '../components/home/StakeholderSection'
import TeamSection from '../components/home/TeamSection'
import TechnologiesSection from '../components/home/TechnologiesSection'
import HomeNavbar from '../components/navigation/HomeNavbar'
-import jQuery from '../util/jquery'
import './Home.css'
-class Home extends React.Component {
- 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 })
- }
- }
-
- render() {
- return (
- <div>
- <HomeNavbar />
- <div className="body-wrapper page-container">
- <JumbotronHeader />
- <IntroSection />
- <StakeholderSection />
- <ModelingSection />
- <SimulationSection />
- <TechnologiesSection />
- <TeamSection />
- <ContactSection />
- <DocumentTitle title="OpenDC" />
- </div>
+function Home() {
+ 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