Skip to content

Commit e405a93

Browse files
Updated to add navigation and documentation with syntax highlighting
1 parent 8aba4fb commit e405a93

25 files changed

+521
-172
lines changed

adding-new-infrastructure

Whitespace-only changes.

package-lock.json

Lines changed: 51 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
"history": "^4.7.2",
88
"localStorage": "^1.0.4",
99
"lodash": "^4.17.11",
10+
"marked": "^0.6.1",
11+
"prismjs": "^1.16.0",
1012
"react": "^16.8.4",
1113
"react-dom": "^16.8.4",
1214
"react-redux": "^6.0.1",

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Provider } from "react-redux";
44
import createHistory from "history/createBrowserHistory";
55
import "./index.css";
66
import rootReducer from "./modules/rootReducer";
7-
import * as serviceWorker from './serviceWorker';
7+
import * as serviceWorker from "./serviceWorker";
88
import { createStore } from "./modules/store";
99
import app from "./modules/app";
1010

src/modules/app/components/App.js

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { Component } from "react";
22
import { connect } from "react-redux";
3-
import { Router, Route, Link } from "react-router-dom";
4-
// import { ConnectedRouter } from "react-router-redux";
3+
import { Router, Route } from "react-router-dom";
54
import { OnUpdate } from "rrc";
65
import userContext from "../../userContext";
76
import home from "../../../screens/home";
@@ -11,16 +10,25 @@ import authenticated from "../../../screens/authenticated";
1110
import wizardExample from "../../../screens/wizardExample";
1211
import busyIndicator from "../../busyIndicator";
1312
import notificationPopup from "../../notificationPopup";
13+
import "./app.css";
14+
import navBar from "../../navBar";
1415

15-
const { getUserContext } = userContext.selectors;
1616
const { BusyIndicator } = busyIndicator.components;
1717
const { Home } = home.components;
1818
const { SignIn } = signin.components;
1919
const { Protected } = protectedRoute.components;
2020
const { Authenticated } = authenticated.components;
2121
const { WizardExample } = wizardExample.components;
22-
const { isBusy } = busyIndicator.selectors;
2322
const { NotificationPopup } = notificationPopup.components;
23+
const {
24+
selectors: { getUserContext }
25+
} = userContext;
26+
const {
27+
selectors: { isBusy }
28+
} = busyIndicator;
29+
const {
30+
components: { NavBar, MenuItem }
31+
} = navBar;
2432

2533
class App extends Component {
2634
render() {
@@ -29,25 +37,13 @@ class App extends Component {
2937
return (
3038
<Router history={history}>
3139
<div>
32-
<header>
33-
<ul>
34-
<li>
35-
<Link to="/">Home</Link>
36-
</li>
37-
<li>
38-
<Link to="/authenticated">Authenticated</Link>
39-
</li>
40-
<li>
41-
<Link to="/protected">Protected</Link>
42-
</li>
43-
<li>
44-
<Link to="/wizard-example">Wizard Example</Link>
45-
</li>
46-
<li>
47-
<Link to="/sign-in">Sign In</Link>
48-
</li>
49-
</ul>
50-
</header>
40+
<NavBar>
41+
<MenuItem to="/">Home</MenuItem>
42+
<MenuItem to="/authenticated">Authenticated</MenuItem>
43+
<MenuItem to="/protected">Protected</MenuItem>
44+
<MenuItem to="/wizard-example">Wizard Example</MenuItem>
45+
<MenuItem to="/sign-in">Sign In</MenuItem>
46+
</NavBar>
5147
<div className="App-intro">
5248
<NotificationPopup />
5349
{isBusy ? (

src/modules/app/components/app.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.app-button {
2+
background-color: #4CAF50; /* Green */
3+
border: none;
4+
color: white;
5+
padding: 16px 32px;
6+
text-align: center;
7+
text-decoration: none;
8+
display: inline-block;
9+
font-size: 16px;
10+
margin: 4px 2px;
11+
-webkit-transition-duration: 0.4s; /* Safari */
12+
transition-duration: 0.4s;
13+
cursor: pointer;
14+
margin-bottom: 5px;
15+
}
16+
17+
.app-button:hover {
18+
background-color: white;
19+
color: black;
20+
border: 2px solid #4CAF50;
21+
}
22+
23+
.active {
24+
background-color: #4CAF50;
25+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from "react";
2+
import { Link } from "react-router-dom";
3+
import { withRouter } from "react-router-dom";
4+
import classNames from "classnames";
5+
6+
const MenuItem = withRouter(({ to, children, location }) => (
7+
<li className={classNames({ active: to === location.pathname })}>
8+
<Link to={to}>{children}</Link>
9+
</li>
10+
));
11+
12+
export default MenuItem;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from "react";
2+
import "./navBar.css";
3+
4+
const NavBar = ({ children }) => (
5+
<header>
6+
<ul>{children}</ul>
7+
</header>
8+
);
9+
10+
export default NavBar;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import MenuItem from "./MenuItem";
2+
import NavBar from "./NavBar";
3+
4+
export default {
5+
MenuItem,
6+
NavBar
7+
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
header ul {
2+
list-style-type: none;
3+
margin: 0;
4+
padding: 0;
5+
overflow: hidden;
6+
background-color: #333;
7+
}
8+
9+
header li {
10+
float: left;
11+
}
12+
13+
header li a {
14+
display: block;
15+
color: white;
16+
text-align: center;
17+
padding: 14px 16px;
18+
text-decoration: none;
19+
}
20+
21+
header li a:hover:not(.active) {
22+
background-color: #111;
23+
}

0 commit comments

Comments
 (0)