-
Notifications
You must be signed in to change notification settings - Fork 333
Expand file tree
/
Copy pathApp.js
More file actions
54 lines (46 loc) · 1.89 KB
/
Copy pathApp.js
File metadata and controls
54 lines (46 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import React, { useState } from 'react';
import Combined from "./components/Combined";
import Decompress2 from "./components/Decompress";
import usePopup from "./logic/usePopup";
import './App.css'
const App = () => {
const [bootFile, setBootFile] = useState();
const [flashFile, setFlashFile] = useState();
const [{ showPopup, closePopup, show, error }] = usePopup({bootFile, flashFile});
return (
<div className="App">
<div className="u-flex u-column">
<div>
<Decompress2 />
</div>
<div className="u-row">
<span className="link-container">bootloader [optional]: </span>
<span className="file-name">{bootFile? bootFile.name:""}</span>
<label className="custom-file-upload">
<input className="input" type="file" onChange={(e)=>setBootFile(e.target.files[0])}/>
Choose File
</label>
</div>
<div className="u-row">
<span className="link-container">flash: </span>
<span className="file-name">{flashFile? flashFile.name:""}</span>
<label className="custom-file-upload">
<input className="input" type="file" onChange={(e)=>setFlashFile(e.target.files[0])}/>
Choose File
</label>
</div>
<div className="popup-button">
<button onClick = {showPopup}>USB_down</button>
</div>
<div className="popup-loc ">
<div className="popup-container" style={show?{}:{display:'none'}}>
<Combined bootFile={bootFile} flashFile={flashFile}/>
<button onClick={()=>closePopup()}>close</button>
</div>
</div>
<span>{error}</span>
</div>
</div>
);
}
export default App;