Skip to content

Commit d5af960

Browse files
Merge pull request #9 from tolgamizrakci/development
electron build with tsx containers working
2 parents 8bf9c2d + 53bb6a5 commit d5af960

12 files changed

+478
-475
lines changed

src/components/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
22
import '../public/styles/style.css';
33
import { MuiThemeProvider } from '@material-ui/core/styles';
44
import theme from './theme';
5-
import AppContainer from '../containers/AppContainer.jsx';
5+
import AppContainer from '../containers/AppContainer.tsx';
66

77
interface Adam {
88
goodguy: boolean;

src/components/KonvaStage.jsx renamed to src/components/KonvaStage.tsx

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React, { Component, createRef } from 'react';
2-
import PropTypes from 'prop-types';
2+
// import PropTypes from 'prop-types';
33
import {
44
Stage, Layer, Image, Group,
55
} from 'react-konva';
6-
import TransformerComponent from './TransformerComponent.jsx';
7-
import Rectangle from './Rectangle.jsx';
6+
import TransformerComponent from './TransformerComponent.tsx';
7+
import Rectangle from './Rectangle.tsx';
88

99

1010
class KonvaStage extends Component {
@@ -42,6 +42,7 @@ class KonvaStage extends Component {
4242
}
4343
};
4444

45+
// WAS ALREADY COMMENTED OUT
4546
// handleStageDrag = () => {
4647
// // const mainWindowHeight = this.main.current.clientHeight;
4748
// // const mainWindowWidth = this.main.current.clientWidth;
@@ -54,7 +55,7 @@ class KonvaStage extends Component {
5455
// }
5556

5657
componentDidMount() {
57-
this.props.setImage();
58+
// this.props.setImage();
5859
}
5960

6061
render() {
@@ -105,19 +106,19 @@ class KonvaStage extends Component {
105106
}
106107
}
107108

108-
KonvaStage.propTypes = {
109-
draggable: PropTypes.bool.isRequired,
110-
components: PropTypes.array.isRequired,
111-
handleTransform: PropTypes.func.isRequired,
112-
image: PropTypes.oneOfType([
113-
PropTypes.string,
114-
PropTypes.object,
115-
]),
116-
scaleX: PropTypes.number.isRequired,
117-
scaleY: PropTypes.number.isRequired,
118-
openExpansionPanel: PropTypes.func.isRequired,
119-
setImage: PropTypes.func.isRequired,
120-
focusComponent: PropTypes.object.isRequired,
121-
};
109+
// KonvaStage.propTypes = {
110+
// draggable: PropTypes.bool.isRequired,
111+
// components: PropTypes.array.isRequired,
112+
// handleTransform: PropTypes.func.isRequired,
113+
// image: PropTypes.oneOfType([
114+
// PropTypes.string,
115+
// PropTypes.object,
116+
// ]),
117+
// scaleX: PropTypes.number.isRequired,
118+
// scaleY: PropTypes.number.isRequired,
119+
// openExpansionPanel: PropTypes.func.isRequired,
120+
// setImage: PropTypes.func.isRequired,
121+
// focusComponent: PropTypes.object.isRequired,
122+
// };
122123

123124
export default KonvaStage;
File renamed without changes.

src/components/RightTabs.jsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component } from 'react';
2-
import PropTypes from 'prop-types';
2+
// import PropTypes from 'prop-types';
33
import { withStyles } from '@material-ui/core/styles';
44
import Tabs from '@material-ui/core/Tabs';
55
import Tab from '@material-ui/core/Tab';
@@ -87,11 +87,11 @@ class RightTabs extends Component {
8787
onChange={this.handleChange}
8888
classes={{ root: classes.tabsRoot, indicator: classes.tabsIndicator }}
8989
>
90-
<Tab
90+
{/* <Tab
9191
disableRipple
9292
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
9393
label="Hierarchy"
94-
/>
94+
/> */}
9595
<Tab
9696
disableRipple
9797
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
@@ -107,8 +107,8 @@ class RightTabs extends Component {
107107
}
108108
/>
109109
</Tabs>
110-
{value === 0 && <SortableComponent components={components} />}
111-
{value === 1 && <Props
110+
{/* {value === 0 && <SortableComponent components={components} />} */}
111+
{value === 0 && <Props
112112
rightColumnOpen={rightColumnOpen}
113113
focusComponent={focusComponent}
114114
deleteProp={deleteProp}
@@ -120,13 +120,13 @@ class RightTabs extends Component {
120120
}
121121
}
122122

123-
RightTabs.propTypes = {
124-
classes: PropTypes.object.isRequired,
125-
components: PropTypes.array.isRequired,
126-
focusComponent: PropTypes.object.isRequired,
127-
deleteProp: PropTypes.func.isRequired,
128-
addProp: PropTypes.func.isRequired,
129-
rightColumnOpen: PropTypes.bool.isRequired,
130-
};
123+
// RightTabs.propTypes = {
124+
// classes: PropTypes.object.isRequired,
125+
// components: PropTypes.array.isRequired,
126+
// focusComponent: PropTypes.object.isRequired,
127+
// deleteProp: PropTypes.func.isRequired,
128+
// addProp: PropTypes.func.isRequired,
129+
// rightColumnOpen: PropTypes.bool.isRequired,
130+
// };
131131

132132
export default withStyles(styles)(RightTabs);

src/components/Snackbars.jsx

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
1-
import React from 'react';
2-
import PropTypes from 'prop-types';
3-
import Button from '@material-ui/core/Button';
4-
import Snackbar from '@material-ui/core/Snackbar';
5-
import SnackbarContentWrapper from './SnackbarContentWrapper.jsx';
1+
// import React from 'react';
2+
// import PropTypes from 'prop-types';
3+
// import Button from '@material-ui/core/Button';
4+
// import Snackbar from '@material-ui/core/Snackbar';
5+
// import SnackbarContentWrapper from './SnackbarContentWrapper.jsx';
66

7-
const Snackbars = (props) => {
8-
const {
9-
successOpen, errorOpen, handleNotificationClose, msg, viewAppDir,
10-
} = props;
11-
const successMsg = <div>Your files were successfully created. <Button
12-
variant='fab'
13-
mini
14-
aria-label='View app directory'
15-
onClick={viewAppDir}
16-
>View</Button></div>;
17-
const errMsg = `There was an error while creating your files. ${msg}`;
18-
return (
19-
<div>
20-
<Snackbar
21-
anchorOrigin={{
22-
vertical: 'bottom',
23-
horizontal: 'left',
24-
}}
25-
open={successOpen}
26-
autoHideDuration={5000}
27-
>
28-
<SnackbarContentWrapper
29-
onClose={handleNotificationClose}
30-
variant="success"
31-
message={successMsg}
32-
/>
33-
</Snackbar>
34-
<Snackbar
35-
anchorOrigin={{
36-
vertical: 'bottom',
37-
horizontal: 'left',
38-
}}
39-
open={errorOpen}
40-
autoHideDuration={5000}
41-
>
42-
<SnackbarContentWrapper
43-
onClose={handleNotificationClose}
44-
variant="error"
45-
message={errMsg}
46-
/>
47-
</Snackbar>
48-
</div>
49-
);
50-
};
7+
// const Snackbars = (props) => {
8+
// const {
9+
// successOpen, errorOpen, handleNotificationClose, msg, viewAppDir,
10+
// } = props;
11+
// const successMsg = <div>Your files were successfully created. <Button
12+
// variant='fab'
13+
// mini
14+
// aria-label='View app directory'
15+
// onClick={viewAppDir}
16+
// >View</Button></div>;
17+
// const errMsg = `There was an error while creating your files. ${msg}`;
18+
// return (
19+
// <div>
20+
// <Snackbar
21+
// anchorOrigin={{
22+
// vertical: 'bottom',
23+
// horizontal: 'left',
24+
// }}
25+
// open={successOpen}
26+
// autoHideDuration={5000}
27+
// >
28+
// <SnackbarContentWrapper
29+
// onClose={handleNotificationClose}
30+
// variant="success"
31+
// message={successMsg}
32+
// />
33+
// </Snackbar>
34+
// <Snackbar
35+
// anchorOrigin={{
36+
// vertical: 'bottom',
37+
// horizontal: 'left',
38+
// }}
39+
// open={errorOpen}
40+
// autoHideDuration={5000}
41+
// >
42+
// <SnackbarContentWrapper
43+
// onClose={handleNotificationClose}
44+
// variant="error"
45+
// message={errMsg}
46+
// />
47+
// </Snackbar>
48+
// </div>
49+
// );
50+
// };
5151

52-
Snackbars.propTypes = {
53-
successOpen: PropTypes.bool.isRequired,
54-
errorOpen: PropTypes.bool.isRequired,
55-
msg: PropTypes.string.isRequired,
56-
viewAppDir: PropTypes.func.isRequired,
57-
handleNotificationClose: PropTypes.func.isRequired,
58-
};
52+
// Snackbars.propTypes = {
53+
// successOpen: PropTypes.bool.isRequired,
54+
// errorOpen: PropTypes.bool.isRequired,
55+
// msg: PropTypes.string.isRequired,
56+
// viewAppDir: PropTypes.func.isRequired,
57+
// handleNotificationClose: PropTypes.func.isRequired,
58+
// };
5959

60-
export default Snackbars;
60+
// export default Snackbars;

src/containers/AppContainer.jsx renamed to src/containers/AppContainer.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React, { Component } from 'react';
22
import { connect } from 'react-redux';
3-
import PropTypes from 'prop-types';
3+
// import PropTypes from 'prop-types';
44
import { MuiThemeProvider } from '@material-ui/core/styles';
55
import LinearProgress from '@material-ui/core/LinearProgress';
6-
import LeftContainer from './LeftContainer.jsx';
7-
import MainContainer from './MainContainer.jsx';
8-
import RightContainer from './RightContainer.jsx';
6+
import LeftContainer from './LeftContainer.tsx';
7+
import MainContainer from './MainContainer.tsx';
8+
import RightContainer from './RightContainer.tsx';
99
import convertIdsToObjs from '../utils/convertIdsToObjs.util';
1010
import theme from '../components/theme';
1111
import { loadInitData } from '../actions/components';
@@ -86,10 +86,10 @@ class AppContainer extends Component {
8686

8787
export default connect(mapStateToProps, mapDispatchToProps)(AppContainer);
8888

89-
AppContainer.propTypes = {
90-
components: PropTypes.array.isRequired,
91-
totalComponents: PropTypes.number.isRequired,
92-
focusComponent: PropTypes.object.isRequired,
93-
loadInitData: PropTypes.func.isRequired,
94-
loading: PropTypes.bool,
95-
};
89+
// AppContainer.propTypes = {
90+
// components: PropTypes.array.isRequired,
91+
// totalComponents: PropTypes.number.isRequired,
92+
// focusComponent: PropTypes.object.isRequired,
93+
// loadInitData: PropTypes.func.isRequired,
94+
// loading: PropTypes.bool,
95+
// };

0 commit comments

Comments
 (0)