Skip to content

Commit 7ea8ea6

Browse files
committed
Created containers for columns of main application
1 parent 9a147cd commit 7ea8ea6

File tree

9 files changed

+66
-20
lines changed

9 files changed

+66
-20
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Boilerplate for React apps",
55
"main": "src/main.js",
66
"scripts": {
7-
"start": "webpack --mode development --watch --hot",
7+
"start": "webpack --mode development --watch",
88
"build": "webpack --mode production",
99
"electron": "electron ."
1010
},

src/components/App.js

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
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';
3+
import LeftContainer from '../containers/LeftContainer';
4+
import MainContainer from '../containers/MainContainer';
5+
import RightContainer from '../containers/RightContainer';
6+
7+
// import Paper from '@material-ui/core/Paper';
8+
// import Grid from '@material-ui/core/Grid';
59
import '../style.css';
610

711

812
class App extends Component {
13+
914
render() {
1015
const style = {
1116
display: 'flex',
@@ -14,19 +19,10 @@ class App extends Component {
1419
border: 'solid 2px green',
1520
};
1621
return (
17-
<div>
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>
22+
<div className="app-container">
23+
<LeftContainer />
24+
<MainContainer />
25+
<RightContainer />
3026
</div>
3127
);
3228
}

src/containers/LeftContainer.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React, { Component } from 'react'
2+
3+
export default class LeftContainer extends Component {
4+
render() {
5+
return (
6+
<div className="column">
7+
Left Container
8+
</div>
9+
)
10+
}
11+
}

src/containers/MainContainer.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React, { Component } from 'react'
2+
3+
export default class MainContainer extends Component {
4+
render() {
5+
return (
6+
<div className="main">
7+
Main Column
8+
</div>
9+
)
10+
}
11+
}

src/containers/RightContainer.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React, { Component } from 'react'
2+
3+
export default class RightContainer extends Component {
4+
render() {
5+
return (
6+
<div className="column">
7+
Right container
8+
</div>
9+
)
10+
}
11+
}

src/main.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ function createWindow() {
1414
});
1515

1616
// and load the index.html of the app.
17-
console.log(__dirname);
1817
mainWindow.loadURL(`file://${__dirname}/../dist/index.html`);
1918

2019

src/reducers/componentReducer.js

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

33
export default (state = [], action) => {
44
let componets;

src/store.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { createStore, applyMiddleware } from 'redux';
22
import { composeWithDevTools } from 'redux-devtools-extension';
3+
import reducers from './reducers/index.js';
34

45
const store = createStore(
56
reducers,

src/style.css

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1-
h1 {
2-
color: blue;
1+
body {
2+
margin: 0;
3+
padding: 0;
4+
}
5+
6+
.app-container {
7+
display: flex;
8+
width: 100%;
9+
height: 100vh;
10+
}
11+
12+
.column {
13+
background-color: blue;
14+
width: 20%;
15+
}
16+
17+
.main {
18+
background-color: green;
19+
flex: 1;
320
}

0 commit comments

Comments
 (0)