@akinon/projectzero 2.0.7-beta.0 → 2.0.7-rc.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,6 +1,12 @@
1
1
  # @akinon/projectzero
2
2
 
3
- ## 2.0.7-beta.0
3
+ ## 2.0.7-rc.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 143be2b9: ZERO-3457: Crop styles are customizable and logic improved for rendering similar products modal
8
+ - d99a6a7d: ZERO-3457_1: Fixed the settings prop and made sure everything is customizable.
9
+ - e18836b2: ZERO-4160: Restore scope in Sentry addon configuration in akinon.json
4
10
 
5
11
  ## 2.0.6
6
12
 
@@ -7,6 +7,7 @@ NEXT_PUBLIC_URL=http://localhost:3000
7
7
  SERVICE_BACKEND_URL=https://02fde10fee4440269e695aa10707dfaf.lb.akinoncloud.com
8
8
  SITEMAP_S3_BUCKET_NAME=0fb534
9
9
  NEXT_PUBLIC_VIRTUAL_TRY_ON_API_URL=https://d2a26507c7094f359aba349b96a96881.lb.akinoncloud.com
10
+ NEXT_PUBLIC_ENABLE_IMAGE_SEARCH=true
10
11
 
11
12
  # LOG_LEVEL_DEV=debug # For more details, please refer to the Logging documentation.
12
13
 
@@ -1,11 +1,9 @@
1
1
  const path = require('path');
2
2
 
3
- const buildEslintCommand = (filenames) => {
4
- // Added --fix flag to automatically fix errors that can be fixed by ESLint
5
- return `next lint --file ${filenames
6
- .map((f) => path.relative(process.cwd(), f))
7
- .join(' --file ')} --fix`;
8
- };
3
+ const buildEslintCommand = (filenames) =>
4
+ `eslint --fix ${filenames
5
+ .map((f) => `"${path.relative(process.cwd(), f)}"`)
6
+ .join(' ')}`;
9
7
 
