@akinon/pz-similar-products 1.116.0 → 1.117.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @akinon/pz-similar-products
|
|
2
2
|
|
|
3
|
+
## 1.117.0-rc.1
|
|
4
|
+
|
|
5
|
+
## 1.117.0-rc.0
|
|
6
|
+
|
|
7
|
+
### Minor Changes
|
|
8
|
+
|
|
9
|
+
- 143be2b9: ZERO-3457: Crop styles are customizable and logic improved for rendering similar products modal
|
|
10
|
+
- d99a6a7d: ZERO-3457_1: Fixed the settings prop and made sure everything is customizable.
|
|
11
|
+
|
|
3
12
|
## 1.116.0
|
|
4
13
|
|
|
5
14
|
## 1.115.0
|
package/package.json
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
const IMAGE_SEARCH_STORAGE_KEY = 'enable_image_search';
|
|
4
|
+
|
|
5
|
+
export function useImageSearchFeature() {
|
|
6
|
+
const [isEnabled, setIsEnabled] = useState(false);
|
|
7
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
8
|
+
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const envEnabled = process.env.NEXT_PUBLIC_ENABLE_IMAGE_SEARCH === 'true';
|
|
11
|
+
|
|
12
|
+
if (envEnabled) {
|
|
13
|
+
setIsEnabled(true);
|
|
14
|
+
setIsLoading(false);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
const localStorageValue = localStorage.getItem(IMAGE_SEARCH_STORAGE_KEY);
|
|
20
|
+
setIsEnabled(localStorageValue === 'true');
|
|
21
|
+
} catch (error) {
|
|
22
|
+
setIsEnabled(false);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
setIsLoading(false);
|
|
26
|
+
}, []);
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
isEnabled,
|
|
30
|
+
isLoading
|
|
31
|
+
};
|
|
32
|
+
}
|