@visns-studio/visns-components 3.7.10 → 3.7.11
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.
|
@@ -105,20 +105,11 @@ const GenericDynamic = ({
|
|
|
105
105
|
updateField(prevState, name, newValue)
|
|
106
106
|
);
|
|
107
107
|
} else if (files && files[0]) {
|
|
108
|
+
const toastId = toast.loading('Uploading file...'); // Show loading toast
|
|
108
109
|
// Start the upload process and read the file if it's an image
|
|
109
110
|
Vapor.store(files[0], {
|
|
110
111
|
progress: (progress) => {
|
|
111
|
-
|
|
112
|
-
if (
|
|
113
|
-
toastId.current === null ||
|
|
114
|
-
!toast.isActive(toastId.current)
|
|
115
|
-
) {
|
|
116
|
-
toastId.current = toast(`File Upload in Progress`, {
|
|
117
|
-
progress,
|
|
118
|
-
});
|
|
119
|
-
} else {
|
|
120
|
-
toast.update(toastId.current, { progress });
|
|
121
|
-
}
|
|
112
|
+
console.info(`Upload Progress: ${progress}`);
|
|
122
113
|
},
|
|
123
114
|
}).then((response) => {
|
|
124
115
|
if (files[0].type.startsWith('image/')) {
|
|
@@ -156,7 +147,13 @@ const GenericDynamic = ({
|
|
|
156
147
|
})
|
|
157
148
|
);
|
|
158
149
|
}
|
|
159
|
-
toast.
|
|
150
|
+
toast.update(toastId, {
|
|
151
|
+
render: 'Upload successful!',
|
|
152
|
+
type: 'success',
|
|
153
|
+
isLoading: false,
|
|
154
|
+
autoClose: 5000,
|
|
155
|
+
closeButton: true,
|
|
156
|
+
});
|
|
160
157
|
});
|
|
161
158
|
} else {
|
|
162
159
|
newValue = value;
|
package/package.json
CHANGED