ywana-core8 0.0.383 → 0.0.386
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +7 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +7 -11
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +7 -11
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/widgets/upload/UploadArea.js +5 -7
package/package.json
CHANGED
@@ -6,17 +6,15 @@ import { Icon } from '../../html'
|
|
6
6
|
*/
|
7
7
|
export const UploadArea = (props) => {
|
8
8
|
|
9
|
-
const { icon, label = 'Add file or drop file here...' } = props
|
9
|
+
const { resumable, icon, label = 'Add file or drop file here...' } = props
|
10
10
|
const areaElement = useRef()
|
11
11
|
const [drag, setDrag] = useState(false)
|
12
12
|
|
13
13
|
useEffect(() => {
|
14
|
-
|
15
|
-
if (resumable && areaElement) {
|
14
|
+
if (resumable && areaElement.current) {
|
16
15
|
resumable.assignDrop(areaElement.current)
|
17
|
-
resumable.assignBrowse(areaElement.current)
|
18
16
|
}
|
19
|
-
}, [])
|
17
|
+
}, [areaElement])
|
20
18
|
|
21
19
|
const onDragOver = () => {
|
22
20
|
setDrag(true)
|
@@ -34,7 +32,7 @@ export const UploadArea = (props) => {
|
|
34
32
|
onDragLeave={onDragLeave}
|
35
33
|
ref={areaElement}
|
36
34
|
>
|
37
|
-
<
|
35
|
+
<UploadIcon icon={icon} resumable={resumable} />
|
38
36
|
<label>{label}</label>
|
39
37
|
</div>
|
40
38
|
)
|
@@ -56,7 +54,7 @@ export const UploadIcon = ({ icon = "folder_open", resumable }) => {
|
|
56
54
|
|
57
55
|
return (
|
58
56
|
<div className="upload-icon" ref={iconElement}>
|
59
|
-
<Icon icon={icon}
|
57
|
+
<Icon icon={icon}/>
|
60
58
|
</div>
|
61
59
|
)
|
62
60
|
}
|