From 751a9ef3a12c952fe179f256d854d0c4aa37e28e Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Wed, 4 Oct 2017 22:49:07 +0200 Subject: Apply prettier to codebase --- src/components/navigation/AppNavbar.js | 97 +++++++++++---------- src/components/navigation/HomeNavbar.js | 28 +++--- src/components/navigation/LogoutButton.js | 12 +-- src/components/navigation/Navbar.js | 140 ++++++++++++++++-------------- 4 files changed, 147 insertions(+), 130 deletions(-) (limited to 'src/components/navigation') diff --git a/src/components/navigation/AppNavbar.js b/src/components/navigation/AppNavbar.js index 90724a3e..ab4b8412 100644 --- a/src/components/navigation/AppNavbar.js +++ b/src/components/navigation/AppNavbar.js @@ -1,53 +1,58 @@ -import React from 'react'; +import React from "react"; import FontAwesome from "react-fontawesome"; import Mailto from "react-mailto"; -import {Link} from "react-router-dom"; -import Navbar, {NavItem} from "./Navbar"; +import { Link } from "react-router-dom"; +import Navbar, { NavItem } from "./Navbar"; import "./Navbar.css"; -const AppNavbar = ({simulationId, inSimulation, fullWidth}) => ( - - {inSimulation ? - - - - Construction - - : - undefined - } - {inSimulation ? - - - - Experiments - - : - undefined - } - - - - My Simulations - - - - - - Support - - - +const AppNavbar = ({ simulationId, inSimulation, fullWidth }) => ( + + {inSimulation ? ( + + + + Construction + + + ) : ( + undefined + )} + {inSimulation ? ( + + + + Experiments + + + ) : ( + undefined + )} + + + + My Simulations + + + + + + Support + + + ); export default AppNavbar; diff --git a/src/components/navigation/HomeNavbar.js b/src/components/navigation/HomeNavbar.js index 4d821325..5d08bf3c 100644 --- a/src/components/navigation/HomeNavbar.js +++ b/src/components/navigation/HomeNavbar.js @@ -1,22 +1,24 @@ -import React from 'react'; +import React from "react"; import Navbar from "./Navbar"; import "./Navbar.css"; -const ScrollNavItem = ({id, name}) => ( -
  • - {name} -
  • +const ScrollNavItem = ({ id, name }) => ( +
  • + + {name} + +
  • ); const HomeNavbar = () => ( - - - - - - - - + + + + + + + + ); export default HomeNavbar; diff --git a/src/components/navigation/LogoutButton.js b/src/components/navigation/LogoutButton.js index d58776dc..800a3da8 100644 --- a/src/components/navigation/LogoutButton.js +++ b/src/components/navigation/LogoutButton.js @@ -1,16 +1,16 @@ import PropTypes from "prop-types"; import React from "react"; import FontAwesome from "react-fontawesome"; -import {Link} from "react-router-dom"; +import { Link } from "react-router-dom"; -const LogoutButton = ({onLogout}) => ( - - - +const LogoutButton = ({ onLogout }) => ( + + + ); LogoutButton.propTypes = { - onLogout: PropTypes.func.isRequired, + onLogout: PropTypes.func.isRequired }; export default LogoutButton; diff --git a/src/components/navigation/Navbar.js b/src/components/navigation/Navbar.js index 4981bb53..fa2516f5 100644 --- a/src/components/navigation/Navbar.js +++ b/src/components/navigation/Navbar.js @@ -1,7 +1,7 @@ import classNames from "classnames"; -import React from 'react'; -import {Link, withRouter} from "react-router-dom"; -import {userIsLoggedIn} from "../../auth/index"; +import React from "react"; +import { Link, withRouter } from "react-router-dom"; +import { userIsLoggedIn } from "../../auth/index"; import Login from "../../containers/auth/Login"; import Logout from "../../containers/auth/Logout"; import ProfileName from "../../containers/auth/ProfileName"; @@ -9,73 +9,83 @@ import "./Navbar.css"; export const NAVBAR_HEIGHT = 60; -export const NavItem = withRouter(props => ); -export const LoggedInSection = withRouter(props => ); +export const NavItem = withRouter(props => ); +export const LoggedInSection = withRouter(props => ( + +)); -const NavItemWithoutRoute = ({route, location, children}) => ( -
  • - {children} -
  • +const NavItemWithoutRoute = ({ route, location, children }) => ( +
  • + {children} +
  • ); -const LoggedInSectionWithoutRoute = ({location}) => ( -
      - {userIsLoggedIn() ? - [ - location.pathname === "/" ? - - - My Simulations - - : - - - - - , - - - - ] : - - - - } -
    - ) -; - -const Navbar = ({fullWidth, children}) => ( - ); export default Navbar; -- cgit v1.2.3