@akinon/pz-saved-card 2.0.35-beta.0 → 2.0.35
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/CHANGELOG.md +1 -1
- package/package.json +1 -1
- package/src/components/card-form-section.tsx +13 -10
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Input, Select, Icon, Image } from '@akinon/next/components';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
Control,
|
|
5
|
+
FieldError,
|
|
6
|
+
FieldErrors,
|
|
7
|
+
UseFormRegister
|
|
8
|
+
} from 'react-hook-form';
|
|
4
9
|
|
|
5
10
|
export interface CardFormSectionProps {
|
|
6
11
|
register: UseFormRegister<any>;
|
|
@@ -24,7 +29,7 @@ export const CardFormSection = ({
|
|
|
24
29
|
errors,
|
|
25
30
|
months,
|
|
26
31
|
years,
|
|
27
|
-
translations = {}
|
|
32
|
+
translations = {}
|
|
28
33
|
}: CardFormSectionProps) => {
|
|
29
34
|
return (
|
|
30
35
|
<div className="w-full bg-white">
|
|
@@ -33,7 +38,7 @@ export const CardFormSection = ({
|
|
|
33
38
|
<Input
|
|
34
39
|
label={translations.cardHolder}
|
|
35
40
|
{...register('card_holder')}
|
|
36
|
-
error={errors.card_holder}
|
|
41
|
+
error={errors.card_holder as FieldError}
|
|
37
42
|
/>
|
|
38
43
|
</div>
|
|
39
44
|
|
|
@@ -48,7 +53,7 @@ export const CardFormSection = ({
|
|
|
48
53
|
allowEmptyFormatting={true}
|
|
49
54
|
control={control}
|
|
50
55
|
{...register('card_number')}
|
|
51
|
-
error={errors.card_number}
|
|
56
|
+
error={errors.card_number as FieldError}
|
|
52
57
|
/>
|
|
53
58
|
</div>
|
|
54
59
|
|
|
@@ -67,7 +72,7 @@ export const CardFormSection = ({
|
|
|
67
72
|
className="w-full text-xs border-gray-400 sm:text-sm"
|
|
68
73
|
options={months}
|
|
69
74
|
{...register('card_month')}
|
|
70
|
-
error={errors.card_month}
|
|
75
|
+
error={errors.card_month as FieldError}
|
|
71
76
|
/>
|
|
72
77
|
</div>
|
|
73
78
|
|
|
@@ -76,7 +81,7 @@ export const CardFormSection = ({
|
|
|
76
81
|
className="w-full text-xs border-gray-400 sm:text-sm"
|
|
77
82
|
options={years}
|
|
78
83
|
{...register('card_year')}
|
|
79
|
-
error={errors.card_year}
|
|
84
|
+
error={errors.card_year as FieldError}
|
|
80
85
|
/>
|
|
81
86
|
</div>
|
|
82
87
|
</div>
|
|
@@ -95,12 +100,10 @@ export const CardFormSection = ({
|
|
|
95
100
|
control={control}
|
|
96
101
|
allowEmptyFormatting={true}
|
|
97
102
|
{...register('card_cvv')}
|
|
98
|
-
error={errors.card_cvv}
|
|
103
|
+
error={errors.card_cvv as FieldError}
|
|
99
104
|
/>
|
|
100
105
|
<div className="group relative flex items-center justify-start text-gray-600 cursor-pointer mt-2 transition-all hover:text-secondary">
|
|
101
|
-
<span className="text-xs underline">
|
|
102
|
-
{translations.cvv}
|
|
103
|
-
</span>
|
|
106
|
+
<span className="text-xs underline">{translations.cvv}</span>
|
|
104
107
|
<Icon name="cvc" size={16} className="leading-none ml-2" />
|
|
105
108
|
<div className="hidden group-hover:block absolute right-0 bottom-5 w-[11rem] lg:w-[21rem] lg:left-auto lg:right-auto border-2">
|
|
106
109
|
<Image src="/cvv.jpg" alt="Cvv" width={385} height={264} />
|