Browse Source

hw react 5-6

Vika 2 years ago
parent
commit
0de365949b
1 changed files with 3 additions and 36 deletions
  1. 3 36
      react5/my-app/src/App.js

+ 3 - 36
react5/my-app/src/App.js

@@ -189,53 +189,20 @@ const PhoneBook = ({people=defaultPeople,
 
 
 
-
-function MyDropzone() {
-  const onDrop = useCallback(acceptedFiles => {
-    // Do something with the files
-  }, [])
-  const {getRootProps, getInputProps, isDragActive} = useDropzone({onDrop})
-
-  return (
-    <div {...getRootProps()}>
-      <input {...getInputProps()} onChange={(e) => getFile(e.target.value)}/>
-      {
-        isDragActive ?
-          <p>Drop the files here ...</p> :
-          <p>Drag 'n' drop some files here, or click to select files</p>
-      }
-    </div>
-  )
-}
-
-
-const getFile =(file)=> file;
-
-let fd = new FormData;
-fd.append('photo', );
-
-photo.onchange = async () => {
-  fetch('/upload', {
-      method: "POST",
-      headers: localStorage.authToken ? {Authorization: 'Bearer ' + localStorage.authToken} : {},
-      body: new FormData(form)
-  })
-}
-
 function App() {
   const [country, setCountry] = useState('AX')
   return (
     < >
-      {/* <div className="App">
+      <div className="App">
         {console.log(country)}
         <MySelect value={country} onChange = {(w) => setCountry(w)} />
         <Gallery/>
-      </div> */}
+      </div>
       <div>
       <PhoneBook/>
       </div>
       <div>
-      <MyDropzone getFile={getFile}/>
+      
       </div>
      </>