@akinon/projectzero 1.65.0 → 1.66.0
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
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# projectzeronext
|
|
2
2
|
|
|
3
|
+
## 1.66.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
|
|
8
|
+
- 2e6104d: ZERO-2888:Edit the numbering in the pagination and the visibility of the prev and next buttons
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies [572d2e8]
|
|
13
|
+
- Updated dependencies [2e6104d]
|
|
14
|
+
- Updated dependencies [7b05522]
|
|
15
|
+
- Updated dependencies [29ead87]
|
|
16
|
+
- Updated dependencies [12a873e]
|
|
17
|
+
- Updated dependencies [f2c325c]
|
|
18
|
+
- @akinon/next@1.66.0
|
|
19
|
+
- @akinon/pz-otp@1.66.0
|
|
20
|
+
- @akinon/pz-akifast@1.66.0
|
|
21
|
+
- @akinon/pz-b2b@1.66.0
|
|
22
|
+
- @akinon/pz-basket-gift-pack@1.66.0
|
|
23
|
+
- @akinon/pz-bkm@1.66.0
|
|
24
|
+
- @akinon/pz-checkout-gift-pack@1.66.0
|
|
25
|
+
- @akinon/pz-click-collect@1.66.0
|
|
26
|
+
- @akinon/pz-credit-payment@1.66.0
|
|
27
|
+
- @akinon/pz-gpay@1.66.0
|
|
28
|
+
- @akinon/pz-masterpass@1.66.0
|
|
29
|
+
- @akinon/pz-one-click-checkout@1.66.0
|
|
30
|
+
- @akinon/pz-pay-on-delivery@1.66.0
|
|
31
|
+
- @akinon/pz-saved-card@1.66.0
|
|
32
|
+
- @akinon/pz-tabby-extension@1.66.0
|
|
33
|
+
|
|
3
34
|
## 1.65.0
|
|
4
35
|
|
|
5
36
|
### Minor Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "projectzeronext",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.66.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -22,21 +22,21 @@
|
|
|
22
22
|
"prestart": "pz-prestart"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@akinon/next": "1.
|
|
26
|
-
"@akinon/pz-akifast": "1.
|
|
27
|
-
"@akinon/pz-b2b": "1.
|
|
28
|
-
"@akinon/pz-basket-gift-pack": "1.
|
|
29
|
-
"@akinon/pz-bkm": "1.
|
|
30
|
-
"@akinon/pz-checkout-gift-pack": "1.
|
|
31
|
-
"@akinon/pz-click-collect": "1.
|
|
32
|
-
"@akinon/pz-credit-payment": "1.
|
|
33
|
-
"@akinon/pz-gpay": "1.
|
|
34
|
-
"@akinon/pz-masterpass": "1.
|
|
35
|
-
"@akinon/pz-one-click-checkout": "1.
|
|
36
|
-
"@akinon/pz-otp": "1.
|
|
37
|
-
"@akinon/pz-pay-on-delivery": "1.
|
|
38
|
-
"@akinon/pz-saved-card": "1.
|
|
39
|
-
"@akinon/pz-tabby-extension": "1.
|
|
25
|
+
"@akinon/next": "1.66.0",
|
|
26
|
+
"@akinon/pz-akifast": "1.66.0",
|
|
27
|
+
"@akinon/pz-b2b": "1.66.0",
|
|
28
|
+
"@akinon/pz-basket-gift-pack": "1.66.0",
|
|
29
|
+
"@akinon/pz-bkm": "1.66.0",
|
|
30
|
+
"@akinon/pz-checkout-gift-pack": "1.66.0",
|
|
31
|
+
"@akinon/pz-click-collect": "1.66.0",
|
|
32
|
+
"@akinon/pz-credit-payment": "1.66.0",
|
|
33
|
+
"@akinon/pz-gpay": "1.66.0",
|
|
34
|
+
"@akinon/pz-masterpass": "1.66.0",
|
|
35
|
+
"@akinon/pz-one-click-checkout": "1.66.0",
|
|
36
|
+
"@akinon/pz-otp": "1.66.0",
|
|
37
|
+
"@akinon/pz-pay-on-delivery": "1.66.0",
|
|
38
|
+
"@akinon/pz-saved-card": "1.66.0",
|
|
39
|
+
"@akinon/pz-tabby-extension": "1.66.0",
|
|
40
40
|
"@hookform/resolvers": "2.9.0",
|
|
41
41
|
"@next/third-parties": "14.1.0",
|
|
42
42
|
"@react-google-maps/api": "2.17.1",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"yup": "0.32.11"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@akinon/eslint-plugin-projectzero": "1.
|
|
63
|
+
"@akinon/eslint-plugin-projectzero": "1.66.0",
|
|
64
64
|
"@semantic-release/changelog": "6.0.2",
|
|
65
65
|
"@semantic-release/exec": "6.0.3",
|
|
66
66
|
"@semantic-release/git": "10.0.1",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
2
2
|
import { PaginationProps } from '@theme/components/types';
|
|
3
3
|
import { twMerge } from 'tailwind-merge';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import {
|
|
5
|
+
import { Button } from '@theme/components';
|
|
6
6
|
import usePagination from '@akinon/next/hooks/use-pagination';
|
|
7
7
|
import { useLocalization } from '@akinon/next/hooks';
|
|
8
8
|
import { useRouter } from '@akinon/next/hooks';
|
|
@@ -92,9 +92,7 @@ export const Pagination = (props: PaginationProps) => {
|
|
|
92
92
|
}
|
|
93
93
|
}, [numberOfPages, page, pageList, threshold]);
|
|
94
94
|
|
|
95
|
-
const handleClick = (
|
|
96
|
-
e.preventDefault();
|
|
97
|
-
|
|
95
|
+
const handleClick = (url: string) => {
|
|
98
96
|
const newUrl = new URL(url, window.location.origin);
|
|
99
97
|
const page = newUrl.searchParams.get('page');
|
|
100
98
|
|
|
@@ -129,7 +127,7 @@ export const Pagination = (props: PaginationProps) => {
|
|
|
129
127
|
if (type === 'list') {
|
|
130
128
|
createListItems();
|
|
131
129
|
}
|
|
132
|
-
}, []);
|
|
130
|
+
}, [createListItems, type]);
|
|
133
131
|
|
|
134
132
|
useEffect(() => {
|
|
135
133
|
if (total && total !== paginationTotal) {
|
|
@@ -200,9 +198,8 @@ export const Pagination = (props: PaginationProps) => {
|
|
|
200
198
|
>
|
|
201
199
|
{prev && currentPage !== 1 && (
|
|
202
200
|
<li>
|
|
203
|
-
<
|
|
204
|
-
onClick={(
|
|
205
|
-
href={prev}
|
|
201
|
+
<button
|
|
202
|
+
onClick={() => handleClick(prev)}
|
|
206
203
|
className={twMerge(
|
|
207
204
|
'flex cursor-pointer text-sm px-2',
|
|
208
205
|
prevClassName
|
|
@@ -212,16 +209,15 @@ export const Pagination = (props: PaginationProps) => {
|
|
|
212
209
|
<span className="hidden lg:inline-block ms-4">
|
|
213
210
|
{t('category.pagination.previous')}
|
|
214
211
|
</span>
|
|
215
|
-
</
|
|
212
|
+
</button>
|
|
216
213
|
</li>
|
|
217
214
|
)}
|
|
218
215
|
|
|
219
216
|
{paginationItems.map((item, i) => (
|
|
220
217
|
<li key={i}>
|
|
221
218
|
{item?.url != '#' ? (
|
|
222
|
-
<
|
|
223
|
-
onClick={(
|
|
224
|
-
href={item.url}
|
|
219
|
+
<button
|
|
220
|
+
onClick={() => handleClick(item.url)}
|
|
225
221
|
className={twMerge(
|
|
226
222
|
clsx(
|
|
227
223
|
'text-xs px-2 cursor-pointer',
|
|
@@ -234,7 +230,7 @@ export const Pagination = (props: PaginationProps) => {
|
|
|
234
230
|
)}
|
|
235
231
|
>
|
|
236
232
|
{item?.page}
|
|
237
|
-
</
|
|
233
|
+
</button>
|
|
238
234
|
) : (
|
|
239
235
|
<span className="cursor-default text-xs flex items-center justify-center">
|
|
240
236
|
{item?.page}
|
|
@@ -245,9 +241,8 @@ export const Pagination = (props: PaginationProps) => {
|
|
|
245
241
|
|
|
246
242
|
{showNext && (
|
|
247
243
|
<li>
|
|
248
|
-
<
|
|
249
|
-
onClick={(
|
|
250
|
-
href={next}
|
|
244
|
+
<button
|
|
245
|
+
onClick={() => handleClick(next)}
|
|
251
246
|
className={twMerge(
|
|
252
247
|
'flex cursor-pointer text-xs px-2',
|
|
253
248
|
nextClassName
|
|
@@ -257,7 +252,7 @@ export const Pagination = (props: PaginationProps) => {
|
|
|
257
252
|
{t('category.pagination.next')}
|
|
258
253
|
</span>
|
|
259
254
|
<span>></span>
|
|
260
|
-
</
|
|
255
|
+
</button>
|
|
261
256
|
</li>
|
|
262
257
|
)}
|
|
263
258
|
</ul>
|
|
@@ -9,6 +9,7 @@ import { twMerge } from 'tailwind-merge';
|
|
|
9
9
|
import * as yup from 'yup';
|
|
10
10
|
import { useEffect, useState } from 'react';
|
|
11
11
|
import { getPosError } from '@akinon/next/utils';
|
|
12
|
+
import { useMessageListener } from '@akinon/next/hooks';
|
|
12
13
|
|
|
13
14
|
interface FormValues {
|
|
14
15
|
agreement: boolean;
|
|
@@ -25,7 +26,6 @@ const formSchema = () =>
|
|
|
25
26
|
export default function RedirectionPayment() {
|
|
26
27
|
const { payment_option } = useAppSelector((state) => state.checkout.preOrder);
|
|
27
28
|
const [formError, setFormError] = useState(null);
|
|
28
|
-
|
|
29
29
|
const {
|
|
30
30
|
register,
|
|
31
31
|
handleSubmit,
|
|
@@ -34,11 +34,12 @@ export default function RedirectionPayment() {
|
|
|
34
34
|
resolver: yupResolver(formSchema())
|
|
35
35
|
});
|
|
36
36
|
const [completeRedirectionPayment] = useCompleteRedirectionPaymentMutation();
|
|
37
|
-
|
|
38
37
|
const onSubmit = async () => {
|
|
39
38
|
completeRedirectionPayment();
|
|
40
39
|
};
|
|
41
40
|
|
|
41
|
+
useMessageListener();
|
|
42
|
+
|
|
42
43
|
useEffect(() => {
|
|
43
44
|
const posErrors = getPosError();
|
|
44
45
|
|
|
@@ -48,44 +49,49 @@ export default function RedirectionPayment() {
|
|
|
48
49
|
}, []);
|
|
49
50
|
|
|
50
51
|
return (
|
|
51
|
-
<
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<p className="px-4 md:px-0">
|
|
57
|
-
You can quickly and easily pay and complete your order with{' '}
|
|
58
|
-
{payment_option.name}.
|
|
59
|
-
</p>
|
|
60
|
-
|
|
61
|
-
<Checkbox
|
|
62
|
-
className="px-4 md:px-0"
|
|
63
|
-
{...register('agreement')}
|
|
64
|
-
error={errors.agreement}
|
|
52
|
+
<div className="checkout-redirection-payment-wrapper">
|
|
53
|
+
<form
|
|
54
|
+
onSubmit={handleSubmit(onSubmit)}
|
|
55
|
+
className="lg-5 space-y-5 lg:p-10"
|
|
65
56
|
>
|
|
66
|
-
|
|
67
|
-
|
|
57
|
+
<h1 className="text-2xl font-bold px-4 md:px-0">
|
|
58
|
+
Pay With {payment_option.name}
|
|
59
|
+
</h1>
|
|
68
60
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
<div
|
|
79
|
-
className="w-full text-xs text-start px-1 mt-3 text-error"
|
|
80
|
-
data-testid="checkout-form-error"
|
|
61
|
+
<p className="px-4 md:px-0">
|
|
62
|
+
You can quickly and easily pay and complete your order with{' '}
|
|
63
|
+
{payment_option.name}.
|
|
64
|
+
</p>
|
|
65
|
+
|
|
66
|
+
<Checkbox
|
|
67
|
+
className="px-4 md:px-0"
|
|
68
|
+
{...register('agreement')}
|
|
69
|
+
error={errors.agreement}
|
|
81
70
|
>
|
|
82
|
-
|
|
83
|
-
</
|
|
84
|
-
|
|
71
|
+
Check here to indicate that you have read and agree to the all terms.
|
|
72
|
+
</Checkbox>
|
|
73
|
+
|
|
74
|
+
{formError?.non_field_errors && (
|
|
75
|
+
<div
|
|
76
|
+
className="w-full text-xs text-start px-1 mt-3 text-error"
|
|
77
|
+
data-testid="checkout-form-error"
|
|
78
|
+
>
|
|
79
|
+
{formError.non_field_errors}
|
|
80
|
+
</div>
|
|
81
|
+
)}
|
|
82
|
+
{formError?.status && (
|
|
83
|
+
<div
|
|
84
|
+
className="w-full text-xs text-start px-1 mt-3 text-error"
|
|
85
|
+
data-testid="checkout-form-error"
|
|
86
|
+
>
|
|
87
|
+
{formError.status}
|
|
88
|
+
</div>
|
|
89
|
+
)}
|
|
85
90
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
91
|
+
<Button className={twMerge('w-full md:w-36 px-4 md:px-0')}>
|
|
92
|
+
{payment_option.name}
|
|
93
|
+
</Button>
|
|
94
|
+
</form>
|
|
95
|
+
</div>
|
|
90
96
|
);
|
|
91
97
|
}
|