Skip to content

Commit 9a147cd

Browse files
committed
setup redux files and installed material ui
1 parent 068a193 commit 9a147cd

File tree

9 files changed

+61
-5
lines changed

9 files changed

+61
-5
lines changed

package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,21 @@
44
"description": "Boilerplate for React apps",
55
"main": "src/main.js",
66
"scripts": {
7-
"start": "webpack-dev-server --mode development --open --hot",
7+
"start": "webpack --mode development --watch --hot",
88
"build": "webpack --mode production",
99
"electron": "electron ."
1010
},
1111
"author": "Brad Traversy",
1212
"license": "MIT",
1313
"dependencies": {
14+
"@material-ui/core": "^1.4.1",
1415
"react": "^16.2.0",
1516
"react-dom": "^16.2.0",
16-
"react-rnd": "^8.0.2"
17+
"react-redux": "^5.0.7",
18+
"react-rnd": "^8.0.2",
19+
"redux": "^4.0.0",
20+
"redux-devtools-extension": "^2.13.5",
21+
"redux-thunk": "^2.3.0"
1722
},
1823
"devDependencies": {
1924
"babel-core": "^6.26.0",
@@ -28,4 +33,4 @@
2833
"webpack-cli": "^2.0.13",
2934
"webpack-dev-server": "^3.1.1"
3035
}
31-
}
36+
}

src/actionTypes/actionTypes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// exportconst ADD_COMPONENT = 'ADD_COMPONENT';

src/actions/components.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import * as types from '../constants/actionTypes.js';

src/components/App.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import React, { Component } from 'react';
22
import Rnd from 'react-rnd';
3+
import Paper from '@material-ui/core/Paper';
4+
import Grid from '@material-ui/core/Grid';
35
import '../style.css';
46

57

@@ -13,7 +15,18 @@ class App extends Component {
1315
};
1416
return (
1517
<div>
16-
<h1>My react app</h1>
18+
<Grid container spacing={0}>
19+
<Grid item xs={3}>
20+
<Paper>xs=3</Paper>
21+
</Grid>
22+
<Grid item xs={6}>
23+
<Paper>asdfas=6</Paper>
24+
</Grid>
25+
<Grid item xs={3}>
26+
<Paper>f=3</Paper>
27+
</Grid>
28+
</Grid>
29+
<h1>My react grapple</h1>
1730
</div>
1831
);
1932
}

src/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<meta http-equiv="X-UA-Compatible" content="ie=edge">
8+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500">
9+
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
10+
811
<title>My React App</title>
912
</head>
1013

src/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
33
import App from './components/App';
4+
import { Provider } from 'react-redux';
5+
import store from './store';
46
import './style.css';
57

6-
ReactDOM.render(<App />, document.getElementById('app'));
8+
ReactDOM.render(
9+
<Provider store={store}>
10+
<App />
11+
</Provider>,
12+
document.getElementById('app'));

src/reducers/componentReducer.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import * as types from '../constants/actionTypes';
2+
3+
export default (state = [], action) => {
4+
let componets;
5+
6+
switch(action.type) {
7+
default:
8+
return state;
9+
}
10+
};

src/reducers/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { combineReducers } from 'redux';
2+
3+
import componentReducer from './componentReducer.js';
4+
5+
const reducers = combineReducers({
6+
components: componentReducer
7+
})
8+
9+
export default reducers;

src/store.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { createStore, applyMiddleware } from 'redux';
2+
import { composeWithDevTools } from 'redux-devtools-extension';
3+
4+
const store = createStore(
5+
reducers,
6+
)
7+
8+
export default store;

0 commit comments

Comments
 (0)