10
8
  module.exports = {
11
9
  '**/*.(ts|tsx)': () => 'yarn tsc --noEmit',
@@ -1,37 +1,77 @@
1
1
  # projectzeronext
2
2
 
3
- ## 2.0.7-beta.0
4
-
5
- ### Patch Changes
6
-
7
- - Updated dependencies [cbbbfd75]
8
- - @akinon/next@2.0.7-beta.0
9
- - @akinon/pz-theme@2.0.7-beta.0
10
- - @akinon/pz-virtual-try-on@2.0.7-beta.0
11
- - @akinon/pz-akifast@2.0.7-beta.0
12
- - @akinon/pz-apple-pay@2.0.7-beta.0
13
- - @akinon/pz-b2b@2.0.7-beta.0
14
- - @akinon/pz-basket-gift-pack@2.0.7-beta.0
15
- - @akinon/pz-bkm@2.0.7-beta.0
16
- - @akinon/pz-checkout-gift-pack@2.0.7-beta.0
17
- - @akinon/pz-click-collect@2.0.7-beta.0
18
- - @akinon/pz-credit-payment@2.0.7-beta.0
19
- - @akinon/pz-cybersource-uc@2.0.7-beta.0
20
- - @akinon/pz-flow-payment@2.0.7-beta.0
21
- - @akinon/pz-google-pay@2.0.7-beta.0
22
- - @akinon/pz-gpay@2.0.7-beta.0
23
- - @akinon/pz-haso@2.0.7-beta.0
24
- - @akinon/pz-hepsipay@2.0.7-beta.0
25
- - @akinon/pz-masterpass@2.0.7-beta.0
26
- - @akinon/pz-masterpass-rest@2.0.7-beta.0
27
- - @akinon/pz-multi-basket@2.0.7-beta.0
28
- - @akinon/pz-one-click-checkout@2.0.7-beta.0
29
- - @akinon/pz-otp@2.0.7-beta.0
30
- - @akinon/pz-pay-on-delivery@2.0.7-beta.0
31
- - @akinon/pz-saved-card@2.0.7-beta.0
32
- - @akinon/pz-similar-products@2.0.7-beta.0
33
- - @akinon/pz-tabby-extension@2.0.7-beta.0
34
- - @akinon/pz-tamara-extension@2.0.7-beta.0
3
+ ## 2.0.7-rc.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 1a8622a9b: ZERO-3392: Implemented AI Search functionality and update env
8
+ - b55acb768: ZERO-2577: Fix pagination bug and update usePagination hook and ensure pagination controls rendering correctly
9
+ - 143be2b9: ZERO-3457: Crop styles are customizable and logic improved for rendering similar products modal
10
+ - 9f8cd3bc5: ZERO-3449: AI Search Active Filters & Crop Style changes have been implemented
11
+ - d99a6a7d: ZERO-3457_1: Fixed the settings prop and made sure everything is customizable.
12
+ - 89ed4e03: ZERO-4394: Add Next.js 16 ESLint migration v9 + flat config
13
+ - c0228aff: ZERO-4159: Upgrade the package versions
14
+ - b05c35435: ZERO-2570: Category filters routes to absolute url
15
+ - e18836b2: ZERO-4160: Restore scope in Sentry addon configuration in akinon.json
16
+ - c3244a31: ZERO-4013: Update runtime version to node:25-alpine in project configuration
17
+ - Updated dependencies [b02e7a7a]
18
+ - Updated dependencies [0cf9ea23]
19
+ - Updated dependencies [324f97d5]
20
+ - Updated dependencies [51ea0688]
21
+ - Updated dependencies
22
+ - Updated dependencies [eba125b2]
23
+ - Updated dependencies [823a4449]
24
+ - Updated dependencies [b55acb768]
25
+ - Updated dependencies [760258c1]
26
+ - Updated dependencies [5da13fff]
27
+ - Updated dependencies [143be2b9]
28
+ - Updated dependencies [7889b08f]
29
+ - Updated dependencies [fb4aa9b4]
30
+ - Updated dependencies [9f8cd3bc5]
31
+ - Updated dependencies [bfafa3f4]
32
+ - Updated dependencies [00b9f488]
33
+ - Updated dependencies [57d7eb30]
34
+ - Updated dependencies [d99a6a7d]
35
+ - Updated dependencies [89ed4e03]
36
+ - Updated dependencies [9db81a71]
37
+ - Updated dependencies [591e345e]
38
+ - Updated dependencies [0df6bc1f]
39
+ - Updated dependencies [4de5303c5]
40
+ - Updated dependencies [63a72000]
41
+ - Updated dependencies [95b139dc]
42
+ - Updated dependencies [1d00f2d0]
43
+ - Updated dependencies [4ac7b2a1]
44
+ - Updated dependencies [4998a963]
45
+ - Updated dependencies [c0228aff]
46
+ - Updated dependencies [3909d322]
47
+ - Updated dependencies [e18836b2]
48
+ - @akinon/pz-flow-payment@2.0.7-rc.0
49
+ - @akinon/next@2.0.7-rc.0
50
+ - @akinon/pz-checkout-gift-pack@2.0.7-rc.0
51
+ - @akinon/pz-one-click-checkout@2.0.7-rc.0
52
+ - @akinon/pz-basket-gift-pack@2.0.7-rc.0
53
+ - @akinon/pz-masterpass-rest@2.0.7-rc.0
54
+ - @akinon/pz-pay-on-delivery@2.0.7-rc.0
55
+ - @akinon/pz-credit-payment@2.0.7-rc.0
56
+ - @akinon/pz-click-collect@2.0.7-rc.0
57
+ - @akinon/pz-multi-basket@2.0.7-rc.0
58
+ - @akinon/pz-masterpass@2.0.7-rc.0
59
+ - @akinon/pz-gpay@2.0.7-rc.0
60
+ - @akinon/pz-b2b@2.0.7-rc.0
61
+ - @akinon/pz-bkm@2.0.7-rc.0
62
+ - @akinon/pz-otp@2.0.7-rc.0
63
+ - @akinon/pz-similar-products@2.0.7-rc.0
64
+ - @akinon/pz-virtual-try-on@2.0.7-rc.0
65
+ - @akinon/pz-theme@2.0.7-rc.0
66
+ - @akinon/pz-akifast@2.0.7-rc.0
67
+ - @akinon/pz-apple-pay@2.0.7-rc.0
68
+ - @akinon/pz-cybersource-uc@2.0.7-rc.0
69
+ - @akinon/pz-google-pay@2.0.7-rc.0
70
+ - @akinon/pz-haso@2.0.7-rc.0
71
+ - @akinon/pz-hepsipay@2.0.7-rc.0
72
+ - @akinon/pz-saved-card@2.0.7-rc.0
73
+ - @akinon/pz-tabby-extension@2.0.7-rc.0
74
+ - @akinon/pz-tamara-extension@2.0.7-rc.0
35
75
 
36
76
  ## 2.0.6
37
77
 
@@ -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
 
@@ -0,0 +1,14 @@
1
+ import { defineConfig, globalIgnores } from 'eslint/config'
2
+ import baseConfig from '@akinon/next/eslint.config.base.mjs'
3
+
4
+ export default defineConfig([
5
+ ...baseConfig,
6
+ {
7
+ settings: {
8
+ next: {
9
+ rootDir: ['src/*/']
10
+ }
11
+ }
12
+ },
13
+ globalIgnores(['public/**'])
14
+ ])
@@ -48,9 +48,12 @@ const withSerwist = withSerwistInit({
48
48
  const sentryConfig = {
49
49
  silent: true,
50
50
  dryRun: !process.env.SENTRY_DSN,
51
- org: 'akinon'
51
+ org: 'akinon',
52
52
  // project: 'enter_your_project_name_here',
53
53
  // authToken: 'enter_your_auth_token_here'
54
+ sourcemaps: {
55
+ deleteSourcemapsAfterUpload: true
56
+ }
54
57
  };
55
58
 
56
59
  const enhancedConfig = withPzConfig(nextConfig);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "projectzeronext",
3
- "version": "2.0.7-beta.0",
3
+ "version": "2.0.7-rc.0",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -10,7 +10,7 @@
10
10
  "build": "next build --webpack",
11
11
  "start": "next start -p 8008",
12
12
  "type-check": "tsc",
13
- "lint": "next lint",
13
+ "lint": "eslint .",
14
14
  "test": "jest",
15
15
  "cypress:headless": "cd projectzeroe2e && yarn headless",
16
16
  "e2e:headless": "CYPRESS_BASE_URL=http://localhost:3000 start-server-and-test start http://localhost:3000 cypress:headless",
@@ -24,33 +24,33 @@
24
24
  "test:middleware": "jest middleware-matcher.test.ts --bail"
25
25
  },
26
26
  "dependencies": {
27
- "@akinon/next": "2.0.7-beta.0",
28
- "@akinon/pz-akifast": "2.0.7-beta.0",
29
- "@akinon/pz-apple-pay": "2.0.7-beta.0",
30
- "@akinon/pz-b2b": "2.0.7-beta.0",
31
- "@akinon/pz-basket-gift-pack": "2.0.7-beta.0",
32
- "@akinon/pz-bkm": "2.0.7-beta.0",
33
- "@akinon/pz-checkout-gift-pack": "2.0.7-beta.0",
34
- "@akinon/pz-click-collect": "2.0.7-beta.0",
35
- "@akinon/pz-credit-payment": "2.0.7-beta.0",
36
- "@akinon/pz-cybersource-uc": "2.0.7-beta.0",
37
- "@akinon/pz-flow-payment": "2.0.7-beta.0",
38
- "@akinon/pz-google-pay": "2.0.7-beta.0",
39
- "@akinon/pz-gpay": "2.0.7-beta.0",
40
- "@akinon/pz-haso": "2.0.7-beta.0",
41
- "@akinon/pz-hepsipay": "2.0.7-beta.0",
42
- "@akinon/pz-masterpass": "2.0.7-beta.0",
43
- "@akinon/pz-masterpass-rest": "2.0.7-beta.0",
44
- "@akinon/pz-multi-basket": "2.0.7-beta.0",
45
- "@akinon/pz-one-click-checkout": "2.0.7-beta.0",
46
- "@akinon/pz-otp": "2.0.7-beta.0",
47
- "@akinon/pz-pay-on-delivery": "2.0.7-beta.0",
48
- "@akinon/pz-saved-card": "2.0.7-beta.0",
49
- "@akinon/pz-similar-products": "2.0.7-beta.0",
50
- "@akinon/pz-tabby-extension": "2.0.7-beta.0",
51
- "@akinon/pz-tamara-extension": "2.0.7-beta.0",
52
- "@akinon/pz-theme": "2.0.7-beta.0",
53
- "@akinon/pz-virtual-try-on": "2.0.7-beta.0",
27
+ "@akinon/next": "2.0.7-rc.0",
28
+ "@akinon/pz-akifast": "2.0.7-rc.0",
29
+ "@akinon/pz-apple-pay": "2.0.7-rc.0",
30
+ "@akinon/pz-b2b": "2.0.7-rc.0",
31
+ "@akinon/pz-basket-gift-pack": "2.0.7-rc.0",
32
+ "@akinon/pz-bkm": "2.0.7-rc.0",
33
+ "@akinon/pz-checkout-gift-pack": "2.0.7-rc.0",
34
+ "@akinon/pz-click-collect": "2.0.7-rc.0",
35
+ "@akinon/pz-credit-payment": "2.0.7-rc.0",
36
+ "@akinon/pz-cybersource-uc": "2.0.7-rc.0",
37
+ "@akinon/pz-flow-payment": "2.0.7-rc.0",
38
+ "@akinon/pz-google-pay": "2.0.7-rc.0",
39
+ "@akinon/pz-gpay": "2.0.7-rc.0",
40
+ "@akinon/pz-haso": "2.0.7-rc.0",
41
+ "@akinon/pz-hepsipay": "2.0.7-rc.0",
42
+ "@akinon/pz-masterpass": "2.0.7-rc.0",
43
+ "@akinon/pz-masterpass-rest": "2.0.7-rc.0",
44
+ "@akinon/pz-multi-basket": "2.0.7-rc.0",
45
+ "@akinon/pz-one-click-checkout": "2.0.7-rc.0",
46
+ "@akinon/pz-otp": "2.0.7-rc.0",
47
+ "@akinon/pz-pay-on-delivery": "2.0.7-rc.0",
48
+ "@akinon/pz-saved-card": "2.0.7-rc.0",
49
+ "@akinon/pz-similar-products": "2.0.7-rc.0",
50
+ "@akinon/pz-tabby-extension": "2.0.7-rc.0",
51
+ "@akinon/pz-tamara-extension": "2.0.7-rc.0",
52
+ "@akinon/pz-theme": "2.0.7-rc.0",
53
+ "@akinon/pz-virtual-try-on": "2.0.7-rc.0",
54
54
  "@hookform/resolvers": "2.9.0",
55
55
  "@next/third-parties": "16.2.4",
56
56
  "@react-google-maps/api": "2.17.1",
@@ -59,7 +59,7 @@
59
59
  "next": "16.2.4",
60
60
  "@serwist/next": "9.5.11",
61
61
  "next-auth": "5.0.0-beta.30",
62
- "pino": "8.11.0",
62
+ "pino": "8.21.0",
63
63
  "serwist": "9.5.11",
64
64
  "postcss": "8.4.49",
65
65
  "react": "19.2.5",
@@ -67,14 +67,14 @@
67
67
  "react-google-recaptcha": "2.1.0",
68
68
  "react-hook-form": "7.71.2",
69
69
  "react-intersection-observer": "9.4.0",
70
- "react-multi-carousel": "2.8.4",
71
- "react-string-replace": "1.1.0",
72
- "start-server-and-test": "2.0.3",
73
- "tailwind-merge": "1.8.0",
70
+ "react-multi-carousel": "2.8.5",
71
+ "react-string-replace": "1.1.1",
72
+ "start-server-and-test": "2.0.8",
73
+ "tailwind-merge": "1.14.0",
74
74
  "yup": "0.32.11"
75
75
  },
76
76
  "devDependencies": {
77
- "@akinon/eslint-plugin-projectzero": "2.0.7-beta.0",
77
+ "@akinon/eslint-plugin-projectzero": "2.0.7-rc.0",
78
78
  "@semantic-release/changelog": "6.0.2",
79
79
  "@semantic-release/exec": "6.0.3",
80
80
  "@semantic-release/git": "10.0.1",
@@ -88,28 +88,26 @@
88
88
  "@types/jest": "29.5.14",
89
89
  "@types/react": "19.2.14",
90
90
  "@types/react-dom": "19.2.3",
91
- "@typescript-eslint/eslint-plugin": "6.7.4",
92
- "@typescript-eslint/parser": "6.7.4",
93
91
  "client-only": "0.0.1",
94
- "clsx": "1.1.1",
92
+ "clsx": "1.2.1",
95
93
  "currency-symbol-map": "5.1.0",
96
- "eslint": "8.14.0",
94
+ "eslint": "9.39.4",
97
95
  "eslint-config-next": "16.2.4",
98
- "eslint-config-prettier": "8.5.0",
96
+ "eslint-config-prettier": "10.1.1",
99
97
  "husky": "8.0.0",
100
98
  "jest": "29.7.0",
101
- "jest-css-modules-transform": "4.3.0",
99
+ "jest-css-modules-transform": "4.4.2",
102
100
  "jest-environment-jsdom": "29.7.0",
103
- "lint-staged": "13.1.0",
104
- "prettier": "2.6.2",
101
+ "lint-staged": "13.3.0",
102
+ "prettier": "2.8.8",
105
103
  "react-number-format": "5.3.4",
106
- "sass": "1.49.9",
104
+ "sass": "1.83.0",
107
105
  "semantic-release": "19.0.5",
108
106
  "server-only": "0.0.1",
109
- "stylelint": "14.6.0",
107
+ "stylelint": "14.16.1",
110
108
  "stylelint-config-sass-guidelines": "9.0.1",
111
109
  "stylelint-config-standard": "25.0.0",
112
- "stylelint-scss": "4.2.0",
110
+ "stylelint-scss": "4.7.0",
113
111
  "stylelint-selector-bem-pattern": "2.1.1",
114
112
  "tailwindcss": "4.2.0",
115
113
  "ts-jest": "29.2.6",
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "title": "Reset Password",
3
3
  "description": "Enter your email address and we'll send you a link to reset your password.",
4
+ "description_first": "Enter your email address,",
5
+ "description_second": "we'll send you a link to reset your password.",
4
6
  "back_to_login": "Back to login",
5
7
  "form": {
6
8
  "email": {
@@ -13,7 +15,8 @@
13
15
  },
14
16
  "success": {
15
17
  "title": "Reset Password",
16
- "subtitle": "We've sent a password reset link to {EMAIL}. Please check your inbox and follow the instructions."
18
+ "subtitle": "We've sent a password reset link to {EMAIL}. Please check your inbox and follow the instructions.",
19
+ "button": "Continue to Homepage"
17
20
  }
18
21
  },
19
22
  "create_new_password": {
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "title": "Şifre Sıfırlama",
3
3
  "description": "E-posta adresinizi girin, şifrenizi sıfırlamanız için size bir bağlantı gönderelim.",
4
+ "description_first": "E-posta adresinizi girin,",
5
+ "description_second": "şifrenizi sıfırlamanız için size bir bağlantı gönderelim.",
4
6
  "back_to_login": "Girişe dön",
5
7
  "form": {
6
8
  "email": {
@@ -13,7 +15,8 @@
13
15
  },
14
16
  "success": {
15
17
  "title": "Şifre Sıfırlama",
16
- "subtitle": "{EMAIL} adresine bir şifre sıfırlama bağlantısı gönderdik. Lütfen gelen kutunuzu kontrol edin ve talimatları izleyin."
18
+ "subtitle": "{EMAIL} adresine bir şifre sıfırlama bağlantısı gönderdik. Lütfen gelen kutunuzu kontrol edin ve talimatları izleyin.",
19
+ "button": "Ana Sayfaya Devam Et"
17
20
  }
18
21
  },
19
22
  "create_new_password": {
@@ -0,0 +1,22 @@
1
+ 'use client';
2
+
3
+ import { useSentryUncaughtErrors } from '@akinon/next/hooks';
4
+
5
+ export default function GlobalError({
6
+ error,
7
+ reset
8
+ }: {
9
+ error: Error & { digest?: string };
10
+ reset: () => void;
11
+ }) {
12
+ useSentryUncaughtErrors(error);
13
+
14
+ return (
15
+ <html>
16
+ <body>
17
+ <h2>Something went wrong!</h2>
18
+ <button onClick={() => reset()}>Try again</button>
19
+ </body>
20
+ </html>
21
+ );
22
+ }
@@ -1 +1,3 @@
1
+ export * from './use-contract';
2
+ export * from './use-fav-button';
1
3
  export * from './use-add-product-to-basket';
@@ -19,6 +19,7 @@ module.exports = [
19
19
  'pz-hepsipay',
20
20
  'pz-flow-payment',
21
21
  'pz-virtual-try-on',
22
+ 'pz-similar-products',
22
23
  'pz-cybersource-uc',
23
24
  'pz-hepsipay',
24
25
  'pz-masterpass-rest',
@@ -14,7 +14,8 @@ export const config = {
14
14
  '/((?!api|_next|[\\w-\\/*]+\\.\\w+).*)',
15
15
  '/(.*sitemap\\.xml)',
16
16
  '/(.+\\.)(html|htm|aspx|asp|php)',
17
- '/(.*orders\\/checkout-with-token.*)'
17
+ '/(.*orders\\/checkout-with-token.*)',
18
+ '/(.*orders\\/post-checkout.*)'
18
19
  ]
19
20
  };
20
21
 
@@ -4,8 +4,7 @@ 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';
@@ -42,6 +41,14 @@ export default function Search() {
42
41
  };
43
42
  }, [isSearchOpen, dispatch]);
44
43
 
44
+ const handleSearchTextChange = (e: React.ChangeEvent<HTMLInputElement>) => {
45
+ setSearchText(e.target.value);
46
+ };
47
+
48
+ const handleCloseSearch = () => {
49
+ dispatch(closeSearch());
50
+ };
51
+
45
52
  return (
46
53
  <>
47
54
  <div
@@ -67,9 +74,9 @@ export default function Search() {
67
74
  {t('common.search.results_for')}
68
75
  </span>
69
76
  <div className="flex items-center">
70
- <input
77
+ <Input
71
78
  value={searchText}
72
- onChange={(e) => setSearchText(e.target.value)}
79
+ onChange={handleSearchTextChange}
73
80
  onKeyDown={(e) => {
74
81
  if (e.key === 'Enter' && searchText.trim() !== '') {
75
82
  router.push(`${ROUTES.LIST}/?search_text=${searchText}`);
@@ -91,11 +98,12 @@ export default function Search() {
91
98
  <Icon
92
99
  name="close"
93
100
  size={14}
94
- onClick={() => dispatch(closeSearch())}
101
+ onClick={handleCloseSearch}
95
102
  className="cursor-pointer"
96
103
  />
97
104
  </div>
98
105
  </div>
106
+
99
107
  <Results searchText={searchText} />
100
108
  </div>
101
109
  </div>
@@ -36,53 +36,100 @@ export default function ProductInfoSlider({ product }: ProductSliderItem) {
36
36
  carouselRef.current?.next();
37
37
  };
38
38
 
39
- const handleThumbnailClick = (index) => {
39
+ const handleThumbnailClick = (index: number) => {
40
40
  setActiveIndex(index);
41
41
  carouselRef.current?.goToSlide(index);
42
42
  };
43
43
 
44
44
  return (
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}
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 }}
55
117
  >
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) => (
118
+ {product?.productimage_set?.map((item, i) => (
60
119
  <Image
61
- key={index}
120
+ key={i}
62
121
  src={item.image}
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)}
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
70
130
  />
71
131
  ))}
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>
132
+ </CarouselCore>
86
133
  </div>
87
134
  </div>
88
135
 
@@ -140,6 +187,6 @@ export default function ProductInfoSlider({ product }: ProductSliderItem) {
140
187
  ))}
141
188
  </CarouselCore>
142
189
  </div>
143
- </div>
190
+ </>
144
191
  );
145
192
  }
@@ -164,6 +164,10 @@ 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
+ },
167
171
  {
168
172
  name: 'Hepsipay',
169
173
  value: 'pz-hepsipay'
@@ -183,6 +183,10 @@ 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
+ },
186
190
  {
187
191
  name: 'Hepsipay',
188
192
  value: 'pz-hepsipay'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/projectzero",
3
- "version": "2.0.7-beta.0",
3
+ "version": "2.0.7-rc.0",
4
4
  "private": false,
5
5
  "description": "CLI tool to manage your Project Zero Next project",
6
6
  "bin": {
@@ -1 +0,0 @@
1
- public
@@ -1,10 +0,0 @@
1
- const baseConfig = require('@akinon/next/.eslintrc')
2
-
3
- module.exports = {
4
- ...baseConfig,
5
- settings: {
6
- next: {
7
- rootDir: ['src/*/']
8
- }
9
- },
10
- };