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
42 changes: 32 additions & 10 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,42 @@
import React from "react";
import TopNav from "./components/TopNav";
import SideNav from "./components/SideNav";
import TopNav from "./components/TopNav";
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, Route, Switch} 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" }}>
{/* 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>
</div>
</div>
</BrowserRouter>

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

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

export default Charts;
6 changes: 3 additions & 3 deletions src/components/Marquee.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from "react";

function Marquee(props) {
const message = "hello";
return (
<marquee>{message}</marquee>
const message = props.match.params.text;
return (
<marquee>{message}</marquee>
);
}

Expand Down
5 changes: 2 additions & 3 deletions src/components/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ 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 (
return (
<div>
<h3>{user.firstName} {user.lastName}</h3>
<h4>{user.occupation}</h4>
Expand All @@ -18,4 +18,3 @@ function Profile(props) {
export default connect(function (state) {
return {users: state.users};
})(Profile);

7 changes: 3 additions & 4 deletions src/components/Profiles.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
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 (
return (
<div>{userDivs}</div>
);
}

export default connect(function (state) {
return {users: state.users};
})(Profiles);


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

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

export default Settings;
57 changes: 44 additions & 13 deletions src/components/SideNav.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,60 @@
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
Dashboard
</Link>
*/}
</li>
<li>
<a href="charts.html">
<i className="fa fa-fw fa-bar-chart-o" /> Charts
</a>

</li>
<li>
<a href="tables.html">
<i className="fa fa-fw fa-table" /> Tables
</a>
</li>
<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>
<Link to="/profiles">
<i className="fa fa-fw fa-table" /> Profiles
</Link>
</li>
<li>
<Link to="/marquee/iloveroutes"> <i className="fa fa-fw fa-table" />
I love routes!
</Link>
</li>
<li>
<Link to="/marquee/reactrouterules"> <i className="fa fa-fw fa-table" />
React Route!
</Link>
</li>
<li>
<Link to="/marquee/anothermarqueemessage"> <i className="fa fa-fw fa-table" />
Marquee Extra Msg
</Link>
</li>
</ul>
</div>);
</div>);
}

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

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

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

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

export default Wall;
54 changes: 30 additions & 24 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2606,24 +2606,28 @@ [email protected]:
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"

[email protected]:
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 @@ [email protected]:
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"

[email protected], [email protected]:
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