@@ -98,121 +98,3 @@ export default function ExportButton(): JSX.Element {
98
98
</ div >
99
99
) ;
100
100
}
101
-
102
- // This code is commented out below for v16, it is export function for electron, which may be useful for future devs
103
- //The below code is exclusive to ReacType's Electron App
104
- //If you would like to deploy the app, please comment out the exportButton function above and uncomment the code below
105
-
106
- // export default function ExportButton() {
107
- // const [modal, setModal] = useState(null);
108
- // const state = useSelector(store => store.appState)
109
-
110
- // const genOptions: string[] = [
111
- // 'Export components',
112
- // 'Export components with application files'
113
- // ];
114
- // let genOption = 0;
115
-
116
- // // Closes out the open modal
117
- // const closeModal = () => setModal('');
118
-
119
- // const showGenerateAppModal = () => {
120
- // const children = (
121
- // <List className="export-preference">
122
- // {genOptions.map((option: string, i: number) => (
123
- // <ListItem
124
- // key={i}
125
- // // button
126
- // onClick={() => chooseGenOptions(i)}
127
- // style={{
128
- // border: '1px solid #3f51b5',
129
- // marginBottom: '2%',
130
- // marginTop: '5%'
131
- // }}
132
- // >
133
- // <ListItemText primary={option} style={{ textAlign: 'center' }} />
134
- // </ListItem>
135
- // ))}
136
- // <ListItem>
137
- // <input type="checkbox" id="tests" name="tests"></input>
138
- // <label for="tests">Include Tests</label>
139
- // </ListItem>
140
- // </List>
141
- // );
142
- // let testchecked = 0;
143
- // // helper function called by showGenerateAppModal
144
- // // this function will prompt the user to choose an app directory once they've chosen their export option
145
- // const chooseGenOptions = (genOpt: number) => {
146
- // // set export option: 0 --> export only components, 1 --> export full project
147
- // genOption = genOpt;
148
-
149
- // //This is exclusive to the electron app
150
- // window.api.chooseAppDir();
151
- // testchecked = document.getElementById('tests').checked;
152
- // testerFunc();
153
- // closeModal();
154
- // };
155
-
156
- // // removes all listeners for the app_dir_selected event
157
- // // this is important because otherwise listeners will pile up and events will trigger multiple events
158
- // //This is exclusive to the electron app
159
- // window.api.removeAllAppDirChosenListeners();
160
-
161
- // // add listener for when an app directory is chosen
162
- // // when a directory is chosen, the callback will export the project to the chosen folder
163
- // // Note: this listener is imported from the main process via preload.js
164
-
165
- // // This is exclusive to the electron app
166
- // window.api.addAppDirChosenListener(path => {
167
- // exportProject(
168
- // path,
169
- // state.name
170
- // ? state.name
171
- // : 'New_ReacType_Project_' + Math.ceil(Math.random() * 99).toString(),
172
- // genOption,
173
- // testchecked,
174
- // state.projectType,
175
- // state.components,
176
- // state.rootComponents
177
- // );
178
- // });
179
-
180
- // setModal(
181
- // createModal({
182
- // closeModal,
183
- // children,
184
- // message: 'Choose export preference:',
185
- // primBtnLabel: null,
186
- // primBtnAction: null,
187
- // secBtnAction: null,
188
- // secBtnLabel: null,
189
- // open: true
190
- // })
191
- // );
192
- // };
193
-
194
- // const exportKeyBind = useCallback(e => {
195
- // //Export Project
196
- // (e.key === 'e' && e.metaKey) || (e.key === 'e' && e.ctrlKey)
197
- // ? showGenerateAppModal()
198
- // : '';
199
- // }, []);
200
-
201
- // useEffect(() => {
202
- // document.addEventListener('keydown', exportKeyBind);
203
- // return () => {
204
- // document.removeEventListener('keydown', exportKeyBind);
205
- // };
206
- // }, []);
207
- // return (
208
- // <div>
209
- // <button onClick={showGenerateAppModal}>Export Project
210
- // <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" className="bi bi-download" viewBox="0 0 16 16">
211
- // <path d="M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"/>
212
- // <path d="M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3z"/>
213
- // </svg>
214
- // </button>
215
- // {modal}
216
- // </div>
217
- // );
218
- // }
0 commit comments