|
@@ -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>
|
|
|
</>
|
|
|
|