1- import { useEffect , useState } from 'react' ;
21import ProgressBar from './ProgressBar' ;
32import useHIDBoot from '../logic/useHIDBoot' ;
43import useUSBFlash from '../logic/useUSBFlash'
@@ -7,28 +6,17 @@ import imgSrc from '../images/imx8qxp_mek_bootmode.png'
76import "./Combined.css"
87
98const Combined = ( { bootFile, flashFile} ) => {
10- // const [imgUrl, setImgUrl] = useState();
11-
129 const [ { requestHIDDevice, HIDdevice, bootProgress, bootTotal } ] = useHIDBoot ( bootFile ) ;
1310 const [ { requestUSBDevice, USBDevice, flashProgress, flashTotal} ] = useUSBFlash ( flashFile ) ;
1411
15- // useEffect(() => {
16- // const dothis = async()=>{
17- // const response = await fetch("mode");
18- // const blob = await response.blob();
19- // setImgUrl(URL.createObjectURL(blob));
20- // }
21- // dothis();
22- // }, [])
23-
2412 return (
2513 < div >
2614 < ul className = "Popup-list" >
2715 < li >
2816 < span > 1. Switch Boot Mode to "SERIAL"</ span >
2917 < div className = "u-flex u-center" >
3018 < div className = "image-container" >
31- { imgSrc ? < img className = "boot-image" src = { imgSrc } /> : "" }
19+ { imgSrc ? < img className = "boot-image" src = { imgSrc } alt = "boot mode switches" /> : "" }
3220 </ div >
3321 </ div >
3422 </ li >
@@ -55,7 +43,9 @@ const Combined = ({bootFile, flashFile}) => {
5543 < div >
5644 < span > 3. </ span >
5745 < button onClick = { requestUSBDevice } > Pair USBDevice </ button >
58- < div className = "Popup-empty" > { USBDevice ? `connected: ${ USBDevice . productName } ` : "" } </ div >
46+ < div className = "Popup-empty" >
47+ + { USBDevice ? `connected: ${ USBDevice . productName } ` : "" }
48+ + </ div >
5949 </ div >
6050 </ div >
6151 </ li >
0 commit comments