Skip to content

Commit a9ae35b

Browse files
spincycle01ChristianEdwardPadilla
authored andcommitted
Merge pull request #93 from spincycle01/master
fixed export duplication with export function
2 parents 5fba486 + 6d9aafd commit a9ae35b

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
@@ -72,71 +72,71 @@ class MainContainer extends Component {
7272
constructor(props) {
7373
super(props);
7474

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

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

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

0 commit comments

Comments
 (0)