@nyris/nyris-webapp 0.3.46 → 0.3.48
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/build/asset-manifest.json +16 -12
- package/build/index.html +1 -1
- package/build/js/settings.example.js +84 -13
- package/build/{precache-manifest.003c83b03ba38cefb9af2060ababe0b4.js → precache-manifest.87ecf17e376539dad2c663829130bfdc.js} +26 -10
- package/build/service-worker.js +1 -1
- package/build/static/css/main.24b5a712.chunk.css +2 -0
- package/build/static/css/main.24b5a712.chunk.css.map +1 -0
- package/build/static/js/2.f9395632.chunk.js +3 -0
- package/build/static/js/2.f9395632.chunk.js.map +1 -0
- package/build/static/js/main.e2a2eb38.chunk.js +3 -0
- package/build/static/js/main.e2a2eb38.chunk.js.map +1 -0
- package/build/static/media/add.ba46a4bf.svg +4 -0
- package/build/static/media/arrow_left.fd9d4390.svg +3 -0
- package/build/static/media/arrow_right.c6fdab0b.svg +3 -0
- package/build/static/media/minus.3fce6c0a.svg +3 -0
- package/package.json +4 -4
- package/public/js/settings.example.js +84 -13
- package/src/Store/Store.ts +1 -0
- package/src/Store/search/Search.ts +36 -0
- package/src/Store/search/search.initialState.ts +1 -0
- package/src/Store/search/types.ts +1 -0
- package/src/common/assets/icons/add.svg +4 -0
- package/src/common/assets/icons/minus.svg +3 -0
- package/src/components/HeaderMobile.tsx +33 -12
- package/src/components/ImagePreviewMobile.tsx +52 -134
- package/src/components/Inquiry/InquiryBanner.tsx +6 -3
- package/src/components/Layout.tsx +19 -1
- package/src/components/MobilePostFilter.tsx +14 -5
- package/src/components/PanelResult/PostFilter.tsx +314 -0
- package/src/components/PanelResult/{index.tsx → PostFilterAlgolia.tsx} +44 -15
- package/src/components/PanelResult/expandable-panel.tsx +20 -14
- package/src/components/ProductAttribute.tsx +38 -34
- package/src/components/ProductDetailView.tsx +37 -22
- package/src/components/ProductList/index.tsx +0 -3
- package/src/components/ProductList/useProductList.ts +6 -3
- package/src/components/SelectedPostFilter.tsx +103 -0
- package/src/components/SidePanel.tsx +40 -22
- package/src/components/appMobile.scss +7 -0
- package/src/components/common.scss +4 -0
- package/src/components/current-refinements/getCurrentRefinement.ts +10 -18
- package/src/components/drawer/cameraCustom.tsx +14 -64
- package/src/components/icon-label/icon-label.tsx +23 -18
- package/src/components/input/inputSearch.tsx +2 -2
- package/src/components/pre-filter/index.tsx +16 -10
- package/src/components/results/ItemResult.tsx +33 -22
- package/src/hooks/useFilter.ts +92 -0
- package/src/hooks/useFilteredResult.ts +29 -0
- package/src/index.css +2 -1
- package/src/page/landingPage/AppMD.tsx +1 -5
- package/src/page/landingPage/common.scss +10 -3
- package/src/page/result/index.tsx +37 -29
- package/src/services/image.ts +0 -5
- package/src/translations.ts +16 -0
- package/src/types.ts +1 -5
- package/build/static/css/main.5b89f23f.chunk.css +0 -2
- package/build/static/css/main.5b89f23f.chunk.css.map +0 -1
- package/build/static/js/2.f3840c8e.chunk.js +0 -3
- package/build/static/js/2.f3840c8e.chunk.js.map +0 -1
- package/build/static/js/main.d68884f6.chunk.js +0 -3
- package/build/static/js/main.d68884f6.chunk.js.map +0 -1
- /package/build/static/js/{2.f3840c8e.chunk.js.LICENSE.txt → 2.f9395632.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{main.d68884f6.chunk.js.LICENSE.txt → main.e2a2eb38.chunk.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
|
|
2
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<path d="M8.625 7.375V3.625C8.625 3.27982 8.34518 3 8 3C7.65482 3 7.375 3.27982 7.375 3.625V7.375H3.625C3.27982 7.375 3 7.65482 3 8C3 8.34518 3.27982 8.625 3.625 8.625H7.375V12.375C7.375 12.7202 7.65482 13 8 13C8.34518 13 8.625 12.7202 8.625 12.375V8.625H12.375C12.7202 8.625 13 8.34518 13 8C13 7.65482 12.7202 7.375 12.375 7.375H8.625Z" fill="#2B2C46"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M6.07845 9.15944C5.74747 8.78211 5.74747 8.21789 6.07845 7.84056L9.53895 3.8956C9.72281 3.68599 10.0491 3.68599 10.233 3.8956C10.3858 4.06978 10.3858 4.33022 10.233 4.5044L7.30652 7.84056C6.97554 8.21789 6.97554 8.78211 7.30652 9.15944L10.233 12.4956C10.3858 12.6698 10.3858 12.9302 10.233 13.1044C10.0491 13.314 9.72281 13.314 9.53895 13.1044L6.07845 9.15944Z" fill="#2B2C46"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M9.92155 9.15944C10.2525 8.78211 10.2525 8.21789 9.92155 7.84056L6.46105 3.8956C6.27719 3.68599 5.95088 3.68599 5.76702 3.8956C5.61423 4.06978 5.61423 4.33022 5.76702 4.5044L8.69348 7.84056C9.02446 8.21789 9.02446 8.78211 8.69348 9.15944L5.76702 12.4956C5.61423 12.6698 5.61423 12.9302 5.76702 13.1044C5.95088 13.314 6.27719 13.314 6.46105 13.1044L9.92155 9.15944Z" fill="#2B2C46"/>
|
|
3
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nyris/nyris-webapp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.48",
|
|
4
4
|
"homepage": "./",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@algolia/autocomplete-js": "^1.7.1",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"@material-ui/data-grid": "^4.0.0-alpha.37",
|
|
14
14
|
"@material-ui/icons": "^4.4.1",
|
|
15
15
|
"@material-ui/lab": "^4.0.0-alpha.60",
|
|
16
|
-
"@nyris/nyris-api": "^0.3.
|
|
17
|
-
"@nyris/nyris-react-components": "^0.3.
|
|
16
|
+
"@nyris/nyris-api": "^0.3.48",
|
|
17
|
+
"@nyris/nyris-react-components": "^0.3.48",
|
|
18
18
|
"@reduxjs/toolkit": "^1.6.1",
|
|
19
19
|
"@splidejs/react-splide": "^0.7.12",
|
|
20
20
|
"@types/blueimp-load-image": "^2.23.4",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"react-scripts": "^3.4.1",
|
|
58
58
|
"react-select": "^5.2.2",
|
|
59
59
|
"react-table": "^7.7.0",
|
|
60
|
-
"react-webcam": "^7.0
|
|
60
|
+
"react-webcam": "^7.2.0",
|
|
61
61
|
"redux": "^4.0.4",
|
|
62
62
|
"redux-observable": "^1.1.0",
|
|
63
63
|
"redux-thunk": "^2.4.1",
|
|
@@ -1,19 +1,90 @@
|
|
|
1
1
|
var settings = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
auth0: {
|
|
3
|
+
enabled: '',
|
|
4
|
+
domain: '',
|
|
5
|
+
clientId: '',
|
|
6
|
+
supportEmail: '',
|
|
7
|
+
},
|
|
8
|
+
algolia: {
|
|
9
|
+
apiKey: '',
|
|
10
|
+
appId: '',
|
|
11
|
+
indexName: '',
|
|
12
|
+
},
|
|
13
|
+
alogoliaFilterField: 'keyword',
|
|
14
|
+
refinements: [
|
|
15
|
+
{
|
|
16
|
+
attribute: 'brand',
|
|
17
|
+
header: 'Brands',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
attribute: 'keyword_0',
|
|
21
|
+
header: 'Category',
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
// Nyris - visual search
|
|
25
|
+
apiKey: '',
|
|
26
|
+
baseUrl: 'https://api.nyris.io',
|
|
5
27
|
jpegQuality: 0.9,
|
|
28
|
+
maxHeight: 1024,
|
|
29
|
+
maxWidth: 1024,
|
|
6
30
|
regions: true,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
|
|
31
|
+
responseFormat: 'application/offers.complete+json',
|
|
32
|
+
visualSearchFilterKey: '',
|
|
33
|
+
// UI - theme
|
|
34
|
+
theme: {
|
|
35
|
+
appBarLogoUrl: '',
|
|
36
|
+
headerColor: '',
|
|
37
|
+
logoHeight: '',
|
|
38
|
+
logoWidth: '',
|
|
39
|
+
primaryColor: '',
|
|
40
|
+
secondaryColor: '',
|
|
41
|
+
},
|
|
42
|
+
language: 'en',
|
|
43
|
+
// features
|
|
44
|
+
shareOption: '',
|
|
45
|
+
showFeedbackAndShare: '',
|
|
46
|
+
showPoweredByNyris: '',
|
|
47
|
+
warehouseVariant: false,
|
|
48
|
+
postFilterOption: '',
|
|
49
|
+
preFilterOption: '',
|
|
50
|
+
rfq: {
|
|
51
|
+
enabled: '',
|
|
52
|
+
emailTemplateId: '',
|
|
53
|
+
},
|
|
54
|
+
support: {
|
|
55
|
+
enabled: '',
|
|
56
|
+
emailInquiry: '',
|
|
57
|
+
emailTemplateId: '',
|
|
58
|
+
supportNumber: '',
|
|
59
|
+
description: '',
|
|
60
|
+
},
|
|
61
|
+
cadenas: {
|
|
62
|
+
catalog: '',
|
|
63
|
+
cadenasAPIKey: '',
|
|
64
|
+
cadenas3dWebView: '',
|
|
65
|
+
},
|
|
66
|
+
//UI - labels
|
|
67
|
+
appTitle: '',
|
|
68
|
+
brandName: '',
|
|
69
|
+
headerText: '',
|
|
70
|
+
itemIdLabel: 'SKU',
|
|
71
|
+
preFilterTitle: '',
|
|
72
|
+
CTAButtonText: '',
|
|
73
|
+
//field mappins
|
|
74
|
+
field: {
|
|
75
|
+
ctaLinkField: 'main_offer_link',
|
|
76
|
+
productName: 'title',
|
|
77
|
+
productDetails: 'keyword_1',
|
|
78
|
+
manufacturerNumber: 'keyword_0',
|
|
79
|
+
productTag: 'brand',
|
|
80
|
+
//WarehouseVariant
|
|
81
|
+
warehouseNumber: 'custom_id_key_2',
|
|
82
|
+
warehouseNumberValue: 'custom_id_value_2',
|
|
83
|
+
warehouseShelfNumber: 'custom_id_key_1',
|
|
84
|
+
warehouseShelfNumberValue: 'custom_id_value_1',
|
|
85
|
+
warehouseStock: 'custom_id_key_3',
|
|
86
|
+
warehouseStockValue: 'custom_id_value_3',
|
|
87
|
+
},
|
|
17
88
|
};
|
|
18
89
|
settings['customSearchRequest'] = null;
|
|
19
90
|
settings['responseHook'] = null;
|
package/src/Store/Store.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { RectCoords, Region } from '@nyris/nyris-api';
|
|
|
2
2
|
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
|
3
3
|
import { DEFAULT_REGION } from '../../constants';
|
|
4
4
|
import { initialState } from './search.initialState';
|
|
5
|
+
import { isUndefined } from 'lodash';
|
|
5
6
|
|
|
6
7
|
export const searchSlice = createSlice({
|
|
7
8
|
name: 'search',
|
|
@@ -156,6 +157,7 @@ export const searchSlice = createSlice({
|
|
|
156
157
|
textSearchInputMobile: '',
|
|
157
158
|
isShowModalDetailItemMobile: false,
|
|
158
159
|
preFilter: state.preFilter || {},
|
|
160
|
+
postFilter: {},
|
|
159
161
|
preFilterDropdown: false,
|
|
160
162
|
imageCaptureHelpModal: false,
|
|
161
163
|
};
|
|
@@ -260,11 +262,44 @@ export const searchSlice = createSlice({
|
|
|
260
262
|
filter: data.payload,
|
|
261
263
|
};
|
|
262
264
|
},
|
|
265
|
+
setPostFilter: (state, data: PayloadAction<Record<string, string>>) => {
|
|
266
|
+
const { payload } = data;
|
|
267
|
+
|
|
268
|
+
let filter = { ...state.postFilter } || {};
|
|
269
|
+
const key = Object.keys(payload)[0];
|
|
270
|
+
|
|
271
|
+
if (
|
|
272
|
+
!isUndefined(filter[key]) &&
|
|
273
|
+
!isUndefined(filter[key][payload[key]])
|
|
274
|
+
) {
|
|
275
|
+
filter[key] = {
|
|
276
|
+
...filter[key],
|
|
277
|
+
[payload[key]]: !filter[key][payload[key]],
|
|
278
|
+
};
|
|
279
|
+
} else if (!filter[key]) {
|
|
280
|
+
filter = { ...filter, [key]: { [payload[key]]: true } };
|
|
281
|
+
} else {
|
|
282
|
+
filter[key] = { ...filter[key], [payload[key]]: true };
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
return {
|
|
286
|
+
...state,
|
|
287
|
+
postFilter: { ...filter },
|
|
288
|
+
};
|
|
289
|
+
},
|
|
290
|
+
|
|
291
|
+
clearPostFilter: state => {
|
|
292
|
+
return {
|
|
293
|
+
...state,
|
|
294
|
+
postFilter: {},
|
|
295
|
+
};
|
|
296
|
+
},
|
|
263
297
|
},
|
|
264
298
|
});
|
|
265
299
|
|
|
266
300
|
export const {
|
|
267
301
|
changeValueTextSearch,
|
|
302
|
+
clearPostFilter,
|
|
268
303
|
configureFilter,
|
|
269
304
|
loadFileSelectRegion,
|
|
270
305
|
loadingActionRegions,
|
|
@@ -279,6 +314,7 @@ export const {
|
|
|
279
314
|
setFilter,
|
|
280
315
|
setImageCaptureHelpModal,
|
|
281
316
|
setImageSearchInput,
|
|
317
|
+
setPostFilter,
|
|
282
318
|
setPreFilter,
|
|
283
319
|
setPreFilterDropdown,
|
|
284
320
|
setRegions,
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
|
|
2
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<path d="M8.625 7.375V3.625C8.625 3.27982 8.34518 3 8 3C7.65482 3 7.375 3.27982 7.375 3.625V7.375H3.625C3.27982 7.375 3 7.65482 3 8C3 8.34518 3.27982 8.625 3.625 8.625H7.375V12.375C7.375 12.7202 7.65482 13 8 13C8.34518 13 8.625 12.7202 8.625 12.375V8.625H12.375C12.7202 8.625 13 8.34518 13 8C13 7.65482 12.7202 7.375 12.375 7.375H8.625Z" fill="#2B2C46"/>
|
|
4
|
+
</svg>
|
|
@@ -55,6 +55,8 @@ function HeaderMobileComponent(props: Props): JSX.Element {
|
|
|
55
55
|
queryText,
|
|
56
56
|
requestImage,
|
|
57
57
|
selectedRegion,
|
|
58
|
+
results,
|
|
59
|
+
postFilter,
|
|
58
60
|
} = search;
|
|
59
61
|
|
|
60
62
|
const query = useQuery();
|
|
@@ -162,16 +164,30 @@ function HeaderMobileComponent(props: Props): JSX.Element {
|
|
|
162
164
|
);
|
|
163
165
|
const isPostFilterApplied = useMemo(() => {
|
|
164
166
|
let isApplied = false;
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
if (
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
167
|
+
|
|
168
|
+
if (settings.algolia.enabled) {
|
|
169
|
+
if (!valueTextSearch?.refinementList) return false;
|
|
170
|
+
Object.keys(valueTextSearch?.refinementList).forEach(key => {
|
|
171
|
+
if (typeof valueTextSearch.refinementList[key] === 'object') {
|
|
172
|
+
isApplied = true;
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
} else {
|
|
177
|
+
Object.keys(postFilter).forEach(key => {
|
|
178
|
+
const filter = postFilter[key];
|
|
179
|
+
Object.keys(filter).forEach(value => {
|
|
180
|
+
if (filter[value]) {
|
|
181
|
+
isApplied = true;
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
|
|
172
188
|
return isApplied;
|
|
173
189
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
174
|
-
}, [valueTextSearch?.refinementList]);
|
|
190
|
+
}, [valueTextSearch?.refinementList, settings, postFilter]);
|
|
175
191
|
|
|
176
192
|
const onChangeText = (event: any) => {
|
|
177
193
|
// debounceSearch(event.currentTarget.value);
|
|
@@ -184,11 +200,16 @@ function HeaderMobileComponent(props: Props): JSX.Element {
|
|
|
184
200
|
}
|
|
185
201
|
};
|
|
186
202
|
const disablePostFilter = useMemo(() => {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
203
|
+
if (settings.algolia.enabled) {
|
|
204
|
+
return settings.postFilterOption &&
|
|
205
|
+
props.allSearchResults?.hits.length > 0
|
|
206
|
+
? false
|
|
207
|
+
: true;
|
|
208
|
+
} else {
|
|
209
|
+
return settings.postFilterOption && results?.length > 0 ? false : true;
|
|
210
|
+
}
|
|
190
211
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
191
|
-
}, [settings
|
|
212
|
+
}, [settings, results, props.allSearchResults?.hits]);
|
|
192
213
|
|
|
193
214
|
return (
|
|
194
215
|
<div style={{ width: '100%', background: '#fff' }}>
|
|
@@ -41,7 +41,6 @@ function ImagePreviewMobileComponent({
|
|
|
41
41
|
const { t } = useTranslation();
|
|
42
42
|
const { refine }: any = rest;
|
|
43
43
|
const [editActive, setEditActive] = useState(false);
|
|
44
|
-
const [showShrinkAnimation, setShrinkAnimation] = useState(false);
|
|
45
44
|
const settings = useAppSelector(state => state.settings);
|
|
46
45
|
const { preFilter } = useAppSelector(state => state.search);
|
|
47
46
|
const isAlgoliaEnabled = settings.algolia?.enabled;
|
|
@@ -51,7 +50,6 @@ function ImagePreviewMobileComponent({
|
|
|
51
50
|
|
|
52
51
|
const handleArrowClick = () => {
|
|
53
52
|
setEditActive(s => !s);
|
|
54
|
-
setShrinkAnimation(true);
|
|
55
53
|
};
|
|
56
54
|
|
|
57
55
|
const searchQuery = query.get('query') || '';
|
|
@@ -117,12 +115,14 @@ function ImagePreviewMobileComponent({
|
|
|
117
115
|
marginBottom: '15px',
|
|
118
116
|
}}
|
|
119
117
|
>
|
|
120
|
-
|
|
121
|
-
<
|
|
122
|
-
<Box
|
|
123
|
-
<
|
|
124
|
-
className="preview-item
|
|
125
|
-
style={{
|
|
118
|
+
<div>
|
|
119
|
+
<Box className="box-preview">
|
|
120
|
+
<Box>
|
|
121
|
+
<div
|
|
122
|
+
className="preview-item"
|
|
123
|
+
style={{
|
|
124
|
+
backgroundColor: 'transparent',
|
|
125
|
+
}}
|
|
126
126
|
>
|
|
127
127
|
<Preview
|
|
128
128
|
key={requestImage?.id}
|
|
@@ -133,104 +133,52 @@ function ImagePreviewMobileComponent({
|
|
|
133
133
|
image={requestImage?.canvas}
|
|
134
134
|
selection={imageSelection || DEFAULT_REGION}
|
|
135
135
|
regions={filteredRegions}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
136
|
+
minWidth={80}
|
|
137
|
+
minHeight={80}
|
|
138
|
+
maxWidth={255}
|
|
139
|
+
maxHeight={255}
|
|
140
|
+
dotColor={editActive ? '#FBD914' : ''}
|
|
141
|
+
minCropWidth={editActive ? 60 : 5}
|
|
142
|
+
minCropHeight={editActive ? 60 : 5}
|
|
141
143
|
rounded={false}
|
|
142
|
-
expandAnimation={
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
<Box
|
|
147
|
-
className="box-title_col-left"
|
|
148
|
-
alignItems="center"
|
|
149
|
-
style={{
|
|
150
|
-
backgroundColor: '#3E36DC',
|
|
151
|
-
display: 'flex',
|
|
152
|
-
columnGap: '6px',
|
|
153
|
-
padding: '5px',
|
|
154
|
-
width: 'fit-content',
|
|
144
|
+
expandAnimation={editActive}
|
|
145
|
+
shrinkAnimation={!editActive}
|
|
146
|
+
onExpand={() => {
|
|
147
|
+
setEditActive(true);
|
|
155
148
|
}}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
fontSize: 10,
|
|
161
|
-
color: '#fff',
|
|
162
|
-
}}
|
|
163
|
-
>
|
|
164
|
-
{showAdjustInfo
|
|
165
|
-
? t('Crop the image for better results')
|
|
166
|
-
: 'Crop the image for better results'}
|
|
167
|
-
</Typography>
|
|
168
|
-
</Box>
|
|
169
|
-
)}
|
|
149
|
+
showGrip={editActive}
|
|
150
|
+
draggable={editActive ? true : false}
|
|
151
|
+
/>
|
|
152
|
+
</div>
|
|
170
153
|
</Box>
|
|
171
|
-
|
|
172
|
-
<Box
|
|
173
|
-
sx={{
|
|
174
|
-
position: 'absolute',
|
|
175
|
-
left: '15px',
|
|
176
|
-
top: '25px',
|
|
177
|
-
padding: '4px',
|
|
178
|
-
}}
|
|
179
|
-
onClick={onImageRemove}
|
|
180
|
-
>
|
|
181
|
-
<Box
|
|
182
|
-
sx={{
|
|
183
|
-
width: '24px',
|
|
184
|
-
height: '24px',
|
|
185
|
-
justifyContent: 'center',
|
|
186
|
-
alignItems: 'center',
|
|
187
|
-
display: 'flex',
|
|
188
|
-
borderRadius: '100%',
|
|
189
|
-
}}
|
|
190
|
-
>
|
|
191
|
-
<Trash color="white" fill="white" />
|
|
192
|
-
</Box>
|
|
193
|
-
</Box>
|
|
194
|
-
</Hidden>
|
|
195
|
-
|
|
196
|
-
<Hidden mdUp>
|
|
154
|
+
{(showAdjustInfoBasedOnConfidence || showAdjustInfo) && (
|
|
197
155
|
<Box
|
|
198
|
-
className="
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
156
|
+
className="box-title_col-left"
|
|
157
|
+
alignItems="center"
|
|
158
|
+
style={{
|
|
159
|
+
backgroundColor: '#3E36DC',
|
|
160
|
+
display: 'flex',
|
|
161
|
+
columnGap: '6px',
|
|
162
|
+
padding: '5px',
|
|
163
|
+
width: 'fit-content',
|
|
164
|
+
minWidth: '180px',
|
|
203
165
|
}}
|
|
204
|
-
onClick={handleArrowClick}
|
|
205
166
|
>
|
|
206
|
-
<
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
justifyContent: 'center',
|
|
212
|
-
alignItems: 'center',
|
|
213
|
-
display: 'flex',
|
|
214
|
-
borderRadius: '100%',
|
|
167
|
+
<IconInfo color="white" />
|
|
168
|
+
<Typography
|
|
169
|
+
style={{
|
|
170
|
+
fontSize: 10,
|
|
171
|
+
color: '#fff',
|
|
215
172
|
}}
|
|
216
173
|
>
|
|
217
|
-
|
|
218
|
-
|
|
174
|
+
{showAdjustInfo
|
|
175
|
+
? t('Crop the image for better results')
|
|
176
|
+
: 'Crop the image for better results'}
|
|
177
|
+
</Typography>
|
|
219
178
|
</Box>
|
|
220
|
-
|
|
221
|
-
</
|
|
222
|
-
|
|
223
|
-
{!editActive && (
|
|
224
|
-
<Box
|
|
225
|
-
className={showShrinkAnimation ? 'shrink-animation' : ''}
|
|
226
|
-
sx={{
|
|
227
|
-
display: 'flex',
|
|
228
|
-
alignItems: 'center',
|
|
229
|
-
justifyContent: 'center',
|
|
230
|
-
height: 80,
|
|
231
|
-
width: '100%',
|
|
232
|
-
}}
|
|
233
|
-
>
|
|
179
|
+
)}
|
|
180
|
+
</Box>
|
|
181
|
+
<>
|
|
234
182
|
<Hidden>
|
|
235
183
|
<Box
|
|
236
184
|
sx={{
|
|
@@ -242,7 +190,6 @@ function ImagePreviewMobileComponent({
|
|
|
242
190
|
onClick={onImageRemove}
|
|
243
191
|
>
|
|
244
192
|
<Box
|
|
245
|
-
// className={showShrinkAnimation ? 'slideUp' : ''}
|
|
246
193
|
sx={{
|
|
247
194
|
width: '24px',
|
|
248
195
|
height: '24px',
|
|
@@ -256,49 +203,19 @@ function ImagePreviewMobileComponent({
|
|
|
256
203
|
</Box>
|
|
257
204
|
</Box>
|
|
258
205
|
</Hidden>
|
|
259
|
-
<Box
|
|
260
|
-
sx={{
|
|
261
|
-
display: 'flex',
|
|
262
|
-
height: '100%',
|
|
263
|
-
width: '100%',
|
|
264
|
-
justifyContent: 'center',
|
|
265
|
-
alignItems: 'center',
|
|
266
|
-
}}
|
|
267
|
-
onClick={handleArrowClick}
|
|
268
|
-
>
|
|
269
|
-
{requestImage && requestImage?.canvas?.toDataURL && (
|
|
270
|
-
<img
|
|
271
|
-
src={requestImage?.canvas?.toDataURL()}
|
|
272
|
-
style={{
|
|
273
|
-
width: '80px',
|
|
274
|
-
height: '80px',
|
|
275
|
-
objectFit: 'contain',
|
|
276
|
-
background: 'white',
|
|
277
|
-
}}
|
|
278
|
-
alt="preview"
|
|
279
|
-
/>
|
|
280
|
-
)}
|
|
281
206
|
|
|
282
|
-
<div
|
|
283
|
-
className={
|
|
284
|
-
showShrinkAnimation
|
|
285
|
-
? 'shrink-animation circle-layer'
|
|
286
|
-
: 'circle-layer'
|
|
287
|
-
}
|
|
288
|
-
></div>
|
|
289
|
-
</Box>
|
|
290
207
|
<Hidden mdUp>
|
|
291
208
|
<Box
|
|
209
|
+
className="slideDown"
|
|
292
210
|
sx={{
|
|
293
211
|
position: 'absolute',
|
|
294
|
-
|
|
295
|
-
|
|
212
|
+
bottom: '25px',
|
|
213
|
+
right: '20px',
|
|
296
214
|
}}
|
|
297
215
|
onClick={handleArrowClick}
|
|
298
216
|
>
|
|
299
217
|
<Box
|
|
300
218
|
bgcolor={'white'}
|
|
301
|
-
className={showShrinkAnimation ? 'slideUp' : ''}
|
|
302
219
|
sx={{
|
|
303
220
|
width: '24px',
|
|
304
221
|
height: '24px',
|
|
@@ -308,12 +225,13 @@ function ImagePreviewMobileComponent({
|
|
|
308
225
|
borderRadius: '100%',
|
|
309
226
|
}}
|
|
310
227
|
>
|
|
311
|
-
<
|
|
228
|
+
{editActive && <ArrowUp color="black" />}
|
|
229
|
+
{!editActive && <ArrowDown color="black" fill="black" />}
|
|
312
230
|
</Box>
|
|
313
231
|
</Box>
|
|
314
232
|
</Hidden>
|
|
315
|
-
|
|
316
|
-
|
|
233
|
+
</>
|
|
234
|
+
</div>
|
|
317
235
|
</Box>
|
|
318
236
|
);
|
|
319
237
|
}
|
|
@@ -6,6 +6,7 @@ import InquiryModal from './InquiryModal';
|
|
|
6
6
|
import { useAppSelector } from 'Store/Store';
|
|
7
7
|
import { ReactComponent as EmailIcon } from 'common/assets/icons/icon_email.svg';
|
|
8
8
|
import { ReactComponent as CallIcon } from 'common/assets/icons/call.svg';
|
|
9
|
+
import { useTranslation } from 'react-i18next';
|
|
9
10
|
|
|
10
11
|
function InquiryBanner({
|
|
11
12
|
requestImage,
|
|
@@ -31,6 +32,8 @@ function InquiryBanner({
|
|
|
31
32
|
const { secondaryColor } =
|
|
32
33
|
useAppSelector(state => state.settings.theme) || {};
|
|
33
34
|
|
|
35
|
+
const { t } = useTranslation();
|
|
36
|
+
|
|
34
37
|
return (
|
|
35
38
|
<>
|
|
36
39
|
{isInquiryModalOpen && (
|
|
@@ -49,7 +52,7 @@ function InquiryBanner({
|
|
|
49
52
|
alignSelf: 'end',
|
|
50
53
|
display: 'flex',
|
|
51
54
|
alignItems: 'center',
|
|
52
|
-
marginRight: '12px',
|
|
55
|
+
// marginRight: '12px',
|
|
53
56
|
}}
|
|
54
57
|
className="rfq-box"
|
|
55
58
|
>
|
|
@@ -94,8 +97,8 @@ function InquiryBanner({
|
|
|
94
97
|
}}
|
|
95
98
|
>
|
|
96
99
|
{isMobile
|
|
97
|
-
? 'No matches found
|
|
98
|
-
: 'No matches found for your request
|
|
100
|
+
? `${t('No matches found')}?`
|
|
101
|
+
: `${t('No matches found for your request')}?`}
|
|
99
102
|
</Box>
|
|
100
103
|
<Box
|
|
101
104
|
style={{
|
|
@@ -3,7 +3,11 @@ import { ReactNode } from 'components/common';
|
|
|
3
3
|
import React, { memo, useEffect, useState } from 'react';
|
|
4
4
|
import { useMediaQuery } from 'react-responsive';
|
|
5
5
|
import { useHistory } from 'react-router-dom';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
clearPostFilter,
|
|
8
|
+
onResetRequestImage,
|
|
9
|
+
setUpdateSession,
|
|
10
|
+
} from 'Store/search/Search';
|
|
7
11
|
import { useAppDispatch, useAppSelector } from 'Store/Store';
|
|
8
12
|
import { AppState } from '../types';
|
|
9
13
|
import './appMobile.scss';
|
|
@@ -22,6 +26,7 @@ import { translations } from 'translations';
|
|
|
22
26
|
import { useAuth0 } from '@auth0/auth0-react';
|
|
23
27
|
import InstantSearchProvider from './Provider/InstantSearchProvider';
|
|
24
28
|
import PoweredByNyris from './PoweredByNyris';
|
|
29
|
+
import { useQuery } from 'hooks/useQuery';
|
|
25
30
|
|
|
26
31
|
declare var psol: any;
|
|
27
32
|
|
|
@@ -64,6 +69,9 @@ function Layout({ children }: ReactNode): JSX.Element {
|
|
|
64
69
|
const isMobile = useMediaQuery({ query: '(max-width: 776px)' });
|
|
65
70
|
const [isOpenFilter, setOpenFilter] = useState<boolean>(false);
|
|
66
71
|
const history = useHistory();
|
|
72
|
+
const query = useQuery();
|
|
73
|
+
const searchQuery = query.get('query') || '';
|
|
74
|
+
|
|
67
75
|
let isShowHeaderMobile =
|
|
68
76
|
(isMobile && history.location?.pathname === '/result') ||
|
|
69
77
|
history.location?.pathname === '/';
|
|
@@ -120,6 +128,16 @@ function Layout({ children }: ReactNode): JSX.Element {
|
|
|
120
128
|
};
|
|
121
129
|
}, []);
|
|
122
130
|
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
if (!(search.requestImage && searchQuery)) {
|
|
133
|
+
dispatch(clearPostFilter());
|
|
134
|
+
}
|
|
135
|
+
}, [search.requestImage, searchQuery, dispatch, search.regions]);
|
|
136
|
+
|
|
137
|
+
useEffect(() => {
|
|
138
|
+
dispatch(clearPostFilter());
|
|
139
|
+
}, [dispatch, search.selectedRegion]);
|
|
140
|
+
|
|
123
141
|
return (
|
|
124
142
|
<div style={{ position: 'relative' }}>
|
|
125
143
|
{loadingSearchAlgolia && (
|