@open-tender/utils 0.1.42 → 0.1.43
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.
|
@@ -17,7 +17,7 @@ const useCreditCard = (initState, cardErrors = {}, disabled = false) => {
|
|
|
17
17
|
const [cardType, setCardType] = (0, react_1.useState)(initCardType || 'OTHER');
|
|
18
18
|
const [errors, setErrors] = (0, react_1.useState)(cardErrors);
|
|
19
19
|
const { acct, exp, cvv, zip } = data;
|
|
20
|
-
const isComplete = acct && exp && cvv && zip &&
|
|
20
|
+
const isComplete = acct && exp && cvv && zip && (0, __1.isEmpty)(errors) ? true : false;
|
|
21
21
|
const handleChange = (name, value) => {
|
|
22
22
|
if (name === 'acct') {
|
|
23
23
|
const currentType = (0, __1.getCardType)(value.replace(/\s/g, ''));
|
|
@@ -14,7 +14,7 @@ export const useCreditCard = (initState, cardErrors = {}, disabled = false) => {
|
|
|
14
14
|
const [cardType, setCardType] = useState(initCardType || 'OTHER');
|
|
15
15
|
const [errors, setErrors] = useState(cardErrors);
|
|
16
16
|
const { acct, exp, cvv, zip } = data;
|
|
17
|
-
const isComplete = acct && exp && cvv && zip &&
|
|
17
|
+
const isComplete = acct && exp && cvv && zip && isEmpty(errors) ? true : false;
|
|
18
18
|
const handleChange = (name, value) => {
|
|
19
19
|
if (name === 'acct') {
|
|
20
20
|
const currentType = getCardType(value.replace(/\s/g, ''));
|
package/package.json
CHANGED