@visns-studio/visns-components 3.7.10 → 3.7.12

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.
@@ -374,7 +374,10 @@ function Field({
374
374
  ) : null;
375
375
  case 'checkbox':
376
376
  return settings.options?.length > 0 ? (
377
- <div className="fi__optionscontainer">
377
+ <div
378
+ className="fi__optionscontainer"
379
+ style={{ paddingTop: '10px' }}
380
+ >
378
381
  {settings.options.map((option, index) => (
379
382
  <div
380
383
  key={`${settings.id}-checkbox-option-${index}`}
@@ -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
- // Update or show the toast based on upload progress
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.dismiss(toastId.current);
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
@@ -54,7 +54,7 @@
54
54
  "react-dom": "^17.0.1"
55
55
  },
56
56
  "name": "@visns-studio/visns-components",
57
- "version": "3.7.10",
57
+ "version": "3.7.12",
58
58
  "description": "Various packages to assist in the development of our Custom Applications.",
59
59
  "main": "index.js",
60
60
  "scripts": {