@akinon/projectzero 2.0.152-rc.3 → 2.0.152
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 -21
- package/app-template/.env.example +0 -1
- package/app-template/AGENTS.md +0 -8
- package/app-template/CHANGELOG.md +32 -184
- package/app-template/README.md +1 -25
- package/app-template/docs/plugins.md +0 -6
- package/app-template/next-env.d.ts +1 -1
- package/app-template/next.config.mjs +1 -7
- package/app-template/package.json +41 -41
- package/app-template/public/locales/en/common.json +0 -5
- package/app-template/public/locales/en/product.json +0 -6
- package/app-template/public/locales/tr/common.json +0 -5
- package/app-template/public/locales/tr/product.json +0 -6
- package/app-template/src/app/[pz]/[...prettyurl]/page.tsx +0 -14
- package/app-template/src/app/[pz]/account/orders/[id]/(detail)/page.tsx +0 -21
- package/app-template/src/app/[pz]/product/[pk]/page.tsx +1 -7
- package/app-template/src/hooks/index.ts +0 -2
- package/app-template/src/hooks/use-fav-button.tsx +13 -35
- package/app-template/src/plugins.js +0 -1
- package/app-template/src/proxy.ts +1 -2
- package/app-template/src/types/widgets.ts +0 -58
- package/app-template/src/views/category/category-info.tsx +17 -31
- package/app-template/src/views/header/search/index.tsx +5 -13
- package/app-template/src/views/product/index.ts +0 -1
- package/app-template/src/views/product/product-info.tsx +0 -14
- package/app-template/src/views/product/slider.tsx +38 -85
- package/app-template/src/views/product-item/index.tsx +1 -6
- package/app-template/tsconfig.json +0 -3
- package/commands/plugins.ts +0 -8
- package/dist/commands/plugins.js +0 -8
- package/package.json +1 -1
- package/app-template/src/__tests__/data-source-landing-page.test.tsx +0 -132
- package/app-template/src/app/[pz]/data-source-landing-page/[pk]/loading.tsx +0 -5
- package/app-template/src/app/[pz]/data-source-landing-page/[pk]/page.tsx +0 -62
- package/app-template/src/app/api/client-env/route.ts +0 -5
- package/app-template/src/app/global-error.tsx +0 -22
- package/app-template/src/hooks/favourite-product-ids-context.tsx +0 -104
- package/app-template/src/utils/__tests__/favourite-product-ids-fallback.test.ts +0 -42
- package/app-template/src/utils/__tests__/sanitize.test.ts +0 -127
- package/app-template/src/utils/favourite-product-ids-fallback.ts +0 -51
- package/app-template/src/utils/sanitize.ts +0 -167
- package/app-template/src/views/data-source-page/__tests__/header.test.tsx +0 -173
- package/app-template/src/views/data-source-page/__tests__/layout.test.tsx +0 -83
- package/app-template/src/views/data-source-page/__tests__/sections.test.tsx +0 -143
- package/app-template/src/views/data-source-page/banner.tsx +0 -45
- package/app-template/src/views/data-source-page/footer.tsx +0 -27
- package/app-template/src/views/data-source-page/header.tsx +0 -140
- package/app-template/src/views/data-source-page/layout.tsx +0 -45
- package/app-template/src/views/data-source-page/products.tsx +0 -55
- package/app-template/src/views/data-source-page/stories.tsx +0 -70
- package/app-template/src/views/product/__tests__/product-offers.test.tsx +0 -217
- package/app-template/src/views/product/product-offers.tsx +0 -125
- package/app-template/src/views/product/rate-review.tsx +0 -21
|
@@ -8,11 +8,9 @@ import {
|
|
|
8
8
|
useGetFavoritesQuery,
|
|
9
9
|
useRemoveFavoriteMutation
|
|
10
10
|
} from '@akinon/next/data/client/wishlist';
|
|
11
|
-
import { Product } from '@akinon/next/types';
|
|
12
11
|
import { Icon } from '@theme/components';
|
|
13
12
|
import { pushAddToWishlist } from '@theme/utils/gtm';
|
|
14
13
|
import { useToast, useLocalization } from '@akinon/next/hooks';
|
|
15
|
-
import { useFavouriteProductIds } from './favourite-product-ids-context';
|
|
16
14
|
|
|
17
15
|
interface FavButtonProps {
|
|
18
16
|
label?: string;
|
|
@@ -23,25 +21,16 @@ interface FavButtonProps {
|
|
|
23
21
|
|
|
24
22
|
const FAV_TOAST_OPTIONS = { position: 'bottom-right' as const }
|
|
25
23
|
|
|
26
|
-
const useFavButton = (
|
|
27
|
-
productPk: number,
|
|
28
|
-
product?: Pick<Product, 'base_code' | 'name' | 'price' | 'currency_type'>
|
|
29
|
-
) => {
|
|
24
|
+
const useFavButton = (productPk: number) => {
|
|
30
25
|
const { status } = useSession();
|
|
31
26
|
const { t } = useLocalization();
|
|
32
27
|
const { success, error: showError } = useToast();
|
|
33
28
|
|
|
34
|
-
// Inside a FavouriteProductIdsProvider (PLP) the favourite state comes from
|
|
35
|
-
// the batched favourite-product-ids request, so the full favourites list is
|
|
36
|
-
// only fetched when that flow is unavailable (no provider, or 404 fallback).
|
|
37
|
-
const favouriteProductIds = useFavouriteProductIds();
|
|
38
|
-
const useBatchFlow = Boolean(favouriteProductIds?.isActive);
|
|
39
|
-
|
|
40
29
|
const { data: favorites } = useGetFavoritesQuery(
|
|
41
30
|
{
|
|
42
31
|
limit: 1000
|
|
43
32
|
},
|
|
44
|
-
{ skip: status !== 'authenticated'
|
|
33
|
+
{ skip: status !== 'authenticated' }
|
|
45
34
|
);
|
|
46
35
|
|
|
47
36
|
const favoriteItem = useMemo(
|
|
@@ -52,11 +41,7 @@ const useFavButton = (
|
|
|
52
41
|
[favorites, productPk]
|
|
53
42
|
);
|
|
54
43
|
|
|
55
|
-
const
|
|
56
|
-
? favouriteProductIds.getFavouriteId(productPk)
|
|
57
|
-
: favoriteItem?.pk;
|
|
58
|
-
|
|
59
|
-
const isActive = favouriteId !== undefined;
|
|
44
|
+
const isActive = Boolean(favoriteItem);
|
|
60
45
|
const [isPushed, setIsPushed] = useState<boolean>(false);
|
|
61
46
|
|
|
62
47
|
const [addFavorite] = useAddFavoriteMutation();
|
|
@@ -64,8 +49,8 @@ const useFavButton = (
|
|
|
64
49
|
|
|
65
50
|
const handleClick = useCallback(async () => {
|
|
66
51
|
try {
|
|
67
|
-
if (
|
|
68
|
-
await removeFavorite(
|
|
52
|
+
if (favoriteItem) {
|
|
53
|
+
await removeFavorite(favoriteItem.pk).unwrap();
|
|
69
54
|
success(t('product.removed_from_favorites'), FAV_TOAST_OPTIONS);
|
|
70
55
|
} else {
|
|
71
56
|
await addFavorite(productPk).unwrap();
|
|
@@ -75,26 +60,19 @@ const useFavButton = (
|
|
|
75
60
|
} catch (err) {
|
|
76
61
|
showError(t('product.favorites_error'), FAV_TOAST_OPTIONS);
|
|
77
62
|
}
|
|
78
|
-
}, [
|
|
63
|
+
}, [favoriteItem, productPk, addFavorite, removeFavorite, success, showError, t]);
|
|
79
64
|
|
|
80
65
|
useEffect(() => {
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
// The batched flow returns ids only, so the analytics payload falls back
|
|
84
|
-
// to the product the card already renders.
|
|
85
|
-
const gtmProduct = favoriteItem?.product ?? product;
|
|
86
|
-
|
|
87
|
-
if (gtmProduct) {
|
|
66
|
+
if (favoriteItem && isPushed) {
|
|
88
67
|
pushAddToWishlist({
|
|
89
|
-
base_code:
|
|
90
|
-
name:
|
|
91
|
-
price:
|
|
92
|
-
currency_type:
|
|
68
|
+
base_code: favoriteItem?.product?.base_code,
|
|
69
|
+
name: favoriteItem?.product?.name,
|
|
70
|
+
price: favoriteItem?.product?.price,
|
|
71
|
+
currency_type: favoriteItem?.product?.currency_type
|
|
93
72
|
});
|
|
73
|
+
setIsPushed(false);
|
|
94
74
|
}
|
|
95
|
-
|
|
96
|
-
setIsPushed(false);
|
|
97
|
-
}, [isActive, favoriteItem, product, isPushed]);
|
|
75
|
+
}, [favoriteItem, isPushed]);
|
|
98
76
|
|
|
99
77
|
const FavButton = useMemo(() => {
|
|
100
78
|
const View = (props: FavButtonProps) => (
|
|
@@ -15,8 +15,7 @@ export const config = {
|
|
|
15
15
|
'/((?!api|_next|[\\w-\\/*]+\\.\\w+).*)',
|
|
16
16
|
'/(.*sitemap\\.xml)',
|
|
17
17
|
'/(.+\\.)(html|htm|aspx|asp|php)',
|
|
18
|
-
'/(.*orders\\/checkout-with-token.*)'
|
|
19
|
-
'/(.*orders\\/post-checkout.*)'
|
|
18
|
+
'/(.*orders\\/checkout-with-token.*)'
|
|
20
19
|
]
|
|
21
20
|
};
|
|
22
21
|
|
|
@@ -113,61 +113,3 @@ export type AccountFaqItem = {
|
|
|
113
113
|
}
|
|
114
114
|
];
|
|
115
115
|
};
|
|
116
|
-
|
|
117
|
-
export type DataSourceProductRecommendation = {
|
|
118
|
-
title?: {
|
|
119
|
-
value: string;
|
|
120
|
-
};
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
export type DataSourcePageStory = {
|
|
124
|
-
value?: {
|
|
125
|
-
title?: string;
|
|
126
|
-
link?: string;
|
|
127
|
-
};
|
|
128
|
-
kwargs?: {
|
|
129
|
-
value?: {
|
|
130
|
-
image?: ImageType;
|
|
131
|
-
};
|
|
132
|
-
};
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
export type DataSourcePageData = {
|
|
136
|
-
header?: {
|
|
137
|
-
value?: {
|
|
138
|
-
logo_link?: string;
|
|
139
|
-
menu_1_title?: string;
|
|
140
|
-
menu_1_link?: string;
|
|
141
|
-
menu_2_title?: string;
|
|
142
|
-
menu_2_link?: string;
|
|
143
|
-
search_placeholder?: string;
|
|
144
|
-
follow_button_title?: string;
|
|
145
|
-
follow_button_title_color?: string;
|
|
146
|
-
follow_button_background?: string;
|
|
147
|
-
};
|
|
148
|
-
kwargs?: {
|
|
149
|
-
value?: {
|
|
150
|
-
logo?: ImageType;
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
};
|
|
154
|
-
banner?: {
|
|
155
|
-
value?: {
|
|
156
|
-
title?: string;
|
|
157
|
-
subtitle?: string;
|
|
158
|
-
};
|
|
159
|
-
kwargs?: {
|
|
160
|
-
value?: {
|
|
161
|
-
image?: ImageType;
|
|
162
|
-
mobile_image?: ImageType;
|
|
163
|
-
};
|
|
164
|
-
};
|
|
165
|
-
};
|
|
166
|
-
stories?: DataSourcePageStory[];
|
|
167
|
-
footer?: {
|
|
168
|
-
value?: {
|
|
169
|
-
title?: string;
|
|
170
|
-
description?: string;
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
|
-
};
|
|
@@ -7,12 +7,10 @@ import { CategoryHeader } from './category-header';
|
|
|
7
7
|
import { Filters } from './filters';
|
|
8
8
|
import { Pagination } from '@theme/components';
|
|
9
9
|
import { ProductItem } from '@theme/views/product-item';
|
|
10
|
-
import PluginModule, { Component } from '@akinon/next/components/plugin-module';
|
|
11
10
|
import { GetCategoryResponse } from '@akinon/next/types';
|
|
12
11
|
import { useAppDispatch, useAppSelector } from '@akinon/next/redux/hooks';
|
|
13
12
|
import { setFacets, setMenuOpen } from '@theme/redux/reducers/category';
|
|
14
13
|
import CategoryActiveFilters from '@theme/views/category/category-active-filters';
|
|
15
|
-
import { FavouriteProductIdsProvider } from '@theme/hooks/favourite-product-ids-context';
|
|
16
14
|
import { useLocalization } from '@akinon/next/hooks';
|
|
17
15
|
import { Link, LoaderSpinner } from '@akinon/next/components';
|
|
18
16
|
import { ROUTES } from '@theme/routes';
|
|
@@ -64,11 +62,6 @@ export default function ListPage(props: ListPageProps) {
|
|
|
64
62
|
|
|
65
63
|
const { t } = useLocalization();
|
|
66
64
|
|
|
67
|
-
const productPks = useMemo(
|
|
68
|
-
() => data?.products?.map((product) => product.pk) ?? [],
|
|
69
|
-
[data?.products]
|
|
70
|
-
);
|
|
71
|
-
|
|
72
65
|
useEffect(() => {
|
|
73
66
|
dispatch(setFacets(data.facets));
|
|
74
67
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -112,30 +105,23 @@ export default function ListPage(props: ListPageProps) {
|
|
|
112
105
|
|
|
113
106
|
{data.products?.length === 0 && page > 1 && <LoaderSpinner />}
|
|
114
107
|
|
|
115
|
-
<
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
<
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
{
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
height={itemDimensions.height}
|
|
133
|
-
index={index}
|
|
134
|
-
/>
|
|
135
|
-
))}
|
|
136
|
-
</PluginModule>
|
|
137
|
-
</div>
|
|
138
|
-
</FavouriteProductIdsProvider>
|
|
108
|
+
<div
|
|
109
|
+
className={clsx('grid gap-x-4 gap-y-12 grid-cols-2', {
|
|
110
|
+
'md:grid-cols-3': layoutSize === 3,
|
|
111
|
+
'lg:grid-cols-2': layoutSize === 2,
|
|
112
|
+
'lg:grid-cols-3': layoutSize === 3
|
|
113
|
+
})}
|
|
114
|
+
>
|
|
115
|
+
{data?.products?.map((product, index) => (
|
|
116
|
+
<ProductItem
|
|
117
|
+
key={product.pk}
|
|
118
|
+
product={product}
|
|
119
|
+
width={itemDimensions.width}
|
|
120
|
+
height={itemDimensions.height}
|
|
121
|
+
index={index}
|
|
122
|
+
/>
|
|
123
|
+
))}
|
|
124
|
+
</div>
|
|
139
125
|
{data?.products?.length > 0 && (
|
|
140
126
|
<Pagination
|
|
141
127
|
total={data.pagination.total_count}
|
|
@@ -4,7 +4,8 @@ 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';
|
|
@@ -41,14 +42,6 @@ export default function Search() {
|
|
|
41
42
|
};
|
|
42
43
|
}, [isSearchOpen, dispatch]);
|
|
43
44
|
|
|
44
|
-
const handleSearchTextChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
45
|
-
setSearchText(e.target.value);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const handleCloseSearch = () => {
|
|
49
|
-
dispatch(closeSearch());
|
|
50
|
-
};
|
|
51
|
-
|
|
52
45
|
return (
|
|
53
46
|
<>
|
|
54
47
|
<div
|
|
@@ -74,9 +67,9 @@ export default function Search() {
|
|
|
74
67
|
{t('common.search.results_for')}
|
|
75
68
|
</span>
|
|
76
69
|
<div className="flex items-center">
|
|
77
|
-
<
|
|
70
|
+
<input
|
|
78
71
|
value={searchText}
|
|
79
|
-
onChange={
|
|
72
|
+
onChange={(e) => setSearchText(e.target.value)}
|
|
80
73
|
onKeyDown={(e) => {
|
|
81
74
|
if (e.key === 'Enter' && searchText.trim() !== '') {
|
|
82
75
|
router.push(`${ROUTES.LIST}/?search_text=${searchText}`);
|
|
@@ -98,12 +91,11 @@ export default function Search() {
|
|
|
98
91
|
<Icon
|
|
99
92
|
name="close"
|
|
100
93
|
size={14}
|
|
101
|
-
onClick={
|
|
94
|
+
onClick={() => dispatch(closeSearch())}
|
|
102
95
|
className="cursor-pointer"
|
|
103
96
|
/>
|
|
104
97
|
</div>
|
|
105
98
|
</div>
|
|
106
|
-
|
|
107
99
|
<Results searchText={searchText} />
|
|
108
100
|
</div>
|
|
109
101
|
</div>
|
|
@@ -6,5 +6,4 @@ export { default as ProductGroupInfo } from './product-group-info';
|
|
|
6
6
|
export { default as MiscButtons } from './misc-buttons';
|
|
7
7
|
export { default as ProductInfoSlider } from './slider';
|
|
8
8
|
export { default as AccordionWrapper } from './accordion-wrapper';
|
|
9
|
-
export { default as ProductRateReview } from './rate-review';
|
|
10
9
|
export { default as CombineProductCard } from './combine-product-card';
|
|
@@ -13,7 +13,6 @@ import { useStockAlert } from '../../hooks/use-stock-alert';
|
|
|
13
13
|
import { ProductVariants } from './product-variants';
|
|
14
14
|
import { ProductActions } from './product-actions';
|
|
15
15
|
import { ProductShare } from './product-share';
|
|
16
|
-
import { ProductOffers } from './product-offers';
|
|
17
16
|
import PluginModule, { Component } from '@akinon/next/components/plugin-module';
|
|
18
17
|
|
|
19
18
|
export default function ProductInfo({ data }: ProductPageProps) {
|
|
@@ -74,17 +73,6 @@ export default function ProductInfo({ data }: ProductPageProps) {
|
|
|
74
73
|
|
|
75
74
|
return (
|
|
76
75
|
<>
|
|
77
|
-
<PluginModule
|
|
78
|
-
component={Component.RateReviewBadge}
|
|
79
|
-
props={{
|
|
80
|
-
product: {
|
|
81
|
-
sku: data.product.sku,
|
|
82
|
-
base_code: data.product.base_code
|
|
83
|
-
},
|
|
84
|
-
classNames: { root: 'mt-2' }
|
|
85
|
-
}}
|
|
86
|
-
/>
|
|
87
|
-
|
|
88
76
|
<div
|
|
89
77
|
className={clsx(
|
|
90
78
|
'fixed bottom-0 left-0 w-1/2 h-14 z-[20] bg-white mt-0 border-t border-gray-500 items-center justify-center',
|
|
@@ -133,8 +121,6 @@ export default function ProductInfo({ data }: ProductPageProps) {
|
|
|
133
121
|
/>
|
|
134
122
|
|
|
135
123
|
<ProductShare productName={data.product.name} className="my-2 sm:mb-4" />
|
|
136
|
-
|
|
137
|
-
<ProductOffers offers={data.offers} productPk={data.product.pk} />
|
|
138
124
|
</>
|
|
139
125
|
);
|
|
140
126
|
}
|
|
@@ -36,100 +36,53 @@ export default function ProductInfoSlider({ product }: ProductSliderItem) {
|
|
|
36
36
|
carouselRef.current?.next();
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
const handleThumbnailClick = (index
|
|
39
|
+
const handleThumbnailClick = (index) => {
|
|
40
40
|
setActiveIndex(index);
|
|
41
41
|
carouselRef.current?.goToSlide(index);
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
return (
|
|
45
|
-
|
|
46
|
-
<div className="lg:
|
|
47
|
-
<div className="
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
disabled={activeIndex === 0}
|
|
56
|
-
>
|
|
57
|
-
<Icon name="chevron-up" size={15} className="fill-[#000000]" />
|
|
58
|
-
</button>
|
|
59
|
-
<div className="hidden flex-col items-center overflow-scroll w-[80px] max-h-[620px] lg:block">
|
|
60
|
-
{product?.productimage_set?.map((item, index) => (
|
|
61
|
-
<Image
|
|
62
|
-
key={index}
|
|
63
|
-
src={item.image}
|
|
64
|
-
alt={`Thumbnail ${index}`}
|
|
65
|
-
width={80}
|
|
66
|
-
height={128}
|
|
67
|
-
aspectRatio={80 / 128}
|
|
68
|
-
className={twMerge('cursor-pointer', [
|
|
69
|
-
activeIndex === index && 'border-2 border-primary'
|
|
70
|
-
])}
|
|
71
|
-
onClick={() => handleThumbnailClick(index)}
|
|
72
|
-
/>
|
|
73
|
-
))}
|
|
74
|
-
</div>
|
|
75
|
-
<button
|
|
76
|
-
onClick={goToNext}
|
|
77
|
-
className={twMerge(
|
|
78
|
-
'hidden justify-center p-2 mt-3 border border-gray-100 rounded-full cursor-pointer lg:block',
|
|
79
|
-
[
|
|
80
|
-
activeIndex === product.productimage_set.length - 1 &&
|
|
81
|
-
'cursor-not-allowed opacity-45'
|
|
82
|
-
]
|
|
83
|
-
)}
|
|
84
|
-
disabled={activeIndex === product.productimage_set.length - 1}
|
|
85
|
-
>
|
|
86
|
-
<Icon name="chevron-down" size={15} className="fill-[#000000]" />
|
|
87
|
-
</button>
|
|
88
|
-
</div>
|
|
89
|
-
</div>
|
|
90
|
-
|
|
91
|
-
<div className="relative lg:col-span-5">
|
|
92
|
-
<FavButton className="absolute right-8 top-6 z-[20] sm:hidden" />
|
|
93
|
-
|
|
94
|
-
<PluginModule
|
|
95
|
-
component={Component.ProductImageSearchFeature}
|
|
96
|
-
props={{
|
|
97
|
-
product,
|
|
98
|
-
activeIndex,
|
|
99
|
-
showResetButton: true
|
|
100
|
-
}}
|
|
101
|
-
/>
|
|
102
|
-
|
|
103
|
-
<CarouselCore
|
|
104
|
-
responsive={{
|
|
105
|
-
all: {
|
|
106
|
-
breakpoint: { max: 5000, min: 0 },
|
|
107
|
-
items: 1
|
|
108
|
-
}
|
|
109
|
-
}}
|
|
110
|
-
arrows={false}
|
|
111
|
-
swipeable={true}
|
|
112
|
-
ref={carouselRef}
|
|
113
|
-
afterChange={(previousSlide, { currentSlide }) => {
|
|
114
|
-
setActiveIndex(currentSlide);
|
|
115
|
-
}}
|
|
116
|
-
containerAspectRatio={{ mobile: 520 / 798, desktop: 484 / 726 }}
|
|
45
|
+
<div className="lg:grid lg:grid-cols-6">
|
|
46
|
+
<div className="lg:col-span-1">
|
|
47
|
+
<div className="flex flex-col items-center justify-center md:mr-[6px]">
|
|
48
|
+
<button
|
|
49
|
+
onClick={goToPrev}
|
|
50
|
+
className={twMerge(
|
|
51
|
+
'hidden justify-center p-2 mb-3 border border-gray-100 rounded-full cursor-pointer lg:block',
|
|
52
|
+
[activeIndex === 0 && 'cursor-not-allowed opacity-45']
|
|
53
|
+
)}
|
|
54
|
+
disabled={activeIndex === 0}
|
|
117
55
|
>
|
|
118
|
-
{
|
|
56
|
+
<Icon name="chevron-up" size={15} className="fill-[#000000]" />
|
|
57
|
+
</button>
|
|
58
|
+
<div className="hidden flex-col items-center overflow-scroll w-[80px] max-h-[620px] lg:block">
|
|
59
|
+
{product?.productimage_set?.map((item, index) => (
|
|
119
60
|
<Image
|
|
120
|
-
key={
|
|
61
|
+
key={index}
|
|
121
62
|
src={item.image}
|
|
122
|
-
alt={
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
fill
|
|
63
|
+
alt={`Thumbnail ${index}`}
|
|
64
|
+
width={80}
|
|
65
|
+
height={128}
|
|
66
|
+
className={twMerge('cursor-pointer', [
|
|
67
|
+
activeIndex === index && 'border-2 border-primary'
|
|
68
|
+
])}
|
|
69
|
+
onClick={() => handleThumbnailClick(index)}
|
|
130
70
|
/>
|
|
131
71
|
))}
|
|
132
|
-
</
|
|
72
|
+
</div>
|
|
73
|
+
<button
|
|
74
|
+
onClick={goToNext}
|
|
75
|
+
className={twMerge(
|
|
76
|
+
'hidden justify-center p-2 mt-3 border border-gray-100 rounded-full cursor-pointer lg:block',
|
|
77
|
+
[
|
|
78
|
+
activeIndex === product.productimage_set.length - 1 &&
|
|
79
|
+
'cursor-not-allowed opacity-45'
|
|
80
|
+
]
|
|
81
|
+
)}
|
|
82
|
+
disabled={activeIndex === product.productimage_set.length - 1}
|
|
83
|
+
>
|
|
84
|
+
<Icon name="chevron-down" size={15} className="fill-[#000000]" />
|
|
85
|
+
</button>
|
|
133
86
|
</div>
|
|
134
87
|
</div>
|
|
135
88
|
|
|
@@ -187,6 +140,6 @@ export default function ProductInfoSlider({ product }: ProductSliderItem) {
|
|
|
187
140
|
))}
|
|
188
141
|
</CarouselCore>
|
|
189
142
|
</div>
|
|
190
|
-
|
|
143
|
+
</div>
|
|
191
144
|
);
|
|
192
145
|
}
|
|
@@ -10,7 +10,6 @@ import useFavButton from '../../hooks/use-fav-button';
|
|
|
10
10
|
import { Product } from '@akinon/next/types';
|
|
11
11
|
import { Image } from '@akinon/next/components/image';
|
|
12
12
|
import { Price, Link } from '@theme/components';
|
|
13
|
-
import PluginModule, { Component } from '@akinon/next/components/plugin-module';
|
|
14
13
|
|
|
15
14
|
interface Props {
|
|
16
15
|
product: Product;
|
|
@@ -23,7 +22,7 @@ export const ProductItem = (props: Props) => {
|
|
|
23
22
|
// TODO: Static image will change (TR)
|
|
24
23
|
const { product, width, height, index } = props;
|
|
25
24
|
const [viewed, setViewed] = useState(false);
|
|
26
|
-
const { FavButton } = useFavButton(product.pk
|
|
25
|
+
const { FavButton } = useFavButton(product.pk);
|
|
27
26
|
const { ref, inView } = useInView();
|
|
28
27
|
|
|
29
28
|
const image_url = product.productimage_set[0]?.image;
|
|
@@ -82,10 +81,6 @@ export const ProductItem = (props: Props) => {
|
|
|
82
81
|
>
|
|
83
82
|
{product_name}
|
|
84
83
|
</Link>
|
|
85
|
-
<PluginModule
|
|
86
|
-
component={Component.RateReviewPlpBadge}
|
|
87
|
-
props={{ product }}
|
|
88
|
-
/>
|
|
89
84
|
<div className="font-semibold">
|
|
90
85
|
{parseFloat(retail_price) > parseFloat(price) && (
|
|
91
86
|
<Price
|
package/commands/plugins.ts
CHANGED
|
@@ -164,10 +164,6 @@ export default async () => {
|
|
|
164
164
|
name: 'Tamara Payment Extension',
|
|
165
165
|
value: 'pz-tamara-extension'
|
|
166
166
|
},
|
|
167
|
-
{
|
|
168
|
-
name: 'Similar Products',
|
|
169
|
-
value: 'pz-similar-products'
|
|
170
|
-
},
|
|
171
167
|
{
|
|
172
168
|
name: 'Hepsipay',
|
|
173
169
|
value: 'pz-hepsipay'
|
|
@@ -180,10 +176,6 @@ export default async () => {
|
|
|
180
176
|
name: 'Virtual Try-On',
|
|
181
177
|
value: 'pz-virtual-try-on'
|
|
182
178
|
},
|
|
183
|
-
{
|
|
184
|
-
name: 'Rate & Review',
|
|
185
|
-
value: 'pz-rate-review'
|
|
186
|
-
},
|
|
187
179
|
{
|
|
188
180
|
name: 'Masterpass Rest',
|
|
189
181
|
value: 'pz-masterpass-rest'
|
package/dist/commands/plugins.js
CHANGED
|
@@ -183,10 +183,6 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
183
183
|
name: 'Tamara Payment Extension',
|
|
184
184
|
value: 'pz-tamara-extension'
|
|
185
185
|
},
|
|
186
|
-
{
|
|
187
|
-
name: 'Similar Products',
|
|
188
|
-
value: 'pz-similar-products'
|
|
189
|
-
},
|
|
190
186
|
{
|
|
191
187
|
name: 'Hepsipay',
|
|
192
188
|
value: 'pz-hepsipay'
|
|
@@ -199,10 +195,6 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
199
195
|
name: 'Virtual Try-On',
|
|
200
196
|
value: 'pz-virtual-try-on'
|
|
201
197
|
},
|
|
202
|
-
{
|
|
203
|
-
name: 'Rate & Review',
|
|
204
|
-
value: 'pz-rate-review'
|
|
205
|
-
},
|
|
206
198
|
{
|
|
207
199
|
name: 'Masterpass Rest',
|
|
208
200
|
value: 'pz-masterpass-rest'
|