Skip to content

Commit bc77427

Browse files
Merge pull request #76 from tolgamizrakci/development
Development
2 parents cf4ebd0 + 7051c12 commit bc77427

File tree

4 files changed

+39
-17
lines changed

4 files changed

+39
-17
lines changed

src/components/KonvaStage.tsx

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import Button from '@material-ui/core/Button';
33
import { Stage, Layer, Line, Group, Label, Text, Rect, Transformer } from 'react-konva';
44
import Rectangle from './Rectangle.jsx';
55
import cloneDeep from '../utils/cloneDeep.ts';
6+
import DeleteIcon from '@material-ui/icons/Delete';
7+
import Fab from '@material-ui/core/Fab';
68

79
class KonvaStage extends Component {
810
constructor(props) {
@@ -132,7 +134,7 @@ class KonvaStage extends Component {
132134
};
133135

134136
render() {
135-
const { components, handleTransform, focusComponent, focusChild, deleteChild } = this.props;
137+
const { components, handleTransform, focusComponent, focusChild, deleteChild, classes } = this.props;
136138

137139
return (
138140
<div
@@ -145,7 +147,7 @@ class KonvaStage extends Component {
145147
}}
146148
tabIndex="0" // required for keydown event to be heard by this.container
147149
>
148-
<Button
150+
{/* <Button
149151
onClick={deleteChild}
150152
style={{
151153
width: '150px',
@@ -156,7 +158,30 @@ class KonvaStage extends Component {
156158
}}
157159
>
158160
delete child
159-
</Button>
161+
</Button> */}
162+
<Fab
163+
variant="extended"
164+
size="small"
165+
color="inherit"
166+
aria-label="Delete"
167+
// className={classes.margin}
168+
style={{
169+
width: '150px',
170+
position: 'relative',
171+
float: 'right',
172+
marginTop: '10px',
173+
marginLeft: '10px',
174+
// background: "#dbdbdb",
175+
zIndex: 2,
176+
}}
177+
// style={{ maxWidth: "20px" }}
178+
onClick={deleteChild}
179+
>
180+
<DeleteIcon />
181+
Delete Child
182+
{/* {`Delete
183+
${focusChild.}`} */}
184+
</Fab>
160185
<Stage
161186
className={'canvasStage'}
162187
ref={node => {

src/components/Rectangle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class Rectangle extends Component {
140140
// fill={color}
141141
// opacity={0.8}
142142
onTransformEnd={event => this.handleResize(componentId, childId, event.target, blockSnapSize)}
143-
strokeWidth={4}
143+
strokeWidth={childType === 'COMP' ? 4 : 1}
144144
strokeScaleEnabled={false}
145145
draggable={false}
146146
fill={childId === -1 ? 'white' : null}

src/containers/MainContainer.tsx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React, { Component } from 'react';
22
import { connect } from 'react-redux';
33
import Button from '@material-ui/core/Button';
44
import { MuiThemeProvider } from '@material-ui/core/styles';
5-
import BottomPanel from '../components/BottomPanel.jsx';
65
import List from '@material-ui/core/List';
76
import ListItem from '@material-ui/core/ListItem';
87
import ListItemText from '@material-ui/core/ListItemText';
@@ -51,7 +50,7 @@ const mapDispatchToProps = dispatch => ({
5150
});
5251

5352
const mapStateToProps = store => ({
54-
// totalComponents: store.workspace.totalComponents,
53+
// totalComponents: store.workspace.totalComponents,
5554
focusComponent: store.workspace.focusComponent,
5655
focusChild: store.workspace.focusChild,
5756
stateComponents: store.workspace.components,
@@ -140,15 +139,6 @@ class MainContainer extends Component {
140139
// });
141140
// };
142141

143-
// deleteImage = () => {
144-
// this.props.changeImagePath('');
145-
// this.setState({ image: '' });
146-
// };
147-
148-
closeModal = () => this.setState({ modal: null });
149-
150-
chooseAppDir = () => IPC.send('choose_app_dir');
151-
152142
chooseGenOptions = genOption => {
153143
// set option
154144
this.setState({ genOption });
@@ -169,7 +159,11 @@ class MainContainer extends Component {
169159
key={i}
170160
button
171161
onClick={() => chooseGenOptions(i)}
172-
style={{ border: '1px solid #3f51b5', marginBottom: '2%', marginTop: '5%' }}
162+
style={{
163+
border: '1px solid #3f51b5',
164+
marginBottom: '2%',
165+
marginTop: '5%',
166+
}}
173167
>
174168
<ListItemText primary={option} style={{ textAlign: 'center' }} />
175169
</ListItem>
@@ -198,6 +192,7 @@ class MainContainer extends Component {
198192
deleteChild,
199193
deleteComponent,
200194
stateComponents,
195+
classes,
201196
} = this.props;
202197
const { main, showGenerateAppModal } = this;
203198
const cursor = this.state.draggable ? 'move' : 'default';
@@ -232,6 +227,7 @@ class MainContainer extends Component {
232227
changeFocusChild={changeFocusChild}
233228
changeComponentFocusChild={changeComponentFocusChild}
234229
deleteChild={deleteChild}
230+
classes={classes}
235231
/>
236232
</div>
237233

src/public/styles/style.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ html {
1212
body {
1313
margin: 0;
1414
padding: 0;
15-
font-family: 'Open sans', sans-serif;
15+
font-family: "Open sans", sans-serif;
1616
font-weight: 400;
1717
}
1818

@@ -72,6 +72,7 @@ LEFT COLUMN
7272
.left {
7373
padding: 20px;
7474
width: 20%;
75+
/* min-width: 50px; */
7576
display: flex;
7677
flex-direction: column;
7778
position: relative;

0 commit comments

Comments
 (0)