Skip to content

Commit 649c657

Browse files
committed
fixed export duplication with export app.
1 parent 7b87f90 commit 649c657

File tree

2 files changed

+63
-72
lines changed

2 files changed

+63
-72
lines changed

src/containers/MainContainer.tsx

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -71,71 +71,71 @@ class MainContainer extends Component {
7171
constructor(props) {
7272
super(props);
7373

74-
IPC.on('new-file', (event, file) => {
75-
const image = new window.Image();
76-
image.src = file;
77-
this.props.changeImagePath(file);
78-
image.onload = () => {
79-
this.setState({ image });
80-
};
81-
this.draggableItems = [];
82-
});
83-
84-
IPC.on('app_dir_selected', (event, path) => {
85-
const { components } = this.props;
86-
const { genOption } = this.state;
87-
this.props.createApp({
88-
path,
89-
components,
90-
genOption,
91-
});
92-
});
74+
// IPC.on('new-file', (event, file) => {
75+
// const image = new window.Image();
76+
// image.src = file;
77+
// this.props.changeImagePath(file);
78+
// image.onload = () => {
79+
// this.setState({ image });
80+
// };
81+
// this.draggableItems = [];
82+
// });
83+
84+
// IPC.on('app_dir_selected', (event, path) => {
85+
// const { components } = this.props;
86+
// const { genOption } = this.state;
87+
// this.props.createApp({
88+
// path,
89+
// components,
90+
// genOption,
91+
// });
92+
// });
93+
// }
94+
95+
// closeModal = () => this.setState({ modal: null });
96+
97+
// chooseAppDir = () => IPC.send('choose_app_dir');
98+
99+
// chooseGenOptions = (genOption) => {
100+
// // set option
101+
// this.setState({ genOption });
102+
// // closeModal
103+
// this.closeModal();
104+
// // Choose app dir
105+
// this.chooseAppDir();
106+
// };
107+
108+
// showGenerateAppModal = () => {
109+
// console.log('clicked on export button');
110+
// const { closeModal, chooseGenOptions } = this;
111+
// const { genOptions } = this.state;
112+
// const children = (
113+
// <List className="export-preference">
114+
// {genOptions.map((option, i) => (
115+
// <ListItem
116+
// key={i}
117+
// button
118+
// onClick={() => chooseGenOptions(i)}
119+
// style={{
120+
// border: '1px solid #3f51b5',
121+
// marginBottom: '2%',
122+
// marginTop: '5%',
123+
// }}
124+
// >
125+
// <ListItemText primary={option} style={{ textAlign: 'center' }} />
126+
// </ListItem>
127+
// ))}
128+
// </List>
129+
// );
130+
// this.setState({
131+
// modal: createModal({
132+
// closeModal,
133+
// children,
134+
// message: 'Choose export preference:',
135+
// }),
136+
// });
93137
}
94138

95-
closeModal = () => this.setState({ modal: null });
96-
97-
chooseAppDir = () => IPC.send('choose_app_dir');
98-
99-
chooseGenOptions = (genOption) => {
100-
// set option
101-
this.setState({ genOption });
102-
// closeModal
103-
this.closeModal();
104-
// Choose app dir
105-
this.chooseAppDir();
106-
};
107-
108-
showGenerateAppModal = () => {
109-
console.log('clicked on export button');
110-
const { closeModal, chooseGenOptions } = this;
111-
const { genOptions } = this.state;
112-
const children = (
113-
<List className="export-preference">
114-
{genOptions.map((option, i) => (
115-
<ListItem
116-
key={i}
117-
button
118-
onClick={() => chooseGenOptions(i)}
119-
style={{
120-
border: '1px solid #3f51b5',
121-
marginBottom: '2%',
122-
marginTop: '5%',
123-
}}
124-
>
125-
<ListItemText primary={option} style={{ textAlign: 'center' }} />
126-
</ListItem>
127-
))}
128-
</List>
129-
);
130-
this.setState({
131-
modal: createModal({
132-
closeModal,
133-
children,
134-
message: 'Choose export preference:',
135-
}),
136-
});
137-
};
138-
139139
render() {
140140
const {
141141
draggable, scaleX, scaleY, modal, toggleClass,

src/utils/createApplication.util.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
// import util from 'util';
2-
3-
// const execFile = util.promisify(require('child_process').execFile);
4-
5-
// Application generation options
6-
// cosnt genOptions = [
7-
// 'Export into existing project.', 'Export with starter repo', 'Export with create-react-app.'
8-
// ];
9-
101
import fs from 'fs';
112
import { format } from 'prettier';
123
import componentRender from './componentRender.util';

0 commit comments

Comments
 (0)