Skip to content

Commit 2f14d2b

Browse files
merged with Tolga styling
1 parent 7749cf0 commit 2f14d2b

File tree

7 files changed

+41
-29
lines changed

7 files changed

+41
-29
lines changed

src/components/CodePreview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class CodePreview extends Component<Props> {
1717

1818
return (
1919
<Fragment>
20-
<SortChildren />
20+
{/* <SortChildren /> */}
2121
<div
2222
style={{
2323
width: '500px',

src/components/HTMLComponentPanel.jsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ class HTMLComponentPanel extends Component {
7171
margin: 0,
7272
padding: 0,
7373
}}
74+
onClick={() => {
75+
this.handleCreateHTMLChild('Image');
76+
}}
7477
/>
7578
</div>
7679
</Grid>
@@ -96,6 +99,9 @@ class HTMLComponentPanel extends Component {
9699
color: 'white',
97100
fontSize: '80%',
98101
}}
102+
onClick={() => {
103+
this.handleCreateHTMLChild('Form');
104+
}}
99105
/>
100106
</Grid>
101107
<Grid item xs={4}>
@@ -120,6 +126,9 @@ class HTMLComponentPanel extends Component {
120126
color: 'white',
121127
fontSize: '80%',
122128
}}
129+
onClick={() => {
130+
this.handleCreateHTMLChild('Button');
131+
}}
123132
/>
124133
</Grid>
125134
<Grid item xs={4}>
@@ -144,6 +153,9 @@ class HTMLComponentPanel extends Component {
144153
color: 'white',
145154
fontSize: '80%',
146155
}}
156+
onClick={() => {
157+
this.handleCreateHTMLChild('Link');
158+
}}
147159
/>
148160
</Grid>
149161
<Grid item xs={4}>
@@ -168,6 +180,9 @@ class HTMLComponentPanel extends Component {
168180
color: 'white',
169181
fontSize: '80%',
170182
}}
183+
onClick={() => {
184+
this.handleCreateHTMLChild('List');
185+
}}
171186
/>
172187
</Grid>
173188
<Grid
@@ -203,6 +218,9 @@ class HTMLComponentPanel extends Component {
203218
padding: '0px',
204219
margin: '0px',
205220
}}
221+
onClick={() => {
222+
this.handleCreateHTMLChild('Paragraph');
223+
}}
206224
/>
207225
</Grid>
208226
</Grid>

