Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ build
.DS_Store
.env
npm-debug.log
*.swp
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"react": "^15.3.2",
"react-dom": "^15.3.2",
"react-redux": "^5.0.4",
"react-router-dom": "^4.1.1",
"react-router-dom": "^4.2.2",
"redux": "^3.6.0"
},
"scripts": {
Expand Down
39 changes: 29 additions & 10 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,40 @@
import React from "react";
import TopNav from "./components/TopNav";
import SideNav from "./components/SideNav";
import Charts from "./components/Charts";
import Tables from "./components/Tables";
import Settings from "./components/Settings";
import Wall from "./components/Wall";
import Profiles from "./components/Profiles";
import Marquee from "./components/Marquee";
import Profile from "./components/Profile";
import Dashboard from "./components/Dashboard";
import {BrowserRouter,Switch,Route} from 'react-router-dom';

function App() {
return (
<div>
<div id="wrapper">
<nav className="navbar navbar-inverse navbar-fixed-top" role="navigation">
<TopNav />
<SideNav />
</nav>
<div style={{backgroundColor: "white"}}>
{/* PUT YOUR ROUTES HERE */}
<BrowserRouter>
<div>
<div id="wrapper">
<nav className="navbar navbar-inverse navbar-fixed-top" role="navigation">
<TopNav />
<SideNav />
</nav>
<div style={{backgroundColor: "white"}}>
<Switch>
<Route path="/charts" component={Charts} />
<Route path="/tables" component={Tables} />
<Route path="/settings" component={Settings} />
<Route path="/wall" component={Wall} />
<Route path="/profiles" component={Profiles} />
<Route path="/marquee/:text" component={Marquee} />
<Route path="/profile/:id" component={Profile} />
<Route path="/" component={Dashboard} />
</Switch>
</div>
</div>
</div>
</div>

</BrowserRouter>
);
}

Expand Down
8 changes: 8 additions & 0 deletions src/components/Charts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';

export default function Charts() {
return (
<img src="http://xkcdsw.com/content/img/907.png"></img>
);
}

7 changes: 5 additions & 2 deletions src/components/Marquee.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import React from "react";

function Marquee(props) {
const message = "hello";
const message = props.match.params.text;
return (
<marquee>{message}</marquee>
<div>
<marquee>{message}</marquee>
<img src="https://imgs.xkcd.com/comics/home_organization.png"></img>
</div>
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import {connect} from "react-redux";

function Profile(props) {
const userId = 0;
const userId = props.match.params.id;
const user = props.users.find(u => u.id == userId) || {};
return (
<div>
Expand Down
3 changes: 2 additions & 1 deletion src/components/Profiles.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React from "react";
import {connect} from "react-redux";
import {Link} from "react-router-dom";

function Profiles(props) {
const userDivs = props.users.map((user,i) => {
return (
<div key={i}>
{user.firstName} - {user.lastName}
<a href="#"> View </a>
<Link to={`/profile/${user.id}`}> View </Link>
</div>);
});
return (
Expand Down
8 changes: 8 additions & 0 deletions src/components/Settings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';

export default function Settings() {
return (
<img src="https://imgs.xkcd.com/comics/christmas_settings.png"></img>
);
}

42 changes: 35 additions & 7 deletions src/components/SideNav.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,54 @@
import React from "react";
// import {Link} from "react-router-dom";
import {Link} from "react-router-dom";

function SideNav() {
return (
<div className="collapse navbar-collapse navbar-ex1-collapse">
<ul className="nav navbar-nav side-nav">
<li className="active">
{/*
<Link to="/"> <i className="fa fa-fw fa-dashboard" />
Dashboard
</Link>
*/}
</li>
<li>
<a href="charts.html">
<Link to="/charts">
<i className="fa fa-fw fa-bar-chart-o" /> Charts
</a>
</Link>
</li>
<li>
<a href="tables.html">
<Link to="/tables">
<i className="fa fa-fw fa-table" /> Tables
</a>
</Link>
</li>
<li>
<Link to="/settings">
<i className="fa fa-fw fa-cogs" /> Settings
</Link>
</li>
<li>
<Link to="/wall">
<i className="fa fa-fw fa-facebook" /> Wall
</Link>
</li>
<li>
<Link to="/profiles">
<i className="fa fa-fw fa-user" /> Profiles
</Link>
</li>
<li>
<Link to="/marquee/iloveroutes">
<i className="fa fa-fw fa-heart" /> iloveroutes
</Link>
</li>
<li>
<Link to="/marquee/reactrouterules">
<i className="fa fa-fw fa-road" /> reactrouterules
</Link>
</li>
<li>
<Link to="/marquee/poooooops">
<i className="fa fa-fw fa-fire" /> poooooops
</Link>
</li>
</ul>
</div>);
Expand Down
8 changes: 8 additions & 0 deletions src/components/Tables.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';

export default function Tables() {
return (
<img src="https://imgs.xkcd.com/comics/exploits_of_a_mom.png"></img>
);
}

8 changes: 8 additions & 0 deletions src/components/Wall.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';

export default function Wall() {
return (
<img src="https://imgs.xkcd.com/comics/contextbot.png"></img>
);
}