├── .babelrc
├── .gitignore
├── LICENSE
├── README.md
├── components
├── App.jsx
├── Bar.jsx
├── Foo.jsx
├── Footer.jsx
├── Header.jsx
└── index.js
├── dist
└── .gitignore
├── example
├── images
│ ├── bar.gif
│ ├── download.png
│ └── foo-fighters-logo.png
├── server.es6.js
├── server.js
└── views
│ └── index.handlebars
├── index.jsx
├── package.json
├── reducers.js
└── root.jsx
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [ "es2015", "react" ]
3 | }
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 |
5 | # Runtime data
6 | pids
7 | *.pid
8 | *.seed
9 |
10 | # Directory for instrumented libs generated by jscoverage/JSCover
11 | lib-cov
12 |
13 | # Coverage directory used by tools like istanbul
14 | coverage
15 |
16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17 | .grunt
18 |
19 | # node-waf configuration
20 | .lock-wscript
21 |
22 | # Compiled binary addons (http://nodejs.org/api/addons.html)
23 | build/Release
24 |
25 | # Dependency directory
26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
27 | node_modules
28 | dist
29 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Johnathan Free Wortley
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # redux-simple-router-example
2 | This is a simple example of how to use redux-simple-router.
3 | Feel free to critique this via opening an issue or sending a PR.
4 |
5 | 
6 |
7 | [Live Example](http://freeqaz.github.io/redux-simple-router-example/)
8 |
9 | To run this, simply `git clone` the repo and then run:
10 |
11 | ```shell
12 | npm install
13 | npm run example
14 | # Navigate to localhost:9001 to check it out!
15 | ```
16 |
17 | Thanks!
18 |
--------------------------------------------------------------------------------
/components/App.jsx:
--------------------------------------------------------------------------------
1 | import React, {Component} from 'react';
2 | import {Header, Footer} from './index';
3 |
4 | class App extends Component {
5 |
6 | render() {
7 | const { header, content, footer } = this.props;
8 |
9 | const devToolsDisabled = (
10 |
11 | Enable Dev Tools by setting ?devTools=true. Or click here!
12 |
13 | );
14 | const devToolsEnabled = (
15 |
16 | Check out the state changes in the sidebar when you navigate anywhere!
17 |
18 | Click here to disable.
19 |
20 | );
21 |
22 | const defaultContent = (
23 |
24 |
25 |
26 | This is a simple example of how to use redux-simple-router.
27 |
28 | Please click the links at the top and check out the source!
29 |