From f2de68252a5af08ba73213ae4ea545912ef04690 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Mon, 28 Aug 2017 09:02:38 +0200 Subject: Complete homepage transfer --- src/components/home/ContactSection.js | 4 +-- src/components/home/IntroSection.js | 38 +++++++++++++++++++++++++ src/components/home/StakeholderSection.js | 9 +++--- src/components/navigation/Navbar.js | 46 +++++++++++++++++++------------ src/pages/Home.js | 18 ++++++++++-- 5 files changed, 90 insertions(+), 25 deletions(-) create mode 100644 src/components/home/IntroSection.js (limited to 'src') diff --git a/src/components/home/ContactSection.js b/src/components/home/ContactSection.js index c8494c4d..1ec5e9c7 100644 --- a/src/components/home/ContactSection.js +++ b/src/components/home/ContactSection.js @@ -9,14 +9,14 @@ const ContactSection = () => (
- +
atlarge-research/opendc
- +
opendc@atlarge-research.com diff --git a/src/components/home/IntroSection.js b/src/components/home/IntroSection.js new file mode 100644 index 00000000..246786f2 --- /dev/null +++ b/src/components/home/IntroSection.js @@ -0,0 +1,38 @@ +import React from "react"; + +const IntroSection = () => ( +
+
+
+
+

The datacenter (DC) industry...

+
    +
  • Is worth over $15 bn, and growing
  • +
  • Has many hard-to-grasp concepts
  • +
  • Needs to become accessible to many
  • +
+
+ +
+

OpenDC provides...

+
    +
  • Collaborative online DC modeling
  • +
  • Diverse and effective DC simulation
  • +
  • Exploratory DC performance feedback
  • +
+
+
+
+
+); + +export default IntroSection; diff --git a/src/components/home/StakeholderSection.js b/src/components/home/StakeholderSection.js index 47f0d9bb..ddfe4f7c 100644 --- a/src/components/home/StakeholderSection.js +++ b/src/components/home/StakeholderSection.js @@ -2,10 +2,11 @@ import React from "react"; import ContentSection from "./ContentSection"; const Stakeholder = ({name, title, subtitle}) => ( -
- {title}/ -
-

{title}

+
+ {title}/ +
+

{title}

{subtitle}

diff --git a/src/components/navigation/Navbar.js b/src/components/navigation/Navbar.js index c0c8c006..e621b1e4 100644 --- a/src/components/navigation/Navbar.js +++ b/src/components/navigation/Navbar.js @@ -8,6 +8,7 @@ import ProfileName from "../../containers/auth/ProfileName"; import "./Navbar.css"; export const NavItem = withRouter(props => ); +export const LoggedInSection = withRouter(props => ); const NavItemWithoutRoute = ({route, location, children}) => (
  • @@ -15,6 +16,33 @@ const NavItemWithoutRoute = ({route, location, children}) => (
  • ); +const LoggedInSectionWithoutRoute = ({location}) => ( +
      + {userIsLoggedIn() ? + [ + location.pathname === "/" ? + + + My Simulations + + : + + + + + , + + + + ] : + + + + } +
    + ) +; + const Navbar = ({children}) => (
    diff --git a/src/pages/Home.js b/src/pages/Home.js index c315b73e..4f3e2cc0 100644 --- a/src/pages/Home.js +++ b/src/pages/Home.js @@ -1,5 +1,6 @@ import React from 'react'; import ContactSection from "../components/home/ContactSection"; +import IntroSection from "../components/home/IntroSection"; import JumbotronHeader from "../components/home/JumbotronHeader"; import ModelingSection from "../components/home/ModelingSection"; import SimulationSection from "../components/home/SimulationSection"; @@ -12,15 +13,28 @@ import "./Home.css"; class Home extends React.Component { componentDidMount() { - jQuery("body-wrapper").scrollspy({target: "#navbar"}); + const scrollOffset = 60; + jQuery("#navbar").find("li a").click(function (e) { + if (jQuery(e.target).parent(".auth-links")) { + return; + } + e.preventDefault(); + jQuery(jQuery(this).attr('href'))[0].scrollIntoView(); + window.scrollBy(0, -scrollOffset); + }); + jQuery("body").scrollspy({ + target: "#navbar", + offset: scrollOffset + }); } render() { return (
    -
    +
    + -- cgit v1.2.3