This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Upload = () => { | |
return ( | |
<div className="Upload" css={CSS}> | |
<div className="inner"> | |
<div className="list"> | |
<h5>Your Files:</h5> | |
<ul className="files">{/* file names here. */}</ul> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Upload = () => { | |
const inputRef = useRef() | |
const handleClick = () => { | |
inputRef.current.click() | |
} | |
return ( | |
<div className="Upload" css={CSS}> | |
<div className="inner"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Upload = () => { | |
const inputRef = useRef() | |
const handleClick = () => { | |
inputRef.current.click() | |
} | |
const preventBubbling = (e) => { | |
e.stopPropagation() | |
e.preventDefault() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Upload = () => { | |
const [files, setFiles] = useState(null) | |
const inputRef = useRef() | |
const handleClick = () => { | |
inputRef.current.click() | |
} | |
const preventBubbling = (e) => { | |
e.stopPropagation() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Upload = () => { | |
const [files, setFiles] = useState(null) | |
const inputRef = useRef() | |
const handleClick = () => { | |
inputRef.current.click() | |
} | |
const preventBubbling = (e) => { | |
e.stopPropagation() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Upload = () => { | |
const [files, setFiles] = useState(null) | |
const inputRef = useRef() | |
const handleClick = () => { | |
inputRef.current.click() | |
} | |
const preventBubbling = (e) => { | |
e.stopPropagation() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Upload = () => { | |
const [files, setFiles] = useState(null) | |
const inputRef = useRef() | |
const handleClick = () => { | |
inputRef.current.click() | |
} | |
const removeFile = (name) => { | |
const newFiles = files.filter((file) => file.name !== name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Upload = () => { | |
const [files, setFiles] = useState([]) | |
const inputRef = useRef() | |
const handleClick = () => { | |
inputRef.current.click() | |
} | |
const handleFiles = (fileList, mode = 'w') => { | |
if (mode === 'a') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Upload = () => { | |
const [files, setFiles] = useState([]) | |
const inputRef = useRef() | |
const handleClick = () => { | |
inputRef.current.click() | |
} | |
const handleFiles = (fileList, mode = 'w') => { | |
if (mode === 'a') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"success":"Hooray! your form was submitted.", | |
"fields":[ | |
{ | |
"name":"name", | |
"type":"text", | |
"placeholder":"Dana Scully", | |
"required":true, | |
"value": "" | |
}, |