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
28 changes: 26 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,43 @@
import React from "react";
import TopNav from "./components/TopNav";
import SideNav from "./components/SideNav";
import Dashboard from "./components/Dashboard";
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 {
BrowserRouter as Router,
Route,
Switch
} from "react-router-dom";

function App() {
return (
<div>
<div>
<Router>
<div id="wrapper">
<nav className="navbar navbar-inverse navbar-fixed-top" role="navigation">
<TopNav />
<SideNav />
</nav>
<div style={{backgroundColor: "white"}}>
{/* PUT YOUR ROUTES HERE */}
<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>
</Router>
</div>

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

function Charts() {
return (
<div>
Charts
</div>
);
}

export default Charts;
2 changes: 1 addition & 1 deletion src/components/Marquee.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";

function Marquee(props) {
const message = "hello";
const message = props.match.params.text;
return (
<marquee>{message}</marquee>
);
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
11 changes: 11 additions & 0 deletions src/components/Settings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from "react";

function Settings() {
return (
<div>
Settings
</div>
);
}

export default Settings;
38 changes: 31 additions & 7 deletions src/components/SideNav.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,50 @@
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-bar-chart-o" /> Settings
</Link>
</li>
<li>
<Link to="/wall">
<i className="fa fa-fw fa-table" /> Wall
</Link>
</li>
<li>
<Link to="/profiles">
<i className="fa fa-fw fa-bar-chart-o" /> Profiles
</Link>
</li>
<li>
<Link to="/marquee/iloveroutes">
<i className="fa fa-fw fa-table" /> Marquee I love routes
</Link>
</li>
<li>
<Link to="/marquee/reactroutesrule">
<i className="fa fa-fw fa-table" /> Marquee Routes Rule
</Link>
</li>
</ul>
</div>);
Expand Down
11 changes: 11 additions & 0 deletions src/components/Tables.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from "react";

function Tables() {
return (
<div>
Tables
</div>
);
}

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

function Wall() {
return (
<div>
Wall
</div>
);
}

export default Wall;