@akinon/projectzero 1.104.0-rc.83 → 1.104.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 +5 -233
- package/app-template/.env.example +0 -1
- package/app-template/CHANGELOG.md +325 -4954
- package/app-template/README.md +1 -25
- package/app-template/package.json +19 -19
- package/app-template/public/locales/en/checkout.json +0 -6
- package/app-template/public/locales/en/common.json +1 -42
- package/app-template/public/locales/tr/checkout.json +0 -6
- package/app-template/public/locales/tr/common.json +1 -42
- package/app-template/src/app/[commerce]/[locale]/[currency]/basket/page.tsx +82 -9
- package/app-template/src/app/[commerce]/[locale]/[currency]/landing-page/[pk]/page.tsx +1 -12
- package/app-template/src/assets/fonts/pz-icon.css +0 -3
- package/app-template/src/components/__tests__/link.test.tsx +0 -2
- package/app-template/src/components/accordion.tsx +19 -22
- package/app-template/src/components/file-input.tsx +7 -27
- package/app-template/src/components/input.tsx +2 -9
- package/app-template/src/components/modal.tsx +16 -32
- package/app-template/src/components/pagination.tsx +0 -1
- package/app-template/src/components/price.tsx +1 -1
- package/app-template/src/components/select.tsx +26 -38
- package/app-template/src/components/types/index.ts +1 -25
- package/app-template/src/hooks/index.ts +0 -2
- package/app-template/src/plugins.js +1 -3
- package/app-template/src/settings.js +1 -6
- package/app-template/src/types/index.ts +0 -17
- package/app-template/src/views/account/address-form.tsx +4 -8
- package/app-template/src/views/account/contact-form.tsx +1 -1
- package/app-template/src/views/account/content-header.tsx +2 -2
- package/app-template/src/views/account/faq/faq-tabs.tsx +2 -8
- package/app-template/src/views/basket/basket-item.tsx +14 -22
- package/app-template/src/views/basket/summary.tsx +7 -10
- package/app-template/src/views/breadcrumb.tsx +2 -2
- package/app-template/src/views/category/category-info.tsx +0 -1
- package/app-template/src/views/category/filters/index.tsx +1 -1
- package/app-template/src/views/checkout/summary.tsx +0 -10
- package/app-template/src/views/guest-login/index.tsx +1 -6
- package/app-template/src/views/header/search/index.tsx +5 -17
- package/app-template/src/views/product/product-info.tsx +263 -62
- package/app-template/src/views/product/slider.tsx +73 -86
- package/app-template/src/widgets/footer-menu.tsx +2 -6
- package/commands/plugins.ts +16 -63
- package/dist/commands/plugins.js +16 -57
- package/package.json +1 -1
- package/app-template/src/app/[commerce]/[locale]/[currency]/product/[pk]/loading.tsx +0 -67
- package/app-template/src/app/api/image-proxy/route.ts +0 -1
- package/app-template/src/app/api/similar-product-list/route.ts +0 -1
- package/app-template/src/app/api/similar-products/route.ts +0 -1
- package/app-template/src/hooks/use-product-cart.ts +0 -77
- package/app-template/src/hooks/use-stock-alert.ts +0 -74
- package/app-template/src/utils/variant-validation.ts +0 -41
- package/app-template/src/views/basket/basket-content.tsx +0 -106
- package/app-template/src/views/checkout/steps/payment/options/store-credit.tsx +0 -121
- package/app-template/src/views/product/product-actions.tsx +0 -165
- package/app-template/src/views/product/product-share.tsx +0 -56
- package/app-template/src/views/product/product-variants.tsx +0 -26
|
@@ -14,18 +14,14 @@ const Select = forwardRef<HTMLSelectElement, SelectProps>((props, ref) => {
|
|
|
14
14
|
error,
|
|
15
15
|
label,
|
|
16
16
|
required = false,
|
|
17
|
-
labelClassName,
|
|
18
17
|
...rest
|
|
19
18
|
} = props;
|
|
20
19
|
|
|
21
20
|
return (
|
|
22
21
|
<label
|
|
23
|
-
className={
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}),
|
|
27
|
-
labelClassName
|
|
28
|
-
)}
|
|
22
|
+
className={clsx('flex flex-col relative text-xs text-gray-800', {
|
|
23
|
+
'pl-7': icon
|
|
24
|
+
})}
|
|
29
25
|
>
|
|
30
26
|
{icon && (
|
|
31
27
|
<Icon
|
|
@@ -36,40 +32,32 @@ const Select = forwardRef<HTMLSelectElement, SelectProps>((props, ref) => {
|
|
|
36
32
|
)}
|
|
37
33
|
|
|
38
34
|
{label && (
|
|
39
|
-
<span className=
|
|
35
|
+
<span className="mb-1">
|
|
40
36
|
{label} {required && <span className="text-secondary">*</span>}
|
|
41
37
|
</span>
|
|
42
38
|
)}
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
))}
|
|
66
|
-
</select>
|
|
67
|
-
<div className="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700">
|
|
68
|
-
<svg className="h-4 w-4 fill-current" viewBox="0 0 20 20">
|
|
69
|
-
<path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z" />
|
|
70
|
-
</svg>
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
39
|
+
<select
|
|
40
|
+
{...rest}
|
|
41
|
+
ref={ref}
|
|
42
|
+
className={twMerge(
|
|
43
|
+
clsx(
|
|
44
|
+
'cursor-pointer truncate h-10 w-40 px-2.5 shrink-0 outline-none',
|
|
45
|
+
!borderless &&
|
|
46
|
+
'border border-gray-200 transition-all duration-150 hover:border-primary'
|
|
47
|
+
),
|
|
48
|
+
className
|
|
49
|
+
)}
|
|
50
|
+
>
|
|
51
|
+
{options?.map((option) => (
|
|
52
|
+
<option
|
|
53
|
+
key={option.value}
|
|
54
|
+
value={option.value}
|
|
55
|
+
className={option.class}
|
|
56
|
+
>
|
|
57
|
+
{option.label}
|
|
58
|
+
</option>
|
|
59
|
+
))}
|
|
60
|
+
</select>
|
|
73
61
|
{error && (
|
|
74
62
|
<span className="mt-1 text-sm text-error">{error.message}</span>
|
|
75
63
|
)}
|
|
@@ -29,13 +29,7 @@ export interface PaginationProps {
|
|
|
29
29
|
isLoading?: boolean;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export
|
|
33
|
-
fileClassName?: string;
|
|
34
|
-
fileNameWrapperClassName?: string;
|
|
35
|
-
fileInputClassName?: string;
|
|
36
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
37
|
-
buttonClassName?: string;
|
|
38
|
-
}
|
|
32
|
+
export type FileInputProps = React.HTMLProps<HTMLInputElement>;
|
|
39
33
|
|
|
40
34
|
export type RadioProps = React.HTMLProps<HTMLInputElement>;
|
|
41
35
|
|
|
@@ -64,7 +58,6 @@ export interface SelectProps extends React.HTMLProps<HTMLSelectElement> {
|
|
|
64
58
|
iconSize?: number;
|
|
65
59
|
error?: FieldError | undefined;
|
|
66
60
|
required?: boolean;
|
|
67
|
-
labelClassName?: string;
|
|
68
61
|
}
|
|
69
62
|
export interface IconProps extends React.ComponentPropsWithRef<'i'> {
|
|
70
63
|
name: string;
|
|
@@ -98,20 +91,3 @@ export interface BadgeProps {
|
|
|
98
91
|
children: ReactNode;
|
|
99
92
|
className?: string;
|
|
100
93
|
}
|
|
101
|
-
|
|
102
|
-
export type AccordionProps = {
|
|
103
|
-
isCollapse?: boolean;
|
|
104
|
-
collapseClassName?: string;
|
|
105
|
-
title?: string;
|
|
106
|
-
subTitle?: string;
|
|
107
|
-
icons?: string[];
|
|
108
|
-
iconSize?: number;
|
|
109
|
-
iconColor?: string;
|
|
110
|
-
children?: ReactNode;
|
|
111
|
-
headerClassName?: string;
|
|
112
|
-
className?: string;
|
|
113
|
-
titleClassName?: string;
|
|
114
|
-
subTitleClassName?: string;
|
|
115
|
-
dataTestId?: string;
|
|
116
|
-
contentClassName?: string;
|
|
117
|
-
};
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
const { LocaleUrlStrategy } = require('@akinon/next/localization');
|
|
2
2
|
const { ROUTES } = require('@theme/routes');
|
|
3
3
|
|
|
4
|
-
/* IMPORTANT *
|
|
5
|
-
* In order to use one locale in the locales array and hide the default locale in the URL, you need to set the localeUrlStrategy to LocaleUrlStrategy.ShowAllLocales.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
4
|
const commerceUrl = encodeURI(process.env.SERVICE_BACKEND_URL ?? 'default');
|
|
9
5
|
|
|
10
6
|
/** @type {import('@akinon/next/types').Settings} */
|
|
@@ -18,7 +14,6 @@ module.exports = {
|
|
|
18
14
|
{ translationKey: 'size', key: 'size' }
|
|
19
15
|
],
|
|
20
16
|
localization: {
|
|
21
|
-
// If there is one locale in the locales array, the default locale will be hidden in the URL.
|
|
22
17
|
locales: [
|
|
23
18
|
{
|
|
24
19
|
label: 'EN',
|
|
@@ -46,7 +41,7 @@ module.exports = {
|
|
|
46
41
|
}
|
|
47
42
|
],
|
|
48
43
|
defaultLocaleValue: 'en',
|
|
49
|
-
localeUrlStrategy: LocaleUrlStrategy.HideDefaultLocale,
|
|
44
|
+
localeUrlStrategy: LocaleUrlStrategy.HideDefaultLocale,
|
|
50
45
|
redirectToDefaultLocale: true,
|
|
51
46
|
defaultCurrencyCode: 'usd'
|
|
52
47
|
},
|
|
@@ -125,20 +125,3 @@ export interface SeoProps {
|
|
|
125
125
|
ogPriceAmount?: string;
|
|
126
126
|
ogPriceCurrency?: string;
|
|
127
127
|
}
|
|
128
|
-
|
|
129
|
-
export interface ModalProps {
|
|
130
|
-
portalId: string;
|
|
131
|
-
children?: React.ReactNode;
|
|
132
|
-
open?: boolean;
|
|
133
|
-
setOpen?: (open: boolean) => void;
|
|
134
|
-
title?: React.ReactNode;
|
|
135
|
-
showCloseButton?: React.ReactNode;
|
|
136
|
-
className?: string;
|
|
137
|
-
overlayClassName?: string;
|
|
138
|
-
headerWrapperClassName?: string;
|
|
139
|
-
titleClassName?: string;
|
|
140
|
-
closeButtonClassName?: string;
|
|
141
|
-
iconName?: string;
|
|
142
|
-
iconSize?: number;
|
|
143
|
-
iconClassName?: string;
|
|
144
|
-
}
|
|
@@ -259,25 +259,23 @@ export const AddressForm = (props: Props) => {
|
|
|
259
259
|
{/* TODO: Fix select and textarea components */}
|
|
260
260
|
|
|
261
261
|
<Select
|
|
262
|
-
className="w-full border-gray-500 text-sm"
|
|
262
|
+
className="w-full border-gray-500 text-sm mt-2"
|
|
263
263
|
options={countryOptions}
|
|
264
264
|
{...register('country')}
|
|
265
265
|
error={errors.country}
|
|
266
266
|
data-testid="address-form-country"
|
|
267
267
|
label={t('account.address_book.form.country.title')}
|
|
268
|
-
labelClassName="mb-3"
|
|
269
268
|
required
|
|
270
269
|
/>
|
|
271
270
|
|
|
272
271
|
{city && (
|
|
273
272
|
<Select
|
|
274
|
-
className="w-full border-gray-500 text-sm"
|
|
273
|
+
className="w-full border-gray-500 text-sm mt-2"
|
|
275
274
|
options={cityOptions}
|
|
276
275
|
{...register('city')}
|
|
277
276
|
error={errors.city}
|
|
278
277
|
data-testid="address-form-city"
|
|
279
278
|
label={t('account.address_book.form.province.title')}
|
|
280
|
-
labelClassName="mb-3"
|
|
281
279
|
required
|
|
282
280
|
/>
|
|
283
281
|
)}
|
|
@@ -285,26 +283,24 @@ export const AddressForm = (props: Props) => {
|
|
|
285
283
|
<div className="flex gap-4">
|
|
286
284
|
<div className="flex-1">
|
|
287
285
|
<Select
|
|
288
|
-
className="w-full border-gray-500 text-sm"
|
|
286
|
+
className="w-full border-gray-500 text-sm mt-2"
|
|
289
287
|
options={townshipOptions}
|
|
290
288
|
{...register('township')}
|
|
291
289
|
error={errors.township}
|
|
292
290
|
data-testid="address-form-township"
|
|
293
291
|
label={t('account.address_book.form.township.title')}
|
|
294
|
-
labelClassName="mb-3"
|
|
295
292
|
required
|
|
296
293
|
/>
|
|
297
294
|
</div>
|
|
298
295
|
{district && (
|
|
299
296
|
<div className="flex-1">
|
|
300
297
|
<Select
|
|
301
|
-
className="w-full border-gray-500 text-sm"
|
|
298
|
+
className="w-full border-gray-500 text-sm mt-2"
|
|
302
299
|
options={districtOptions}
|
|
303
300
|
{...register('district')}
|
|
304
301
|
error={errors.district}
|
|
305
302
|
data-testid="address-form-district"
|
|
306
303
|
label={t('account.address_book.form.district.title')}
|
|
307
|
-
labelClassName="mb-3"
|
|
308
304
|
required
|
|
309
305
|
/>
|
|
310
306
|
</div>
|
|
@@ -111,7 +111,7 @@ const ContactForm = () => {
|
|
|
111
111
|
resolver: yupResolver(contactFormSchema(t))
|
|
112
112
|
});
|
|
113
113
|
|
|
114
|
-
const onSubmit: SubmitHandler<ContactFormType> = (data) => {
|
|
114
|
+
const onSubmit: SubmitHandler<ContactFormType> = (data, event) => {
|
|
115
115
|
const formData = new FormData();
|
|
116
116
|
|
|
117
117
|
Object.keys(data ?? {}).forEach((key) => {
|
|
@@ -31,13 +31,13 @@ export const ContentHeader = (props: Props) => {
|
|
|
31
31
|
</h3>
|
|
32
32
|
<Select
|
|
33
33
|
onChange={handleChange}
|
|
34
|
-
className="w-full mb-4 md:mb-0 md:w-56 text-xs"
|
|
34
|
+
className="w-full mb-4 md:mb-0 md:w-56 md:mr-4 text-xs"
|
|
35
35
|
options={orders}
|
|
36
36
|
data-testid="account-orders-header-select"
|
|
37
37
|
></Select>
|
|
38
38
|
<Button
|
|
39
39
|
className={clsx(
|
|
40
|
-
'w-full md:w-56
|
|
40
|
+
'w-full md:w-56',
|
|
41
41
|
isButtonDisabled &&
|
|
42
42
|
'hover:bg-black hover:text-white disabled:opacity-75'
|
|
43
43
|
)}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { Accordion, LoaderSpinner, TabPanel, Tabs } from '@theme/components';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { useGetWidgetQuery } from '@akinon/next/data/client/misc';
|
|
6
|
-
import { useLocalization } from '@akinon/next/hooks';
|
|
7
6
|
|
|
8
7
|
interface Props {
|
|
9
8
|
searchKey?: string;
|
|
@@ -12,7 +11,6 @@ interface Props {
|
|
|
12
11
|
export function FaqTabs(props: Props) {
|
|
13
12
|
const { searchKey } = props;
|
|
14
13
|
const { data, isLoading } = useGetWidgetQuery('faq');
|
|
15
|
-
const { locale } = useLocalization();
|
|
16
14
|
|
|
17
15
|
if (isLoading) {
|
|
18
16
|
return <LoaderSpinner className="mt-4" />;
|
|
@@ -31,12 +29,8 @@ export function FaqTabs(props: Props) {
|
|
|
31
29
|
{data?.attributes?.faq_contents
|
|
32
30
|
?.filter(
|
|
33
31
|
(faq) =>
|
|
34
|
-
faq.value.content
|
|
35
|
-
|
|
36
|
-
.includes(searchKey) ||
|
|
37
|
-
faq.value.title
|
|
38
|
-
.toLocaleLowerCase(locale)
|
|
39
|
-
.includes(searchKey)
|
|
32
|
+
faq.value.content.toLocaleLowerCase().includes(searchKey) ||
|
|
33
|
+
faq.value.title.toLocaleLowerCase().includes(searchKey)
|
|
40
34
|
)
|
|
41
35
|
.map((faq, index) => {
|
|
42
36
|
if (faq.value.category == item.value.category_id) {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
useUpdateQuantityMutation
|
|
4
4
|
} from '@akinon/next/data/client/basket';
|
|
5
5
|
import { useAppDispatch } from '@akinon/next/redux/hooks';
|
|
6
|
-
import {
|
|
6
|
+
import { BasketItem as BasketItemType } from '@akinon/next/types';
|
|
7
7
|
import { Price, Button, Icon, Modal, Select, Link } from '@theme/components';
|
|
8
8
|
import { useState } from 'react';
|
|
9
9
|
import { useAddFavoriteMutation } from '@akinon/next/data/client/wishlist';
|
|
@@ -19,12 +19,11 @@ import { pushRemoveFromCart } from '@theme/utils/gtm';
|
|
|
19
19
|
interface Props {
|
|
20
20
|
basketItem?: BasketItemType;
|
|
21
21
|
namespace?: string;
|
|
22
|
-
onBasketUpdate?: (basket: Basket) => void;
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
export const BasketItem = (props: Props) => {
|
|
26
25
|
const { t } = useLocalization();
|
|
27
|
-
const { basketItem, namespace
|
|
26
|
+
const { basketItem, namespace } = props;
|
|
28
27
|
const [updateQuantityMutation] = useUpdateQuantityMutation();
|
|
29
28
|
const dispatch = useAppDispatch();
|
|
30
29
|
const [isRemoveBasketModalOpen, setRemoveBasketModalOpen] = useState(false);
|
|
@@ -40,12 +39,7 @@ export const BasketItem = (props: Props) => {
|
|
|
40
39
|
quantity: number,
|
|
41
40
|
attributes: object = {}
|
|
42
41
|
) => {
|
|
43
|
-
const requestParams: {
|
|
44
|
-
product: number;
|
|
45
|
-
quantity: number;
|
|
46
|
-
attributes: object;
|
|
47
|
-
namespace?: string;
|
|
48
|
-
} = {
|
|
42
|
+
const requestParams: any = {
|
|
49
43
|
product: productPk,
|
|
50
44
|
quantity,
|
|
51
45
|
attributes
|
|
@@ -55,21 +49,19 @@ export const BasketItem = (props: Props) => {
|
|
|
55
49
|
requestParams.namespace = namespace;
|
|
56
50
|
}
|
|
57
51
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
52
|
+
await updateQuantityMutation(requestParams)
|
|
53
|
+
.unwrap()
|
|
54
|
+
.then((data) =>
|
|
55
|
+
dispatch(
|
|
56
|
+
basketApi.util.updateQueryData(
|
|
57
|
+
'getBasket',
|
|
58
|
+
undefined,
|
|
59
|
+
(draftBasket) => {
|
|
60
|
+
Object.assign(draftBasket, data.basket);
|
|
61
|
+
}
|
|
62
|
+
)
|
|
67
63
|
)
|
|
68
64
|
);
|
|
69
|
-
onBasketUpdate?.(response.basket);
|
|
70
|
-
} catch (error) {
|
|
71
|
-
console.error('Error updating quantity:', error);
|
|
72
|
-
}
|
|
73
65
|
};
|
|
74
66
|
|
|
75
67
|
const deleteProduct = async (productPk?: number) => {
|
|
@@ -18,7 +18,6 @@ import clsx from 'clsx';
|
|
|
18
18
|
|
|
19
19
|
interface Props {
|
|
20
20
|
basket: Basket;
|
|
21
|
-
onBasketUpdate?: (basket: Basket) => void;
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
const voucherCodeFormSchema = (t) =>
|
|
@@ -28,7 +27,7 @@ const voucherCodeFormSchema = (t) =>
|
|
|
28
27
|
|
|
29
28
|
export const Summary = (props: Props) => {
|
|
30
29
|
const { t } = useLocalization();
|
|
31
|
-
const { basket
|
|
30
|
+
const { basket } = props;
|
|
32
31
|
const router = useRouter();
|
|
33
32
|
const {
|
|
34
33
|
register,
|
|
@@ -54,7 +53,7 @@ export const Summary = (props: Props) => {
|
|
|
54
53
|
const removeVoucherCode = () => {
|
|
55
54
|
removeVoucherCodeMutation()
|
|
56
55
|
.unwrap()
|
|
57
|
-
.then((basket) =>
|
|
56
|
+
.then((basket) =>
|
|
58
57
|
dispatch(
|
|
59
58
|
basketApi.util.updateQueryData(
|
|
60
59
|
'getBasket',
|
|
@@ -63,9 +62,8 @@ export const Summary = (props: Props) => {
|
|
|
63
62
|
Object.assign(draftBasket, basket);
|
|
64
63
|
}
|
|
65
64
|
)
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
})
|
|
65
|
+
)
|
|
66
|
+
)
|
|
69
67
|
.catch((error: Error) => {
|
|
70
68
|
setError('voucherCode', { message: error.data.non_field_errors });
|
|
71
69
|
});
|
|
@@ -76,7 +74,7 @@ export const Summary = (props: Props) => {
|
|
|
76
74
|
voucher_code: data.voucherCode
|
|
77
75
|
})
|
|
78
76
|
.unwrap()
|
|
79
|
-
.then((basket) =>
|
|
77
|
+
.then((basket) =>
|
|
80
78
|
dispatch(
|
|
81
79
|
basketApi.util.updateQueryData(
|
|
82
80
|
'getBasket',
|
|
@@ -85,9 +83,8 @@ export const Summary = (props: Props) => {
|
|
|
85
83
|
Object.assign(draftBasket, basket);
|
|
86
84
|
}
|
|
87
85
|
)
|
|
88
|
-
)
|
|
89
|
-
|
|
90
|
-
})
|
|
86
|
+
)
|
|
87
|
+
)
|
|
91
88
|
.catch((error: Error) => {
|
|
92
89
|
setError('voucherCode', { message: error.data.non_field_errors });
|
|
93
90
|
});
|
|
@@ -12,7 +12,7 @@ export interface BreadcrumbProps {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export default function Breadcrumb(props: BreadcrumbProps) {
|
|
15
|
-
const { t
|
|
15
|
+
const { t } = useLocalization();
|
|
16
16
|
const { breadcrumbList = [] } = props;
|
|
17
17
|
|
|
18
18
|
const list = [
|
|
@@ -28,7 +28,7 @@ export default function Breadcrumb(props: BreadcrumbProps) {
|
|
|
28
28
|
{list.map((item, index) => (
|
|
29
29
|
<Fragment key={index}>
|
|
30
30
|
<Link href={item.url}>
|
|
31
|
-
{capitalize(item.text.toLocaleLowerCase(
|
|
31
|
+
{capitalize(item.text.toLocaleLowerCase())}
|
|
32
32
|
</Link>
|
|
33
33
|
{index !== list.length - 1 && <Icon name="chevron-end" size={8} />}
|
|
34
34
|
</Fragment>
|
|
@@ -57,7 +57,6 @@ export default function ListPage(props: ListPageProps) {
|
|
|
57
57
|
newUrl.searchParams.delete('page');
|
|
58
58
|
router.push(newUrl.pathname + newUrl.search, undefined);
|
|
59
59
|
}
|
|
60
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
61
60
|
}, [searchParams, data.products, page]);
|
|
62
61
|
|
|
63
62
|
const { t } = useLocalization();
|
|
@@ -6,7 +6,7 @@ import { useLocalization } from '@akinon/next/hooks';
|
|
|
6
6
|
import { useAppDispatch, useAppSelector } from '@akinon/next/redux/hooks';
|
|
7
7
|
import { resetSelectedFacets } from '@theme/redux/reducers/category';
|
|
8
8
|
import CategoryActiveFilters from '@theme/views/category/category-active-filters';
|
|
9
|
-
import { useMemo, useTransition } from 'react';
|
|
9
|
+
import { useMemo, useState, useTransition } from 'react';
|
|
10
10
|
import { FilterItem } from './filter-item';
|
|
11
11
|
|
|
12
12
|
interface Props {
|
|
@@ -8,7 +8,6 @@ import PluginModule, { Component } from '@akinon/next/components/plugin-module';
|
|
|
8
8
|
import { twMerge } from 'tailwind-merge';
|
|
9
9
|
import { Image } from '@akinon/next/components/image';
|
|
10
10
|
import { Trans } from '@akinon/next/components/trans';
|
|
11
|
-
import { StoreCredits } from './steps/payment/options/store-credit';
|
|
12
11
|
|
|
13
12
|
export const Summary = () => {
|
|
14
13
|
const { t } = useLocalization();
|
|
@@ -39,7 +38,6 @@ export const Summary = () => {
|
|
|
39
38
|
'flex flex-col w-full mb-4 border border-solid border-gray-400'
|
|
40
39
|
}}
|
|
41
40
|
/>
|
|
42
|
-
<StoreCredits />
|
|
43
41
|
<div className="flex flex-col w-full border border-solid border-gray-400">
|
|
44
42
|
<div className="flex justify-between items-center flex-row border-b border-solid border-gray-400 px-4 py-2 sm:px-5 sm:py-4 sm:min-h-15">
|
|
45
43
|
<span className="text-black-800 text-xl font-light sm:text-2xl">
|
|
@@ -120,14 +118,6 @@ export const Summary = () => {
|
|
|
120
118
|
<Price value={preOrder?.shipping_amount} />
|
|
121
119
|
</span>
|
|
122
120
|
</div>
|
|
123
|
-
{parseFloat(preOrder?.loyalty_money) > 0 && (
|
|
124
|
-
<div className="flex items-center justify-between w-full text-xs text-black-800 py-1 px-4 sm:px-5">
|
|
125
|
-
<span>{t('checkout.summary.loyalty_money_total')}</span>
|
|
126
|
-
<span>
|
|
127
|
-
<Price value={preOrder?.loyalty_money} />
|
|
128
|
-
</span>
|
|
129
|
-
</div>
|
|
130
|
-
)}
|
|
131
121
|
<div className="flex items-center justify-between w-full text-xs text-black-800 py-1 px-4 sm:px-5">
|
|
132
122
|
<span>{t('checkout.summary.discounts_total')}</span>
|
|
133
123
|
<span>
|
|
@@ -51,14 +51,9 @@ const GuestLogin = () => {
|
|
|
51
51
|
).unwrap();
|
|
52
52
|
|
|
53
53
|
Object.keys(response?.errors || {}).forEach((key) => {
|
|
54
|
-
const errorValue = response?.errors[key];
|
|
55
|
-
const message = Array.isArray(errorValue)
|
|
56
|
-
? errorValue.join(', ')
|
|
57
|
-
: errorValue || '';
|
|
58
|
-
|
|
59
54
|
setError(key as keyof GuestLoginFormParams, {
|
|
60
55
|
type: 'custom',
|
|
61
|
-
message
|
|
56
|
+
message: response?.errors[key]?.join(', ')
|
|
62
57
|
});
|
|
63
58
|
});
|
|
64
59
|
} catch (error) {
|
|
@@ -4,11 +4,11 @@ import { useEffect, useRef, useState } from 'react';
|
|
|
4
4
|
import { useAppDispatch, useAppSelector } from '@akinon/next/redux/hooks';
|
|
5
5
|
import { closeSearch } from '@akinon/next/redux/reducers/header';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
import { Icon } from '@theme/components';
|
|
8
9
|
import Results from './results';
|
|
9
10
|
import { ROUTES } from '@theme/routes';
|
|
10
11
|
import { useLocalization, useRouter } from '@akinon/next/hooks';
|
|
11
|
-
import PluginModule, { Component } from '@akinon/next/components/plugin-module';
|
|
12
12
|
|
|
13
13
|
export default function Search() {
|
|
14
14
|
const { t } = useLocalization();
|
|
@@ -41,14 +41,6 @@ export default function Search() {
|
|
|
41
41
|
};
|
|
42
42
|
}, [isSearchOpen, dispatch]);
|
|
43
43
|
|
|
44
|
-
const handleSearchTextChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
45
|
-
setSearchText(e.target.value);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const handleCloseSearch = () => {
|
|
49
|
-
dispatch(closeSearch());
|
|
50
|
-
};
|
|
51
|
-
|
|
52
44
|
return (
|
|
53
45
|
<>
|
|
54
46
|
<div
|
|
@@ -74,9 +66,9 @@ export default function Search() {
|
|
|
74
66
|
{t('common.search.results_for')}
|
|
75
67
|
</span>
|
|
76
68
|
<div className="flex items-center">
|
|
77
|
-
<
|
|
69
|
+
<input
|
|
78
70
|
value={searchText}
|
|
79
|
-
onChange={
|
|
71
|
+
onChange={(e) => setSearchText(e.target.value)}
|
|
80
72
|
onKeyDown={(e) => {
|
|
81
73
|
if (e.key === 'Enter' && searchText.trim() !== '') {
|
|
82
74
|
router.push(`${ROUTES.LIST}/?search_text=${searchText}`);
|
|
@@ -86,18 +78,14 @@ export default function Search() {
|
|
|
86
78
|
placeholder={t('common.search.placeholder')}
|
|
87
79
|
ref={inputRef}
|
|
88
80
|
/>
|
|
89
|
-
|
|
90
|
-
<PluginModule component={Component.HeaderImageSearchFeature} />
|
|
91
|
-
|
|
92
81
|
<Icon
|
|
93
82
|
name="close"
|
|
94
83
|
size={14}
|
|
95
|
-
onClick={
|
|
84
|
+
onClick={() => dispatch(closeSearch())}
|
|
96
85
|
className="cursor-pointer"
|
|
97
86
|
/>
|
|
98
87
|
</div>
|
|
99
88
|
</div>
|
|
100
|
-
|
|
101
89
|
<Results searchText={searchText} />
|
|
102
90
|
</div>
|
|
103
91
|
</div>
|