src/components/LeftColExpansionPanel.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const LeftColExpansionPanel = (props) => {
3939
<Grid item xs={9}>
4040
<div
4141
className={classes.root}
42-
style={!isFocused() ? {} : { boxShadow: '0 10px 10px rgba(0,0,0,0.45)' }}
42+
style={!isFocused() ? {} : { boxShadow: '0 10px 10px rgba(0,0,0,0.25)' }}
4343
>
4444
<Grid item xs={12} style={{ color: 'red' }}>
4545
<List style={{ color: 'red' }}>

src/containers/LeftContainer.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Tooltip from '@material-ui/core/Tooltip';
1111
import List from '@material-ui/core/List';
1212
import ListItem from '@material-ui/core/ListItem';
1313
import ListItemText from '@material-ui/core/ListItemText';
14+
import Fab from '@material-ui/core/Fab';
1415
import LeftColExpansionPanel from '../components/LeftColExpansionPanel';
1516
import HTMLComponentPanel from '../components/HTMLComponentPanel';
1617
import * as actions from '../actions/components';
@@ -248,17 +249,16 @@ class LeftContainer extends Component<PropsInt, StateInt> {
248249
/>
249250
</Grid>
250251
<Grid item xs={4}>
251-
<Button
252-
variant="fab"
253-
mini
252+
<Fab
253+
size="small"
254254
color="secondary"
255255
className={classes.button}
256256
aria-label="Add"
257257
onClick={this.handleAddComponent}
258258
disabled={!this.state.componentName}
259259
>
260260
<AddIcon />
261-
</Button>
261+
</Fab>
262262
</Grid>
263263
</Grid>
264264
<div className="expansionPanel">{componentsExpansionPanel}</div>

src/public/styles/style.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ h1 {
136136
border-right: 1px solid grey;
137137
border-bottom: 1px solid grey; */
138138
background-color: #212121;
139-
box-shadow: 0 5px 7px -2px rgba(0, 0, 0, 0.4);
139+
box-shadow: 0 5px 7px -2px rgba(0, 0, 0, 0.1);
140140
z-index: 10;
141141
}
142142

@@ -218,7 +218,7 @@ RIGHT COLUMN
218218
/* display: flex;
219219
flex-direction: row; */
220220
background-color: #fcfcfc;
221-
box-shadow: 0 -5px 7px 2px rgb(255, 0, 0);
221+
/* box-shadow: 0 -5px 7px 2px rgb(255, 0, 0); */
222222
}
223223

224224
.htmlattr {

src/reducers/componentReducer.ts

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import {
2-
ComponentInt,
3-
ChildInt,
4-
ApplicationStateInt
5-
} from "../utils/interfaces";
1+
import { ComponentInt, ChildInt, ApplicationStateInt } from '../utils/interfaces';
62

73
import {
84
LOAD_INIT_DATA,
@@ -27,8 +23,8 @@ import {
2723
ADD_PROP,
2824
DELETE_PROP,
2925
UPDATE_HTML_ATTR,
30-
UPDATE_CHILDREN_SORT
31-
} from "../actionTypes";
26+
UPDATE_CHILDREN_SORT,
27+
} from '../actionTypes';
3228

3329
import {
3430
addComponent,
@@ -48,16 +44,16 @@ import {
4844
addProp,
4945
deleteProp,
5046
updateHtmlAttr,
51-
updateChildrenSort
52-
} from "../utils/componentReducer.util";
53-
import cloneDeep from "../utils/cloneDeep";
47+
updateChildrenSort,
48+
} from '../utils/componentReducer.util';
49+
import cloneDeep from '../utils/cloneDeep';
5450

5551
const appComponent: ComponentInt = {
5652
id: 1,
5753
stateful: false,
58-
title: "App",
54+
title: 'App',
5955
// parentIds: [],
60-
color: "#FF6D00",
56+
color: '#FF6D00',
6157
// draggable: true,
6258
// childrenIds: [],
6359
// selectableParents: [],
@@ -67,12 +63,12 @@ const appComponent: ComponentInt = {
6763
x: 25,
6864
y: 25,
6965
width: 600,
70-
height: 400
66+
height: 400,
7167
},
7268

7369
childrenArray: [],
7470
nextChildId: 1,
75-
focusChildId: 0
71+
focusChildId: 0,
7672
};
7773

7874
const initialApplicationFocusChild: ChildInt = {
@@ -82,15 +78,15 @@ const initialApplicationFocusChild: ChildInt = {
8278
x: 25,
8379
y: 25,
8480
width: 600,
85-
height: 400
81+
height: 400,
8682
},
8783
// draggable: true,
8884
childType: null,
8985
childSort: 0,
9086
childComponentId: 0,
9187
color: null,
9288
htmlElement: null,
93-
HTMLInfo: null
89+
HTMLInfo: null,
9490
};
9591

9692
const initialApplicationState: ApplicationStateInt = {
@@ -104,9 +100,8 @@ const initialApplicationState: ApplicationStateInt = {
104100
initialApplicationFocusChild,
105101
focusChild: cloneDeep(initialApplicationFocusChild),
106102
components: [appComponent],
107-
appDir: "",
103+
appDir: '',
108104
loading: false,
109-
componentTree: { name: "App", attributes: {}, children: {} }
110105
};
111106

112107
const componentReducer = (state = initialApplicationState, action: any) => {
@@ -116,9 +111,9 @@ const componentReducer = (state = initialApplicationState, action: any) => {
116111
...state,
117112
...action.payload.data,
118113
loading: false,
119-
appDir: "",
114+
appDir: '',
120115
successOpen: false,
121-
errorOpen: false
116+
errorOpen: false,
122117
};
123118
case ADD_COMPONENT:
124119
return addComponent(state, action.payload);

src/utils/Interfaces.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export interface ApplicationStateInt {
5555
components: ComponentsInt;
5656
appDir: string;
5757
loading: boolean;
58-
componentTree: object;
5958
}
6059

6160
function findComponentById(id: number, components: ComponentInt[]) {

0 commit comments

Comments
 (0)