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
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
58 changes: 48 additions & 10 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,59 @@
import React from "react";
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 TopNav from "./components/TopNav";
import SideNav from "./components/SideNav";
import Dashboard from "./components/Dashboard";
import Profile from "./components/Profile";


import {
BrowserRouter,
Route,
Switch
} from "react-router-dom";

function App() {
// ### Routes
// * / -> Dashboard
// * /charts -> Charts
// * /tables -> Tables
// * /settings -> Settings
// * /wall -> Wall
// * /profiles -> Profiles
// * /marquee/:text -> Marquee
// * /profile/:id -> Profile

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="/wall" component={Wall} />
<Route path="/profile/:id" component={Profile} />
<Route path="/" component={Dashboard} />
</Switch>

{/* PUT YOUR ROUTES HERE */}
</div>
</div>
</div>
</div>

</BrowserRouter>
);
}

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

export default function Charts() {
return <div> CHARTS!! </div>;
}
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
5 changes: 5 additions & 0 deletions src/components/Settings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from "react";

export default function Settings() {
return <div> SETTINGS!! </div>;
}
56 changes: 47 additions & 9 deletions src/components/SideNav.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,64 @@
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">
<i className="fa fa-fw fa-bar-chart-o" /> Charts
</a>
<Link to="/charts">
<i className="fa fa-fw fa-bar-chart-o" />
Charts
</Link>
</li>
<li>
<Link to="/tables">
<i className="fa fa-fw fa-table" />
Tables
</Link>
</li>
<li>
<Link to="/settings">
<i className="fa fa-fw fa-table" />
Settings
</Link>
</li>
<li>
<Link to="/wall">
<i className="fa fa-fw fa-table" />
Wall
</Link>
</li>
<li>
<a href="tables.html">
<i className="fa fa-fw fa-table" /> Tables
</a>
<Link to="/profiles">
<i className="fa fa-fw fa-table" />
Profiles
</Link>
</li>
<li>
<Link to="/marquee">
<i className="fa fa-fw fa-table" />
Marquee
</Link>
</li>
<li>
<Link to="/marquee/iloveroutes">
<i className="fa fa-fw fa-table" />
I LOOOOVE Routes!
</Link>
</li>
<li>
<Link to="/marquee/reactrouterrules">
<i className="fa fa-fw fa-table" />
React Router Rules
</Link>
</li>
</ul>
</div>);
Expand Down
5 changes: 5 additions & 0 deletions src/components/Tables.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from "react";

export default function Tables() {
return <div> TABLES!! </div>;
}
5 changes: 5 additions & 0 deletions src/components/Wall.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from "react";

export default function Wall() {
return <div> WALL!! </div>;
}
54 changes: 30 additions & 24 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2606,24 +2606,28 @@ he@1.1.x:
version "1.1.0"
resolved "https://registry.yarnpkg.com/he/-/he-1.1.0.tgz#29319d49beec13a9b1f3c4f9b2a6dde4859bb2a7"

history@^4.5.1, history@^4.6.0:
version "4.6.1"
resolved "https://registry.yarnpkg.com/history/-/history-4.6.1.tgz#911cf8eb65728555a94f2b12780a0c531a14d2fd"
history@^4.7.2:
version "4.7.2"
resolved "https://registry.yarnpkg.com/history/-/history-4.7.2.tgz#22b5c7f31633c5b8021c7f4a8a954ac139ee8d5b"
dependencies:
invariant "^2.2.1"
loose-envify "^1.2.0"
resolve-pathname "^2.0.0"
value-equal "^0.2.0"
resolve-pathname "^2.2.0"
value-equal "^0.4.0"
warning "^3.0.0"

hoek@2.x.x:
version "2.16.3"
resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed"

hoist-non-react-statics@^1.0.3, hoist-non-react-statics@^1.2.0:
hoist-non-react-statics@^1.0.3:
version "1.2.0"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-1.2.0.tgz#aa448cf0986d55cc40773b17174b7dd066cb7cfb"

hoist-non-react-statics@^2.3.0:
version "2.3.1"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.3.1.tgz#343db84c6018c650778898240135a1420ee22ce0"

home-or-tmp@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8"
Expand Down Expand Up @@ -4194,7 +4198,7 @@ path-to-regexp@0.1.7:
version "0.1.7"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"

path-to-regexp@^1.5.3:
path-to-regexp@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.7.0.tgz#59fde0f435badacba103a84e9d3bc64e96b9937d"
dependencies:
Expand Down Expand Up @@ -4678,24 +4682,26 @@ react-redux@^5.0.4:
loose-envify "^1.1.0"
prop-types "^15.0.0"

react-router-dom@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.1.1.tgz#3021ade1f2c160af97cf94e25594c5f294583025"
react-router-dom@^4.2.2:
version "4.2.2"
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.2.2.tgz#c8a81df3adc58bba8a76782e946cbd4eae649b8d"
dependencies:
history "^4.5.1"
history "^4.7.2"
invariant "^2.2.2"
loose-envify "^1.3.1"
prop-types "^15.5.4"
react-router "^4.1.1"
react-router "^4.2.0"
warning "^3.0.0"

react-router@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/react-router/-/react-router-4.1.1.tgz#d448f3b7c1b429a6fbb03395099949c606b1fe95"
react-router@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/react-router/-/react-router-4.2.0.tgz#61f7b3e3770daeb24062dae3eedef1b054155986"
dependencies:
history "^4.6.0"
hoist-non-react-statics "^1.2.0"
history "^4.7.2"
hoist-non-react-statics "^2.3.0"
invariant "^2.2.2"
loose-envify "^1.3.1"
path-to-regexp "^1.5.3"
path-to-regexp "^1.7.0"
prop-types "^15.5.4"
warning "^3.0.0"

Expand Down Expand Up @@ -5021,9 +5027,9 @@ resolve-from@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226"

resolve-pathname@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-2.1.0.tgz#e8358801b86b83b17560d4e3c382d7aef2100944"
resolve-pathname@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-2.2.0.tgz#7e9ae21ed815fd63ab189adeee64dc831eefa879"

resolve@1.1.7, resolve@1.1.x:
version "1.1.7"
Expand Down Expand Up @@ -5685,9 +5691,9 @@ validate-npm-package-license@^3.0.1:
spdx-correct "~1.0.0"
spdx-expression-parse "~1.0.0"

value-equal@^0.2.0:
version "0.2.1"
resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-0.2.1.tgz#c220a304361fce6994dbbedaa3c7e1a1b895871d"
value-equal@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-0.4.0.tgz#c5bdd2f54ee093c04839d71ce2e4758a6890abc7"

vary@^1, vary@~1.1.0:
version "1.1.0"
Expand Down