Skip to content

Commit 4cd830c

Browse files
merged with Tolga styling
1 parent a467360 commit 4cd830c

File tree

7 files changed

+40
-17
lines changed

7 files changed

+40
-17
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
@@ -47,7 +47,7 @@ const LeftColExpansionPanel = props => {
4747
<Grid item xs={9}>
4848
<div
4949
className={classes.root}
50-
style={!isFocused() ? {} : { boxShadow: '0 10px 10px rgba(0,0,0,0.45)' }}
50+
style={!isFocused() ? {} : { boxShadow: '0 10px 10px rgba(0,0,0,0.25)' }}
5151
>
5252
<Grid item xs={12} style={{ color: "red" }}>
5353
<List style={{ color: "red" }}>

src/containers/LeftContainer.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import GetAppIcon from '@material-ui/icons/GetApp';
1010
import List from '@material-ui/core/List';
1111
import ListItem from '@material-ui/core/ListItem';
1212
import ListItemText from '@material-ui/core/ListItemText';
13+
import Fab from '@material-ui/core/Fab';
1314
import LeftColExpansionPanel from '../components/LeftColExpansionPanel';
1415
import HTMLComponentPanel from '../components/HTMLComponentPanel';
1516
import * as actions from '../actions/components';
@@ -227,17 +228,16 @@ class LeftContainer extends Component<PropsInt, StateInt> {
227228
/>
228229
</Grid>
229230
<Grid item xs={4}>
230-
<Button
231-
variant="fab"
232-
mini
233-
color="primary"
231+
<Fab
232+
size="small"
233+
color="secondary"
234234
className={classes.button}
235235
aria-label="Add"
236236
onClick={this.handleAddComponent}
237237
disabled={!this.state.componentName}
238238
>
239239
<AddIcon />
240-
</Button>
240+
</Fab>
241241
</Grid>
242242
</Grid>
243243
<div className="expansionPanel">{componentsExpansionPanel}</div>

src/public/styles/style.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ h1 {
123123
border-right: 1px solid grey;
124124
border-bottom: 1px solid grey; */
125125
background-color: #212121;
126-
box-shadow: 0 5px 7px -2px rgba(0, 0, 0, 0.4);
126+
box-shadow: 0 5px 7px -2px rgba(0, 0, 0, 0.1);
127127
z-index: 10;
128128
}
129129

@@ -205,7 +205,7 @@ RIGHT COLUMN
205205
/* display: flex;
206206
flex-direction: row; */
207207
background-color: #fcfcfc;
208-
box-shadow: 0 -5px 7px 2px rgba(0, 0, 0, 0.1);
208+
/* box-shadow: 0 -5px 7px 2px rgb(255, 0, 0); */
209209
}
210210

211211
.htmlattr {

src/reducers/componentReducer.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { ComponentInt, ChildInt, ApplicationStateInt } from '../utils/interfaces';
2+
13
import {
24
LOAD_INIT_DATA,
35
ADD_COMPONENT,
@@ -43,18 +45,18 @@ import {
4345
deleteProp,
4446
updateHtmlAttr,
4547
updateChildrenSort,
46-
} from '../utils/componentReducer.util.ts';
47-
import cloneDeep from '../utils/cloneDeep.ts';
48+
} from '../utils/componentReducer.util';
49+
import cloneDeep from '../utils/cloneDeep';
4850

4951
const appComponent = {
5052
id: 1,
5153
stateful: false,
5254
title: 'App',
53-
parentIds: [],
55+
// parentIds: [],
5456
color: '#FF6D00',
55-
draggable: true,
56-
childrenIds: [],
57-
selectableParents: [],
57+
// draggable: true,
58+
// childrenIds: [],
59+
// selectableParents: [],
5860
props: [],
5961
nextPropId: 1,
6062
position: {
@@ -80,6 +82,11 @@ const initialApplicationFocusChild = {
8082
},
8183
draggable: true,
8284
childType: null,
85+
childSort: 0,
86+
childComponentId: 0,
87+
color: null,
88+
htmlElement: null,
89+
HTMLInfo: null,
8390
};
8491

8592
const initialApplicationState = {
@@ -95,7 +102,6 @@ const initialApplicationState = {
95102
components: [appComponent],
96103
appDir: '',
97104
loading: false,
98-
componentTree: { name: 'App', attributes: {}, children: {} },
99105
};
100106

101107
const componentReducer = (state = initialApplicationState, action) => {

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)