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
26 changes: 24 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,43 @@
import React from "react";
import TopNav from "./components/TopNav";
import SideNav from "./components/SideNav";
import {BrowserRouter,Route,Switch} from "react-router-dom";
import Charts from "./components/Charts";
import Tables from "./components/Tables";
import Settings from "./components/Settings";
import Wall from "./components/Wall";
import Marquee from "./components/Marquee";
import Profile from "./components/Profile";
import Dashboard from "./components/Dashboard";
import Profiles from "./components/Profiles";

function App() {
return (
<div>
<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>

</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";

function Charts(){
return(
<div>this is for the charts</div>
)
}
export default Charts;
5 changes: 3 additions & 2 deletions src/components/Marquee.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from "react";
// import {Link} from "react-router-dom";

function Marquee(props) {
const message = "hello";
return (
const message = props.match.params.text;
return (
<marquee>{message}</marquee>
);
}
Expand Down
8 changes: 4 additions & 4 deletions src/components/Profile.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from "react";
import {connect} from "react-redux";
// import {Link} from "react-router-dom";

function Profile(props) {
const userId = 0;
const user = props.users.find(u => u.id == userId) || {};
return (
const userId = props.match.params.id;
const user = props.users.find(u => u.id === userId) || {};
return (
<div>
<h3>{user.firstName} {user.lastName}</h3>
<h4>{user.occupation}</h4>
Expand All @@ -18,4 +19,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 rel="/profile/ + {user.id}"> View </link>
</div>);
});
return (
return (
<div>{userDivs}</div>
);
}

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


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";

function Settings(){
return(
<div>this is for the settings</div>
)
}
export default Settings;
48 changes: 36 additions & 12 deletions src/components/SideNav.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,53 @@
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 to="/"> <i className="fa fa-fw fa-dashboard" />
Dashboard
</Link>
*/}

</li>
<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-settings" />
Settings
</Link>

</li>
<li>
<Link to="/wall/"> <i className="fa fa-fw fa-wall" />
Wall
</Link>

</li>
<li>
<a href="charts.html">
<i className="fa fa-fw fa-bar-chart-o" /> Charts
</a>
<Link to="/marquee/iLoveRoutes"> <i className="fa fa-fw fa-wall" />
Marquee
</Link>
</li>
<li>
<a href="tables.html">
<i className="fa fa-fw fa-table" /> Tables
</a>
<Link to="/marquee/reactRouterRules"> <i className="fa fa-fw fa-wall" />
Marquee
</Link>
</li>
</ul>
</div>);
</div>);
}

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

function Tables(){
return(
<div>this is for the tables</div>
)
}

export default Tables;
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";

function Wall(){
return(
<div>this is for the 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