@open-tender/utils 0.1.43 → 0.1.44

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.
@@ -22,7 +22,7 @@ export declare const useDonationsForm: (purchase: (data: DonationPurchase, callb
22
22
  value: unknown;
23
23
  }[];
24
24
  handleCreditCard: (value: string) => void;
25
- handleSubmit: () => void;
25
+ handleSubmit: (evt: React.FormEvent<HTMLFormElement>) => void;
26
26
  handleReset: () => void;
27
27
  setErrors: import("react").Dispatch<import("react").SetStateAction<Record<string, string>>>;
28
28
  };
@@ -108,8 +108,9 @@ const useDonationsForm = (purchase, reset, setAlert, loading, error, success, cu
108
108
  });
109
109
  }
110
110
  };
111
- const handleSubmit = () => {
111
+ const handleSubmit = (evt) => {
112
112
  var _a, _b, _c;
113
+ evt === null || evt === void 0 ? void 0 : evt.preventDefault();
113
114
  if (!amount || !email) {
114
115
  setErrors({ form: 'Both amount and email are required' });
115
116
  ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus) && inputRef.current.focus();
@@ -22,7 +22,7 @@ export declare const useDonationsForm: (purchase: (data: DonationPurchase, callb
22
22
  value: unknown;
23
23
  }[];
24
24
  handleCreditCard: (value: string) => void;
25
- handleSubmit: () => void;
25
+ handleSubmit: (evt: React.FormEvent<HTMLFormElement>) => void;
26
26
  handleReset: () => void;
27
27
  setErrors: import("react").Dispatch<import("react").SetStateAction<Record<string, string>>>;
28
28
  };
@@ -105,8 +105,9 @@ export const useDonationsForm = (purchase, reset, setAlert, loading, error, succ
105
105
  });
106
106
  }
107
107
  };
108
- const handleSubmit = () => {
108
+ const handleSubmit = (evt) => {
109
109
  var _a, _b, _c;
110
+ evt === null || evt === void 0 ? void 0 : evt.preventDefault();
110
111
  if (!amount || !email) {
111
112
  setErrors({ form: 'Both amount and email are required' });
112
113
  ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus) && inputRef.current.focus();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/utils",
3
- "version": "0.1.43",
3
+ "version": "0.1.44",
4
4
  "description": "A library of utils for use with Open Tender applications that utilize our cloud-based Order API.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",