Skip to content

Commit 4abb290

Browse files
committed
1.0.0
1 parent 839447d commit 4abb290

File tree

473 files changed

+101024
-838
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

473 files changed

+101024
-838
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["es2015", "react", "stage-0"]
3+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Created by .ignore support plugin (hsz.mobi)

.idea/dictionaries/grzegorzkroczek.xml

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

.idea/inspectionProfiles/Project_Default.xml

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

.idea/jsLibraryMappings.xml

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

.idea/misc.xml

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

.idea/modules.xml

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

.idea/total.js-react.js-server-render-side.iml

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

.idea/vcs.xml

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

.idea/workspace.xml

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

README.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,35 @@
22

33
## Installation
44

5-
1. Install the all necesary modules and packages in project directory
5+
1. Install babel and react packages
6+
7+
```
8+
npm i --save react react-dom react-router babel-register
9+
npm i --save-dev babel-cli babel-core babel-preset-es2015 babel-preset-react babel-preset-stage-0 webpack babel-loader
10+
```
11+
12+
13+
2. Install the all necesary modules and packages in project directory
614

715
```
816
npm install
917
```
1018

11-
2. Install babel-node package
1219

20+
21+
22+
3. Start the server from the root directory of project
23+
24+
1325
```
14-
npm install babel-node -g
26+
node server.js
1527
```
1628

17-
4. run webpack for React.js and Auth0 in /client. Bundled files will be copied to /public directory
29+
4. Visit http://localhost:8000
1830

19-
```
20-
npm run webpack
21-
```
31+
32+
2233

23-
5. Start the server from the root directory of project
2434

25-
```
26-
babel-node server.js
27-
```
2835

29-
6. Visit http://localhost:8000
3036

client/.babelrc

Lines changed: 0 additions & 8 deletions
This file was deleted.

client/.env

Lines changed: 0 additions & 2 deletions
This file was deleted.

client/README.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

client/commanders.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"use strict";
2+
3+
module.exports = {
4+
5+
'g-j-c': {
6+
'name': 'Gaius Iulius Caesar',
7+
'battles': [
8+
'Battle of Alesia',
9+
'Battle of Alesia',
10+
'Battle of Gergovia',
11+
'Battle of the Nile'
12+
13+
]
14+
},
15+
16+
'n-b': {
17+
'name': 'Napoleon Bonaparte',
18+
'battles': [
19+
'Marengo',
20+
'Austerlitz',
21+
'Jena',
22+
'Smolensk',
23+
'Lipsk',
24+
'Borodino',
25+
'Waterloo'
26+
]
27+
}
28+
};

client/components/commanderPage.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"use strict";
2+
3+
const React = require('react');
4+
const Link = require('react-router').Link;
5+
const Commanders = require('../commanders');
6+
7+
class CommanderPage extends React.Component {
8+
render() {
9+
let commander = Commanders[this.props.params.id];
10+
return (
11+
<div>
12+
<h2>{commander.name}'s major battles</h2>
13+
<ul className="battles">{
14+
commander.battles.map( (battle, key) =>
15+
<li key={key} className="battle">{battle}</li>
16+
)
17+
}</ul>
18+
<Link to="/">Go back to index</Link>
19+
</div>
20+
);
21+
}
22+
}
23+
24+
module.exports = CommanderPage;

client/components/commandersIndex.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"use strict";
2+
3+
const React = require('react');
4+
const Link = require('react-router').Link;
5+
const Commanders = require('../commanders');
6+
7+
class CommandersIndex extends React.Component {
8+
render() {
9+
return (
10+
<div cen>
11+
<h1>The famous commanders</h1>
12+
<ul>{
13+
Object.keys(Commanders).map(id =>
14+
<li key={id}><Link to={`/commander/${id}`}>{Commanders[id].name}</Link></li>
15+
)
16+
}</ul>
17+
</div>
18+
)
19+
}
20+
}
21+
22+
module.exports = CommandersIndex;
File renamed without changes.
File renamed without changes.

client/package.json

Lines changed: 0 additions & 57 deletions
This file was deleted.

client/public/favicon.ico

-24.3 KB
Binary file not shown.

client/public/index.html

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
var React = require('react');
22
var RoutingContext = require('react-router').RoutingContext;
3-
module.exports = (renderProps) => <RoutingContext {renderProps} />;
3+
module.exports = (renderProps) => <RoutingContext {...renderProps} />;
File renamed without changes.

client/routesConfig.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"use strict";
2+
3+
const CommandersIndex = require('./components/commandersIndex');
4+
const CommanderPage = require('./components/commanderPage');
5+
const NotFound = require('./components/notFound');
6+
7+
const routesConfig = [
8+
{path: '/', component: CommandersIndex},
9+
{path: '/commander/:id', component: CommanderPage},
10+
{path: '*', component: NotFound}
11+
];
12+
13+
module.exports = routesConfig;

0 commit comments

Comments
 (0)