From b2a7351aef78c8faf6c3316bc49b4a53666bfeb2 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Fri, 3 Jul 2015 19:50:18 -0700 Subject: [PATCH] fix add missing nav links refactor into json --- common/app/components/Nav/Nav.jsx | 49 ++++++++++++++-------------- common/app/components/Nav/links.json | 16 +++++++++ 2 files changed, 40 insertions(+), 25 deletions(-) create mode 100644 common/app/components/Nav/links.json diff --git a/common/app/components/Nav/Nav.jsx b/common/app/components/Nav/Nav.jsx index fdab686399..f35a8442ae 100644 --- a/common/app/components/Nav/Nav.jsx +++ b/common/app/components/Nav/Nav.jsx @@ -1,7 +1,29 @@ import React from 'react'; import { Nav, Navbar, NavItem } from 'react-bootstrap'; + +import navLinks from './links.json'; import FCCNavItem from './NavItem.jsx'; +const fCClogo = 'https://s3.amazonaws.com/freecodecamp/freecodecamp_logo.svg'; +const navElements = navLinks.map((navItem, index) => { + return ( + + { navItem.content } + + ); +}); + +const logoElement = ( + + learn to code javascript at Free Code Camp logo + +); + export default class extends React.Component { constructor(props) { super(props); @@ -13,15 +35,6 @@ export default class extends React.Component { } renderBrand() { - var fCClogo = 'https://s3.amazonaws.com/freecodecamp/freecodecamp_logo.svg'; - return ( - - learn to code javascript at Free Code Camp logo - - ); } renderSignin() { @@ -47,7 +60,7 @@ export default class extends React.Component { render() { return ( @@ -55,21 +68,7 @@ export default class extends React.Component { className='hamburger-dropdown' eventKey={ 0 } right={ true }> - - Challenges - - - Chat - - - Bonfires - + { navElements } { this.renderSignin() } diff --git a/common/app/components/Nav/links.json b/common/app/components/Nav/links.json new file mode 100644 index 0000000000..269a0aad4e --- /dev/null +++ b/common/app/components/Nav/links.json @@ -0,0 +1,16 @@ +[{ + "content": "Map", + "link": "/map" +}, { + "content": "Chat", + "link": "//gitter.im/FreeCodeCamp/FreeCodeCamp" +},{ + "content": "News", + "link": "/news" +},{ + "content": "Guide", + "link": "/field-guide" +},{ + "content": "Jobs", + "link": "/jobs" +}]