Skip to content
This repository has been archived by the owner on Jun 28, 2020. It is now read-only.

Features/navbar skeleton 73 #14

Merged
merged 14 commits into from
Jan 31, 2018
Merged

Conversation

djarredon
Copy link
Collaborator

Added in a navigation bar including empty links to all planned pages:

  • Sign in
  • Sign out
  • Profile view
  • Edit profile
  • Admin view
  • About page


<main>
<Route exact path="/" component={Home} />
<Route exact path="/about-us" component={About} />
<Route exact path="/navbar" component={Navbar} />
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove line, we don't need a route for the navbar

<Link to="/">Home</Link>
<Link to="/about-us">About</Link>
</header>
<Navbar />
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation

@@ -1,7 +1,9 @@
import React, { Component } from 'react';
import { Route, Link } from 'react-router-dom'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove Link from import as it's not being used anymore

<button onClick={() => changePage()}>Go to about page via redux</button>
</div>
)
}

const mapStateToProps = state => {
return {
message: state.app.example.message
//message: state.app.example.message
message: state.navbar
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this back to original state, just so we don't have unnecessary file changes

"About"
*/
export default () => (
<div>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this wrapping div

<FlatButton
href="/"
label="MESA"
/>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add this to the line above
like:

<FlatButton
  href="/"
  label="MESA" />


<main>
<Route exact path="/" component={Home} />
<Route exact path="/about-us" component={About} />
<Route exact path="/navbar" component={Navbar} />
<Route exact path="/demo" component={Demo} />
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove line

@@ -3,21 +3,24 @@ import { push } from 'react-router-redux'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'


Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove line

const Home = props => {
const { changePage, message } = props

return (
<div>
<h1>Home</h1>
<p>{message}</p>

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove line

</Toolbar>
</header>
</div>
);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove ';'

<MenuItem
              containerElement={<Link to="/about" />}
              value="about"
              primaryText="About" />

For the links to work correctly we need to wrap them in our router Link component. If we don't do this then the server makes a roundtrip and reloads the page with the new route. With this in place the browser doesn't need to refresh see: mui/material-ui#204

@@ -21,6 +26,7 @@
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"toolbox": "react-toolbox-themr"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove anything eject and react-toolbox related
afterwards be sure to run 'yarn' on the command line to update the yarn.lock file

import Home from '../home'
import About from '../about'
import Navbar from '../navbar'
import Demo from '../demo'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove line

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to include deleting "import Navbar ..." ?

@@ -0,0 +1,80 @@
import React from 'react'
import { Route, Link } from 'react-router-dom'
import About from '../about'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove line, unnecessary import

@@ -0,0 +1,80 @@
import React from 'react'
import { Route, Link } from 'react-router-dom'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove route from import, it isn't being used

import RaisedButton from 'material-ui/RaisedButton'
import FlatButton from 'material-ui/FlatButton'
import Divider from 'material-ui/Divider'
import TextField from 'material-ui/TextField'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can replace all those import statements with this:

import {
  IconMenu,
  IconButton,
  MenuItem,
  RaisedButton,
  FlatButton,
  Divider,
  TextField
} from 'material-ui'

@iandusenbury iandusenbury merged commit eba7215 into development Jan 31, 2018
@iandusenbury iandusenbury deleted the features/appbar_skeleton_73 branch January 31, 2018 19:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants