Skip to content

Commit 707426d

Browse files
committed
initial commit
0 parents  commit 707426d

38 files changed

+1354
-0
lines changed

.babelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"presets": ["es2015-native-modules", "react"],
3+
"plugins": ["transform-runtime"]
4+
}

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[*.js]
2+
indent_style=space
3+
indent_size=2

.eslintrc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
extends:
2+
eslint-config-airbnb
3+
4+
parser:
5+
babel-eslint
6+
7+
settings:
8+
ecmascript: 6
9+
10+
ecmaFeatures:
11+
jsx: true
12+
modules: true
13+
destructuring: true
14+
classes: true
15+
forOf: true
16+
blockBindings: true
17+
arrowFunctions: true
18+
19+
env:
20+
browser: true
21+
22+
rules:
23+
indent: 2
24+
func-style: 0
25+
func-names: 0
26+
comma-dangle: 0
27+
no-console: 0
28+
no-param-reassign: 0

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.DS_STORE
2+
node_modules
3+
static
4+
.module-cache
5+
*.log*
6+
coverage
7+
__nogit
8+
.idea

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# React Router Dynamic Route Loading w/ Webpack 2 Chunks
2+
3+
Webpack 2 automatically splits routes in chunks (small bundles) and loads them on demand.
4+
5+
## Contains
6+
7+
- [x] [Webpack 2](https://webpack.github.io)
8+
- [x] [React 0.15](https://facebook.github.io/react/)
9+
- [x] [Babel 6.5](https://babeljs.io/)
10+
11+
##System Requirements
12+
Before installing the dependencies, make sure your system has the correct Node and Npm versions, otherwise you will get errors.
13+
14+
- Node 5.x.x
15+
- Npm 3.x.x
16+
17+
## Setup
18+
19+
```
20+
$ npm install
21+
```
22+
23+
## Running
24+
25+
```
26+
$ npm start
27+
```
28+
29+
## Build
30+
31+
```
32+
$ npm run build
33+
```

build.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* eslint no-var: 0 */
2+
var exec = require('child_process').exec;
3+
4+
var cmdLine = './node_modules/.bin/webpack --progress';
5+
var environ = (!process.argv[2].indexOf('development')) ? 'development' : 'production';
6+
var command;
7+
8+
if (process.platform === 'win32') {
9+
cmdLine = 'set NODE_ENV=' + environ + '&& ' + cmdLine;
10+
} else {
11+
cmdLine = 'NODE_ENV=' + environ + ' ' + cmdLine;
12+
}
13+
14+
command = exec(cmdLine);
15+
16+
command.stdout.on('data', function(data) {
17+
process.stdout.write(data);
18+
});
19+
command.stderr.on('data', function(data) {
20+
process.stderr.write(data);
21+
});
22+
command.on('error', function(err) {
23+
process.stderr.write(err);
24+
});

client/_variables.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
$light: #e6e6e6;
2+
$dark: #4d4d4d;
3+
$white: #ffffff;
4+
$grey: #7d7d7d;
5+
$red: #ec3d2b;
6+
$blue: #113d92;
7+
$lightBlue: #258ce7;

client/actions/index.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
export const ADD_TRANSACTION = 'ADD_TRANSACTION';
2+
export const DELETE_TRANSACTION = 'DELETE_TRANSACTION';
3+
export const GET_TRANSACTION_GRID_FIELDS = 'GET_TRANSACTION_GRID_FIELDS';
4+
export const REQUEST_SUM = 'REQUEST_SUM';
5+
6+
function createTransaction(transaction) {
7+
return {
8+
type: ADD_TRANSACTION,
9+
transaction
10+
};
11+
}
12+
13+
export function deleteTransaction(id) {
14+
return {
15+
type: ADD_TRANSACTION,
16+
id
17+
};
18+
}
19+
20+
export function requestSum(data) {
21+
return {
22+
type: REQUEST_SUM,
23+
data
24+
};
25+
}
26+
27+
export function addTransaction(transaction) {
28+
return (dispatch, getState) => {
29+
const addedResult = dispatch(createTransaction(transaction));
30+
dispatch(requestSum(getState().transactions.transactions));
31+
return addedResult;
32+
};
33+
}

client/actions/navigation.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { menuSections } from 'data/menu.json';
2+
3+
export const RECEIVE_MENU_SECTIONS = 'RECEIVE_MENU_SECTIONS';
4+
export const TOGGLE_MENU = 'TOGGLE_MENU';
5+
export const SELECT_MENU_SECTION = 'SELECT_MENU_SECTION';
6+
7+
export function toggleMenu() {
8+
return (dispatch, getState) => dispatch({
9+
type: TOGGLE_MENU,
10+
menuVisible: !getState().navigation.menu.menuVisible
11+
});
12+
}
13+
14+
export function loadMenuData() {
15+
return dispatch => dispatch({
16+
type: RECEIVE_MENU_SECTIONS,
17+
menuSections
18+
});
19+
}
20+
21+
export function selectMenuSection(menuSection) {
22+
return dispatch => dispatch({
23+
type: SELECT_MENU_SECTION,
24+
menuSection
25+
});
26+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
@import "client/variables";
2+
3+
.header-container {
4+
background-color: $grey;
5+
padding: 10px;
6+
user-select: none;
7+
-webkit-user-select: none;
8+
9+
.header-title {
10+
color: $white;
11+
margin: 0;
12+
font-size: 1.4em;
13+
}
14+
15+
&.header-white {
16+
background-color: $white;
17+
.header-title {
18+
color: $dark;
19+
}
20+
}
21+
&.header-red {
22+
background-color: $red;
23+
}
24+
&.header-dark {
25+
background-color: $dark;
26+
}
27+
&.header-grey {
28+
background-color: $grey;
29+
}
30+
&.header-blue {
31+
background-color: $blue;
32+
}
33+
}

0 commit comments

Comments
 (0)