@@ -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,
0 commit comments