@akinon/projectzero 1.92.0-rc.15 → 1.92.0-rc.16
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 +2 -0
- package/app-template/.env.example +1 -0
- package/app-template/CHANGELOG.md +32 -0
- package/app-template/README.md +25 -1
- package/app-template/package.json +19 -19
- package/app-template/public/locales/en/common.json +42 -1
- package/app-template/public/locales/tr/common.json +42 -1
- package/app-template/src/app/api/image-proxy/route.ts +1 -0
- package/app-template/src/app/api/similar-product-list/route.ts +1 -0
- package/app-template/src/app/api/similar-products/route.ts +1 -0
- package/app-template/src/hooks/index.ts +2 -0
- package/app-template/src/plugins.js +2 -1
- package/app-template/src/views/header/search/index.tsx +20 -5
- package/app-template/src/views/product/slider.tsx +86 -73
- package/commands/plugins.ts +4 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,7 @@ NEXT_PUBLIC_GTM_KEY=GTM_KEY
|
|
|
6
6
|
NEXT_PUBLIC_URL=http://localhost:3000
|
|
7
7
|
SERVICE_BACKEND_URL=https://02fde10fee4440269e695aa10707dfaf.lb.akinoncloud.com
|
|
8
8
|
SITEMAP_S3_BUCKET_NAME=0fb534
|
|
9
|
+
NEXT_PUBLIC_ENABLE_IMAGE_SEARCH=true
|
|
9
10
|
|
|
10
11
|
# LOG_LEVEL_DEV=debug # For more details, please refer to the Logging documentation.
|
|
11
12
|
|
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# projectzeronext
|
|
2
2
|
|
|
3
|
+
## 1.92.0-rc.16
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1a8622a9: ZERO-3392: Implemented AI Search functionality and update env
|
|
8
|
+
- b55acb76: ZERO-2577: Fix pagination bug and update usePagination hook and ensure pagination controls rendering correctly
|
|
9
|
+
- 9f8cd3b: ZERO-3449: AI Search Active Filters & Crop Style changes have been implemented
|
|
10
|
+
- b05c3543: ZERO-2570: Category filters routes to absolute url
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [b55acb76]
|
|
15
|
+
- Updated dependencies [9f8cd3b]
|
|
16
|
+
- Updated dependencies [4de5303c]
|
|
17
|
+
- @akinon/next@1.92.0-rc.16
|
|
18
|
+
- @akinon/pz-akifast@1.92.0-rc.16
|
|
19
|
+
- @akinon/pz-b2b@1.92.0-rc.16
|
|
20
|
+
- @akinon/pz-basket-gift-pack@1.92.0-rc.16
|
|
21
|
+
- @akinon/pz-bkm@1.92.0-rc.16
|
|
22
|
+
- @akinon/pz-checkout-gift-pack@1.92.0-rc.16
|
|
23
|
+
- @akinon/pz-click-collect@1.92.0-rc.16
|
|
24
|
+
- @akinon/pz-credit-payment@1.92.0-rc.16
|
|
25
|
+
- @akinon/pz-gpay@1.92.0-rc.16
|
|
26
|
+
- @akinon/pz-hepsipay@1.92.0-rc.16
|
|
27
|
+
- @akinon/pz-masterpass@1.92.0-rc.16
|
|
28
|
+
- @akinon/pz-one-click-checkout@1.92.0-rc.16
|
|
29
|
+
- @akinon/pz-otp@1.92.0-rc.16
|
|
30
|
+
- @akinon/pz-pay-on-delivery@1.92.0-rc.16
|
|
31
|
+
- @akinon/pz-saved-card@1.92.0-rc.16
|
|
32
|
+
- @akinon/pz-tabby-extension@1.92.0-rc.16
|
|
33
|
+
- @akinon/pz-tamara-extension@1.92.0-rc.16
|
|
34
|
+
|
|
3
35
|
## 1.92.0-rc.15
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
package/app-template/README.md
CHANGED
|
@@ -12,6 +12,30 @@ Run `cp .env.example .env && yarn` command at project root and all dependencies
|
|
|
12
12
|
|
|
13
13
|
- `SITEMAP_S3_BUCKET_NAME`: S3 bucket name for XML sitemaps (e.g., "0fb534"). This is required for the sitemap route to function correctly.
|
|
14
14
|
|
|
15
|
+
### Optional Environment Variables
|
|
16
|
+
|
|
17
|
+
- `NEXT_PUBLIC_ENABLE_IMAGE_SEARCH`: Set to `true` to enable image search feature for all users. If not set or `false`, the feature will only be visible to users who have enabled it via localStorage.
|
|
18
|
+
|
|
19
|
+
## Image Search Feature
|
|
20
|
+
|
|
21
|
+
The image search functionality allows users to search for similar products by uploading images or cropping existing product images.
|
|
22
|
+
|
|
23
|
+
### Feature Visibility Control
|
|
24
|
+
|
|
25
|
+
The image search feature can be controlled in two ways:
|
|
26
|
+
|
|
27
|
+
1. **Environment Variable (Global)**: Set `NEXT_PUBLIC_ENABLE_IMAGE_SEARCH=true` to enable for all users
|
|
28
|
+
2. **localStorage (Individual Users)**: Users can enable it locally using browser developer tools
|
|
29
|
+
|
|
30
|
+
````
|
|
31
|
+
|
|
32
|
+
### Feature Locations
|
|
33
|
+
|
|
34
|
+
When enabled, the image search feature appears in:
|
|
35
|
+
|
|
36
|
+
- **Header Search**: Camera icon next to the search input
|
|
37
|
+
- **Product Detail Page**: "View Similar Styles" button on product images
|
|
38
|
+
|
|
15
39
|
### Build
|
|
16
40
|
|
|
17
41
|
To build the app, run the following command:
|
|
@@ -19,7 +43,7 @@ To build the app, run the following command:
|
|
|
19
43
|
```bash
|
|
20
44
|
cd projectzeronext # Project root
|
|
21
45
|
yarn build
|
|
22
|
-
|
|
46
|
+
````
|
|
23
47
|
|
|
24
48
|
### Develop
|
|
25
49
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "projectzeronext",
|
|
3
|
-
"version": "1.92.0-rc.
|
|
3
|
+
"version": "1.92.0-rc.16",
|
|
4
4
|
"private": true,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -24,23 +24,23 @@
|
|
|
24
24
|
"test:middleware": "jest middleware-matcher.test.ts --bail"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@akinon/next": "1.92.0-rc.
|
|
28
|
-
"@akinon/pz-akifast": "1.92.0-rc.
|
|
29
|
-
"@akinon/pz-b2b": "1.92.0-rc.
|
|
30
|
-
"@akinon/pz-basket-gift-pack": "1.92.0-rc.
|
|
31
|
-
"@akinon/pz-bkm": "1.92.0-rc.
|
|
32
|
-
"@akinon/pz-checkout-gift-pack": "1.92.0-rc.
|
|
33
|
-
"@akinon/pz-click-collect": "1.92.0-rc.
|
|
34
|
-
"@akinon/pz-credit-payment": "1.92.0-rc.
|
|
35
|
-
"@akinon/pz-gpay": "1.92.0-rc.
|
|
36
|
-
"@akinon/pz-hepsipay": "1.92.0-rc.
|
|
37
|
-
"@akinon/pz-masterpass": "1.92.0-rc.
|
|
38
|
-
"@akinon/pz-one-click-checkout": "1.92.0-rc.
|
|
39
|
-
"@akinon/pz-otp": "1.92.0-rc.
|
|
40
|
-
"@akinon/pz-pay-on-delivery": "1.92.0-rc.
|
|
41
|
-
"@akinon/pz-saved-card": "1.92.0-rc.
|
|
42
|
-
"@akinon/pz-tabby-extension": "1.92.0-rc.
|
|
43
|
-
"@akinon/pz-tamara-extension": "1.92.0-rc.
|
|
27
|
+
"@akinon/next": "1.92.0-rc.16",
|
|
28
|
+
"@akinon/pz-akifast": "1.92.0-rc.16",
|
|
29
|
+
"@akinon/pz-b2b": "1.92.0-rc.16",
|
|
30
|
+
"@akinon/pz-basket-gift-pack": "1.92.0-rc.16",
|
|
31
|
+
"@akinon/pz-bkm": "1.92.0-rc.16",
|
|
32
|
+
"@akinon/pz-checkout-gift-pack": "1.92.0-rc.16",
|
|
33
|
+
"@akinon/pz-click-collect": "1.92.0-rc.16",
|
|
34
|
+
"@akinon/pz-credit-payment": "1.92.0-rc.16",
|
|
35
|
+
"@akinon/pz-gpay": "1.92.0-rc.16",
|
|
36
|
+
"@akinon/pz-hepsipay": "1.92.0-rc.16",
|
|
37
|
+
"@akinon/pz-masterpass": "1.92.0-rc.16",
|
|
38
|
+
"@akinon/pz-one-click-checkout": "1.92.0-rc.16",
|
|
39
|
+
"@akinon/pz-otp": "1.92.0-rc.16",
|
|
40
|
+
"@akinon/pz-pay-on-delivery": "1.92.0-rc.16",
|
|
41
|
+
"@akinon/pz-saved-card": "1.92.0-rc.16",
|
|
42
|
+
"@akinon/pz-tabby-extension": "1.92.0-rc.16",
|
|
43
|
+
"@akinon/pz-tamara-extension": "1.92.0-rc.16",
|
|
44
44
|
"@hookform/resolvers": "2.9.0",
|
|
45
45
|
"@next/third-parties": "14.1.0",
|
|
46
46
|
"@react-google-maps/api": "2.17.1",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"yup": "0.32.11"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@akinon/eslint-plugin-projectzero": "1.92.0-rc.
|
|
66
|
+
"@akinon/eslint-plugin-projectzero": "1.92.0-rc.16",
|
|
67
67
|
"@semantic-release/changelog": "6.0.2",
|
|
68
68
|
"@semantic-release/exec": "6.0.3",
|
|
69
69
|
"@semantic-release/git": "10.0.1",
|
|
@@ -27,7 +27,25 @@
|
|
|
27
27
|
"clean": "clean",
|
|
28
28
|
"categories": "CATEGORIES",
|
|
29
29
|
"view_all": "VIEW ALL",
|
|
30
|
-
"not_found": "Search Results Not Found"
|
|
30
|
+
"not_found": "Search Results Not Found",
|
|
31
|
+
"image_search": {
|
|
32
|
+
"title": "Search by Image",
|
|
33
|
+
"upload_image": "Upload an image to find similar products",
|
|
34
|
+
"select_image": "Select Image",
|
|
35
|
+
"crop_image": "Crop Image",
|
|
36
|
+
"cancel_crop": "Cancel Crop",
|
|
37
|
+
"apply_crop": "Apply Crop",
|
|
38
|
+
"try_another": "Try Another Image",
|
|
39
|
+
"search_image": "Search Image",
|
|
40
|
+
"similar_products": "Similar Products",
|
|
41
|
+
"loading_cropper": "Loading cropper...",
|
|
42
|
+
"no_products": "No similar products found",
|
|
43
|
+
"best_results": "For best results:",
|
|
44
|
+
"tip_1": "Upload clear images of products",
|
|
45
|
+
"tip_2": "Use images with simple backgrounds",
|
|
46
|
+
"tip_3": "Focus on the main product",
|
|
47
|
+
"tip_4": "Use the crop tool to focus on specific details"
|
|
48
|
+
}
|
|
31
49
|
},
|
|
32
50
|
"page_404": {
|
|
33
51
|
"title": "Page not found.",
|
|
@@ -71,5 +89,28 @@
|
|
|
71
89
|
"file_input": {
|
|
72
90
|
"select_file": "Select File",
|
|
73
91
|
"no_file": "No file selected"
|
|
92
|
+
},
|
|
93
|
+
"product": {
|
|
94
|
+
"no_products": "No products found",
|
|
95
|
+
"new_image": "New Image",
|
|
96
|
+
"view_similar_styles": "View Similar Styles",
|
|
97
|
+
"clear_all_filters": "Clear All Filters",
|
|
98
|
+
"reset_to_original": "Reset to Original",
|
|
99
|
+
"similar_styles": "Similar Styles",
|
|
100
|
+
"filters": "Filters",
|
|
101
|
+
"active_filters": "Active Filters"
|
|
102
|
+
},
|
|
103
|
+
"similar_products": {
|
|
104
|
+
"errors": {
|
|
105
|
+
"file_size_too_large": "Image size should be less than 5MB",
|
|
106
|
+
"invalid_image_file": "The selected file is not a valid image",
|
|
107
|
+
"invalid_image_format": "Invalid image format detected",
|
|
108
|
+
"search_failed": "Search failed. Please try again later",
|
|
109
|
+
"connection_failed": "Image search failed. Please check your connection and try again",
|
|
110
|
+
"invalid_image_properties": "Invalid image properties detected",
|
|
111
|
+
"file_read_error": "Error reading the file",
|
|
112
|
+
"processing_error": "Error processing image",
|
|
113
|
+
"crop_processing_error": "Error processing cropped image"
|
|
114
|
+
}
|
|
74
115
|
}
|
|
75
116
|
}
|
|
@@ -27,7 +27,25 @@
|
|
|
27
27
|
"clean": "temizle",
|
|
28
28
|
"categories": "KATEGORİLER",
|
|
29
29
|
"view_all": "HEPSİNİ GÖSTER",
|
|
30
|
-
"not_found": "Arama Sonuçları Bulunamadı"
|
|
30
|
+
"not_found": "Arama Sonuçları Bulunamadı",
|
|
31
|
+
"image_search": {
|
|
32
|
+
"title": "Görsel ile Ara",
|
|
33
|
+
"upload_image": "Benzer ürünleri bulmak için bir görsel yükleyin",
|
|
34
|
+
"select_image": "Görsel Seç",
|
|
35
|
+
"crop_image": "Görsel Kırp",
|
|
36
|
+
"cancel_crop": "Kırpmayı İptal Et",
|
|
37
|
+
"apply_crop": "Kırpmayı Uygula",
|
|
38
|
+
"try_another": "Başka Görsel Dene",
|
|
39
|
+
"search_image": "Arama Görseli",
|
|
40
|
+
"similar_products": "Benzer Ürünler",
|
|
41
|
+
"loading_cropper": "Kırpıcı yükleniyor...",
|
|
42
|
+
"no_products": "Benzer ürün bulunamadı",
|
|
43
|
+
"best_results": "En iyi sonuçlar için:",
|
|
44
|
+
"tip_1": "Net ürün görselleri yükleyin",
|
|
45
|
+
"tip_2": "Basit arka planlı görseller kullanın",
|
|
46
|
+
"tip_3": "Ana ürüne odaklanın",
|
|
47
|
+
"tip_4": "Belirli detaylara odaklanmak için kırpma aracını kullanın"
|
|
48
|
+
}
|
|
31
49
|
},
|
|
32
50
|
"page_404": {
|
|
33
51
|
"title": "Sayfa bulunamadı.",
|
|
@@ -71,5 +89,28 @@
|
|
|
71
89
|
"file_input": {
|
|
72
90
|
"select_file": "Dosya Seç",
|
|
73
91
|
"no_file": "Dosya seçilmedi"
|
|
92
|
+
},
|
|
93
|
+
"product": {
|
|
94
|
+
"no_products": "Ürün bulunamadı",
|
|
95
|
+
"new_image": "Yeni Görsel",
|
|
96
|
+
"view_similar_styles": "Benzer Stillere Göz At",
|
|
97
|
+
"clear_all_filters": "Tüm Filtreleri Temizle",
|
|
98
|
+
"reset_to_original": "Orjinale Dön",
|
|
99
|
+
"similar_styles": "Benzer Stillere Göz At",
|
|
100
|
+
"filters": "Filtreler",
|
|
101
|
+
"active_filters": "Aktif Filtreler"
|
|
102
|
+
},
|
|
103
|
+
"similar_products": {
|
|
104
|
+
"errors": {
|
|
105
|
+
"file_size_too_large": "Görsel boyutu 5MB'dan küçük olmalıdır",
|
|
106
|
+
"invalid_image_file": "Seçilen dosya geçerli bir görsel değil",
|
|
107
|
+
"invalid_image_format": "Geçersiz görsel formatı tespit edildi",
|
|
108
|
+
"search_failed": "Arama başarısız oldu. Lütfen daha sonra tekrar deneyin",
|
|
109
|
+
"connection_failed": "Görsel arama başarısız oldu. Lütfen bağlantınızı kontrol edip tekrar deneyin",
|
|
110
|
+
"invalid_image_properties": "Geçersiz görsel özellikleri tespit edildi",
|
|
111
|
+
"file_read_error": "Dosya okuma hatası",
|
|
112
|
+
"processing_error": "Görsel işleme hatası",
|
|
113
|
+
"crop_processing_error": "Kırpılan görsel işleme hatası"
|
|
114
|
+
}
|
|
74
115
|
}
|
|
75
116
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@akinon/next/api/image-proxy';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@akinon/next/api/similar-product-list';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@akinon/next/api/similar-products';
|
|
@@ -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
|
-
|
|
8
|
-
import { Icon } from '@theme/components';
|
|
7
|
+
import { Icon, Input } from '@theme/components';
|
|
9
8
|
import Results from './results';
|
|
10
9
|
import { ROUTES } from '@theme/routes';
|
|
11
10
|
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,6 +41,14 @@ 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
|
+
|
|
44
52
|
return (
|
|
45
53
|
<>
|
|
46
54
|
<div
|
|
@@ -66,9 +74,9 @@ export default function Search() {
|
|
|
66
74
|
{t('common.search.results_for')}
|
|
67
75
|
</span>
|
|
68
76
|
<div className="flex items-center">
|
|
69
|
-
<
|
|
77
|
+
<Input
|
|
70
78
|
value={searchText}
|
|
71
|
-
onChange={
|
|
79
|
+
onChange={handleSearchTextChange}
|
|
72
80
|
onKeyDown={(e) => {
|
|
73
81
|
if (e.key === 'Enter' && searchText.trim() !== '') {
|
|
74
82
|
router.push(`${ROUTES.LIST}/?search_text=${searchText}`);
|
|
@@ -78,14 +86,21 @@ export default function Search() {
|
|
|
78
86
|
placeholder={t('common.search.placeholder')}
|
|
79
87
|
ref={inputRef}
|
|
80
88
|
/>
|
|
89
|
+
|
|
90
|
+
<PluginModule
|
|
91
|
+
component={Component.HeaderImageSearchFeature}
|
|
92
|
+
props={{}}
|
|
93
|
+
/>
|
|
94
|
+
|
|
81
95
|
<Icon
|
|
82
96
|
name="close"
|
|
83
97
|
size={14}
|
|
84
|
-
onClick={
|
|
98
|
+
onClick={handleCloseSearch}
|
|
85
99
|
className="cursor-pointer"
|
|
86
100
|
/>
|
|
87
101
|
</div>
|
|
88
102
|
</div>
|
|
103
|
+
|
|
89
104
|
<Results searchText={searchText} />
|
|
90
105
|
</div>
|
|
91
106
|
</div>
|
|
@@ -7,6 +7,7 @@ import { Product } from '@akinon/next/types';
|
|
|
7
7
|
import { Image } from '@akinon/next/components/image';
|
|
8
8
|
import useFavButton from '../../hooks/use-fav-button';
|
|
9
9
|
import { twMerge } from 'tailwind-merge';
|
|
10
|
+
import PluginModule, { Component } from '@akinon/next/components/plugin-module';
|
|
10
11
|
|
|
11
12
|
type ProductSliderItem = {
|
|
12
13
|
product: Product;
|
|
@@ -35,90 +36,102 @@ export default function ProductInfoSlider({ product }: ProductSliderItem) {
|
|
|
35
36
|
carouselRef.current?.next();
|
|
36
37
|
};
|
|
37
38
|
|
|
38
|
-
const handleThumbnailClick = (index) => {
|
|
39
|
+
const handleThumbnailClick = (index: number) => {
|
|
39
40
|
setActiveIndex(index);
|
|
40
41
|
carouselRef.current?.goToSlide(index);
|
|
41
42
|
};
|
|
42
43
|
|
|
43
44
|
return (
|
|
44
|
-
|
|
45
|
-
<div className="lg:
|
|
46
|
-
<div className="
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
<>
|
|
46
|
+
<div className="lg:grid lg:grid-cols-6">
|
|
47
|
+
<div className="lg:col-span-1">
|
|
48
|
+
<div className="flex flex-col items-center justify-center md:mr-[6px]">
|
|
49
|
+
<button
|
|
50
|
+
onClick={goToPrev}
|
|
51
|
+
className={twMerge(
|
|
52
|
+
'hidden justify-center p-2 mb-3 border border-gray-100 rounded-full cursor-pointer lg:block',
|
|
53
|
+
[activeIndex === 0 && 'cursor-not-allowed opacity-45']
|
|
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 }}
|
|
54
117
|
>
|
|
55
|
-
|
|
56
|
-
</button>
|
|
57
|
-
<div className="hidden flex-col items-center overflow-scroll w-[80px] max-h-[620px] lg:block">
|
|
58
|
-
{product?.productimage_set?.map((item, index) => (
|
|
118
|
+
{product?.productimage_set?.map((item, i) => (
|
|
59
119
|
<Image
|
|
60
|
-
key={
|
|
120
|
+
key={i}
|
|
61
121
|
src={item.image}
|
|
62
|
-
alt={
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
122
|
+
alt={product?.name || 'Product image'}
|
|
123
|
+
draggable={false}
|
|
124
|
+
aspectRatio={484 / 726}
|
|
125
|
+
sizes="(min-width: 425px) 512px,
|
|
126
|
+
(min-width: 601px) 576px,
|
|
127
|
+
(min-width: 768px) 336px,
|
|
128
|
+
(min-width: 1024px) 484px, 368px"
|
|
129
|
+
fill
|
|
69
130
|
/>
|
|
70
131
|
))}
|
|
71
|
-
</
|
|
72
|
-
<button
|
|
73
|
-
onClick={goToNext}
|
|
74
|
-
className={twMerge(
|
|
75
|
-
'hidden justify-center p-2 mt-3 border border-gray-100 rounded-full cursor-pointer lg:block',
|
|
76
|
-
[
|
|
77
|
-
activeIndex === product.productimage_set.length - 1 &&
|
|
78
|
-
'cursor-not-allowed opacity-45'
|
|
79
|
-
]
|
|
80
|
-
)}
|
|
81
|
-
disabled={activeIndex === product.productimage_set.length - 1}
|
|
82
|
-
>
|
|
83
|
-
<Icon name="chevron-down" size={15} className="fill-[#000000]" />
|
|
84
|
-
</button>
|
|
132
|
+
</CarouselCore>
|
|
85
133
|
</div>
|
|
86
134
|
</div>
|
|
87
|
-
|
|
88
|
-
<div className="relative lg:col-span-5">
|
|
89
|
-
<FavButton className="absolute right-8 top-6 z-[20] sm:hidden" />
|
|
90
|
-
|
|
91
|
-
<CarouselCore
|
|
92
|
-
responsive={{
|
|
93
|
-
all: {
|
|
94
|
-
breakpoint: { max: 5000, min: 0 },
|
|
95
|
-
items: 1
|
|
96
|
-
}
|
|
97
|
-
}}
|
|
98
|
-
arrows={false}
|
|
99
|
-
swipeable={true}
|
|
100
|
-
ref={carouselRef}
|
|
101
|
-
afterChange={(previousSlide, { currentSlide }) => {
|
|
102
|
-
setActiveIndex(currentSlide);
|
|
103
|
-
}}
|
|
104
|
-
containerAspectRatio={{ mobile: 520 / 798, desktop: 484 / 726 }}
|
|
105
|
-
>
|
|
106
|
-
{product?.productimage_set?.map((item, i) => (
|
|
107
|
-
<Image
|
|
108
|
-
key={i}
|
|
109
|
-
src={item.image}
|
|
110
|
-
alt={product.name}
|
|
111
|
-
draggable={false}
|
|
112
|
-
aspectRatio={484 / 726}
|
|
113
|
-
sizes="(min-width: 425px) 512px,
|
|
114
|
-
(min-width: 601px) 576px,
|
|
115
|
-
(min-width: 768px) 336px,
|
|
116
|
-
(min-width: 1024px) 484px, 368px"
|
|
117
|
-
fill
|
|
118
|
-
/>
|
|
119
|
-
))}
|
|
120
|
-
</CarouselCore>
|
|
121
|
-
</div>
|
|
122
|
-
</div>
|
|
135
|
+
</>
|
|
123
136
|
);
|
|
124
137
|
}
|
package/commands/plugins.ts
CHANGED