@nyris/nyris-webapp 0.3.33 → 0.3.34

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.
Files changed (82) hide show
  1. package/build/asset-manifest.json +28 -14
  2. package/build/index.html +1 -1
  3. package/build/js/settings.example.js +13 -25
  4. package/build/{precache-manifest.4cff5b8aafe3d00d59bc2c9725eb6ade.js → precache-manifest.b85c7807a93875355f9f0f6490e6dc8c.js} +70 -14
  5. package/build/service-worker.js +1 -1
  6. package/build/static/css/main.f2aa67fc.chunk.css +2 -0
  7. package/build/static/css/main.f2aa67fc.chunk.css.map +1 -0
  8. package/build/static/js/2.d1f7e826.chunk.js +3 -0
  9. package/build/static/js/2.d1f7e826.chunk.js.map +1 -0
  10. package/build/static/js/main.e9aec8a9.chunk.js +3 -0
  11. package/build/static/js/main.e9aec8a9.chunk.js.map +1 -0
  12. package/build/static/media/filter.bc412f08.svg +3 -0
  13. package/build/static/media/icon_search_image2.fab34be4.svg +3 -0
  14. package/build/static/media/img-1-1.6144e5f9.png +0 -0
  15. package/build/static/media/img-1-2.ad943f0f.png +0 -0
  16. package/build/static/media/img2-1.a87c79c7.png +0 -0
  17. package/build/static/media/img2-2.39c5b73f.png +0 -0
  18. package/build/static/media/img3-1.443b0c3a.png +0 -0
  19. package/build/static/media/img3-2.37db7999.png +0 -0
  20. package/build/static/media/img4-1.9c34c158.png +0 -0
  21. package/build/static/media/img4-2.9d280a04.png +0 -0
  22. package/build/static/media/img5-1.b61dbd4d.png +0 -0
  23. package/build/static/media/img5-2.1c77c093.png +0 -0
  24. package/build/static/media/img6-1.8b03dd21.png +0 -0
  25. package/build/static/media/img6-2.1e3e7fed.png +0 -0
  26. package/build/static/media/{info-tooltip.5feeef22.svg → info-tooltip.b98e8a9c.svg} +2 -2
  27. package/build/static/media/take_photo.76423216.svg +5 -0
  28. package/package.json +3 -3
  29. package/public/js/settings.example.js +13 -25
  30. package/src/Store/constants.ts +0 -1
  31. package/src/Store/search/Search.ts +32 -17
  32. package/src/Store/search/search.initialState.ts +17 -16
  33. package/src/Store/search/types.ts +15 -14
  34. package/src/common/assets/icons/expand.svg +3 -27
  35. package/src/common/assets/icons/filter.svg +3 -0
  36. package/src/common/assets/icons/icon_search_image2.svg +2 -25
  37. package/src/common/assets/icons/info-tooltip.svg +2 -2
  38. package/src/common/assets/icons/take_photo.svg +5 -0
  39. package/src/common/assets/images/imageCaptureHelp/img-1-1.png +0 -0
  40. package/src/common/assets/images/imageCaptureHelp/img-1-2.png +0 -0
  41. package/src/common/assets/images/imageCaptureHelp/img2-1.png +0 -0
  42. package/src/common/assets/images/imageCaptureHelp/img2-2.png +0 -0
  43. package/src/common/assets/images/imageCaptureHelp/img3-1.png +0 -0
  44. package/src/common/assets/images/imageCaptureHelp/img3-2.png +0 -0
  45. package/src/common/assets/images/imageCaptureHelp/img4-1.png +0 -0
  46. package/src/common/assets/images/imageCaptureHelp/img4-2.png +0 -0
  47. package/src/common/assets/images/imageCaptureHelp/img5-1.png +0 -0
  48. package/src/common/assets/images/imageCaptureHelp/img5-2.png +0 -0
  49. package/src/common/assets/images/imageCaptureHelp/img6-1.png +0 -0
  50. package/src/common/assets/images/imageCaptureHelp/img6-2.png +0 -0
  51. package/src/components/DetailItem.tsx +54 -73
  52. package/src/components/FooterMobile.tsx +80 -41
  53. package/src/components/HeaderMobile.tsx +225 -227
  54. package/src/components/ImageCaptureHelpModal.tsx +90 -0
  55. package/src/components/Layout.tsx +39 -9
  56. package/src/components/MobilePostFilter.tsx +20 -0
  57. package/src/components/PanelResult/expandable-panel.tsx +21 -21
  58. package/src/components/PanelResult/index.tsx +52 -19
  59. package/src/components/ProductList/index.tsx +5 -3
  60. package/src/components/appMobile.scss +64 -32
  61. package/src/components/carousel/ImagePreviewCarousel.tsx +1 -1
  62. package/src/components/drawer/cameraCustom.tsx +8 -33
  63. package/src/components/input/inputSearch.tsx +68 -80
  64. package/src/components/pre-filter/index.tsx +31 -22
  65. package/src/components/results/ItemResult.tsx +79 -84
  66. package/src/constants.ts +56 -0
  67. package/src/page/landingPage/AppMobile.tsx +34 -104
  68. package/src/page/landingPage/common.scss +164 -36
  69. package/src/page/result/index.tsx +70 -56
  70. package/src/services/Feedback.ts +20 -2
  71. package/src/services/types.ts +0 -1
  72. package/src/translations.ts +4 -0
  73. package/src/types.ts +3 -2
  74. package/build/static/css/main.d0b21fa5.chunk.css +0 -2
  75. package/build/static/css/main.d0b21fa5.chunk.css.map +0 -1
  76. package/build/static/js/2.69ce0823.chunk.js +0 -3
  77. package/build/static/js/2.69ce0823.chunk.js.map +0 -1
  78. package/build/static/js/main.6122377b.chunk.js +0 -3
  79. package/build/static/js/main.6122377b.chunk.js.map +0 -1
  80. package/build/static/media/icon_search_image2.e46fdfc5.svg +0 -26
  81. /package/build/static/js/{2.69ce0823.chunk.js.LICENSE.txt → 2.d1f7e826.chunk.js.LICENSE.txt} +0 -0
  82. /package/build/static/js/{main.6122377b.chunk.js.LICENSE.txt → main.e9aec8a9.chunk.js.LICENSE.txt} +0 -0
@@ -1,9 +1,8 @@
1
- import { Box, Button, Tooltip, Typography } from '@material-ui/core';
1
+ import { Box, Button, Tooltip } from '@material-ui/core';
2
2
  import IconButton from '@material-ui/core/IconButton';
3
3
  import ClearOutlinedIcon from '@material-ui/icons/ClearOutlined';
4
4
  import CloseIcon from '@material-ui/icons/Close';
5
5
  import IconCamera from 'common/assets/icons/camera.svg';
6
- import IconSearch from 'common/assets/icons/icon_search.svg';
7
6
  import { useQuery } from 'hooks/useQuery';
8
7
  import { debounce, isEmpty } from 'lodash';
9
8
  import React, { memo, useCallback, useEffect, useRef, useState } from 'react';
@@ -13,6 +12,7 @@ import { useMediaQuery } from 'react-responsive';
13
12
  import { useHistory } from 'react-router-dom';
14
13
  import { createImage, findByImage, findRegions } from 'services/image';
15
14
  import { ReactComponent as IconFilter } from 'common/assets/icons/filter_settings.svg';
15
+ import { ReactComponent as IconSearch } from 'common/assets/icons/icon_search.svg';
16
16
 
17
17
  import {
18
18
  reset,
@@ -20,7 +20,6 @@ import {
20
20
  setRequestImage,
21
21
  setSearchResults,
22
22
  updateStatusLoading,
23
- setUpdateKeyFilterDesktop,
24
23
  loadingActionResults,
25
24
  setRegions,
26
25
  setSelectedRegion,
@@ -29,7 +28,6 @@ import { useAppDispatch, useAppSelector } from 'Store/Store';
29
28
  import DefaultModal from 'components/modal/DefaultModal';
30
29
  import PreFilterComponent from 'components/pre-filter';
31
30
  import { RectCoords } from '@nyris/nyris-api';
32
- import { truncateString } from 'helpers/truncateString';
33
31
  import { useTranslation } from 'react-i18next';
34
32
 
35
33
  const SearchBox = (props: any) => {
@@ -153,16 +151,75 @@ const SearchBox = (props: any) => {
153
151
  };
154
152
 
155
153
  return (
156
- <Box className="wrap-input-search">
157
- <div style={{ padding: 10 }} className="box-input-search d-flex">
154
+ <div className="wrap-input-search-field">
155
+ <div className="box-input-search d-flex">
158
156
  <form noValidate action="" role="search">
159
157
  <Box className="box-inp">
158
+ <Tooltip
159
+ title={keyFilter ? keyFilter : 'Add pre-filter'}
160
+ placement="top"
161
+ arrow={true}
162
+ disableHoverListener={!settings.preFilterOption}
163
+ >
164
+ <Box
165
+ className="pre-filter-icon"
166
+ style={{
167
+ cursor: settings.preFilterOption ? 'pointer' : 'default',
168
+ }}
169
+ onClick={() =>
170
+ settings.preFilterOption
171
+ ? setToggleModalFilterDesktop(true)
172
+ : false
173
+ }
174
+ >
175
+ {settings.preFilterOption && (
176
+ <div
177
+ className="icon-hover"
178
+ style={{
179
+ ...(keyFilter
180
+ ? {
181
+ backgroundColor: `${settings.theme?.secondaryColor}26`,
182
+ }
183
+ : {}),
184
+ }}
185
+ >
186
+ <IconFilter color="black" />
187
+ </div>
188
+ )}
189
+ {!settings.preFilterOption && (
190
+ <IconSearch width={16} height={16} />
191
+ )}
192
+ {keyFilter && (
193
+ <div
194
+ style={{
195
+ position: 'absolute',
196
+ top: '6px',
197
+ left: '31px',
198
+ display: 'flex',
199
+ justifyContent: 'center',
200
+ alignItems: 'center',
201
+ background: 'white',
202
+ width: '10px',
203
+ height: '10px',
204
+ borderRadius: '100%',
205
+ }}
206
+ >
207
+ <div
208
+ style={{
209
+ width: '8px',
210
+ height: '8px',
211
+ background: settings.theme?.secondaryColor,
212
+ borderRadius: '100%',
213
+ }}
214
+ ></div>
215
+ </div>
216
+ )}
217
+ </Box>
218
+ </Tooltip>
160
219
  <Box
161
220
  style={{
162
221
  height: '75%',
163
222
  order: 1,
164
- paddingLeft: imageThumbSearchInput || keyFilter ? 0 : 10,
165
- marginLeft: keyFilter ? 0 : 5,
166
223
  }}
167
224
  >
168
225
  {imageThumbSearchInput && (
@@ -208,60 +265,12 @@ const SearchBox = (props: any) => {
208
265
  )}
209
266
  </Box>
210
267
 
211
- {!valueInput && (
212
- <Box
213
- className="icon-search"
214
- style={
215
- imageThumbSearchInput
216
- ? { order: 2, marginLeft: 5 }
217
- : { order: 2 }
218
- }
219
- >
220
- <img src={IconSearch} alt="" width={24} height={24} />
221
- </Box>
222
- )}
223
-
224
- {keyFilter && !isMobile && (
225
- <Box
226
- className="box-key-filter"
227
- style={{
228
- order: 0,
229
- marginRight: 5,
230
- border: `2px solid ${settings.theme?.secondaryColor}c7`,
231
- }}
232
- >
233
- <Tooltip
234
- title={keyFilter}
235
- placement="top"
236
- arrow={true}
237
- disableHoverListener={keyFilter.length < 16}
238
- >
239
- <Typography>{truncateString(keyFilter, 15)}</Typography>
240
- </Tooltip>
241
-
242
- <Tooltip title="Remove pre-filter" placement="top" arrow={true}>
243
- <Button
244
- onClick={() => dispatch(setUpdateKeyFilterDesktop(''))}
245
- style={{ padding: '6px 2px' }}
246
- >
247
- <CloseIcon
248
- style={{
249
- fontSize: 20,
250
- color: settings.theme?.secondaryColor,
251
- }}
252
- />
253
- </Button>
254
- </Tooltip>
255
- </Box>
256
- )}
257
-
258
268
  <input
259
269
  style={{
260
270
  border: '0px',
261
271
  width: '100%',
262
272
  fontSize: 14,
263
273
  color: '#2B2C46',
264
- fontStyle: 'italic',
265
274
  }}
266
275
  className="input-search"
267
276
  placeholder={t('Search')}
@@ -297,26 +306,6 @@ const SearchBox = (props: any) => {
297
306
  )}
298
307
  {!isMobile ? (
299
308
  <div className="wrap-box-input-mobile d-flex">
300
- {settings.preFilterOption && (
301
- <Tooltip
302
- title="Add or change pre-filter"
303
- placement="top"
304
- arrow={true}
305
- style={{ backgroundColor: '#000000' }}
306
- >
307
- <Button
308
- onClick={() => setToggleModalFilterDesktop(true)}
309
- style={{
310
- width: 32,
311
- height: 32,
312
- borderRadius: '100%',
313
- marginRight: 10,
314
- }}
315
- >
316
- <IconFilter />
317
- </Button>
318
- </Tooltip>
319
- )}
320
309
  <input
321
310
  accept="image/*"
322
311
  id="icon-button-file"
@@ -362,20 +351,19 @@ const SearchBox = (props: any) => {
362
351
  )}
363
352
  </form>
364
353
  </div>
365
-
366
354
  {settings.preFilterOption && (
367
355
  <DefaultModal
368
356
  openModal={isOpenModalFilterDesktop}
369
357
  handleClose={() => setToggleModalFilterDesktop(false)}
370
- classNameModal="wrap-filter-destop"
371
- classNameComponentChild="bg-white box-filter-destop"
358
+ classNameModal="wrap-filter-desktop"
359
+ classNameComponentChild="bg-white box-filter-desktop"
372
360
  >
373
361
  <PreFilterComponent
374
362
  handleClose={() => setToggleModalFilterDesktop(false)}
375
363
  />
376
364
  </DefaultModal>
377
365
  )}
378
- </Box>
366
+ </div>
379
367
  );
380
368
  };
381
369
 
@@ -109,22 +109,37 @@ function PreFilterComponent(props: Props) {
109
109
  flexDirection={'column'}
110
110
  style={{ position: 'relative' }}
111
111
  >
112
- <Typography
112
+ <div
113
113
  style={{
114
- color: '#000',
115
- fontSize: '24px',
116
- fontWeight: 700,
117
- paddingLeft: isMobile ? '0px' : '14px',
118
- marginBottom: isMobile ? '0px' : '-8px',
119
- marginTop: isMobile ? '0px' : '24px',
114
+ background: 'white',
115
+ width: '100%',
116
+ display: 'flex',
117
+ justifyContent: 'space-between',
118
+ position: 'sticky',
119
+ top: 0,
120
+ zIndex: 100,
120
121
  }}
121
122
  >
122
- {settings.preFilterTitle}
123
- </Typography>
123
+ <Typography
124
+ style={{
125
+ color: '#000',
126
+ fontSize: '24px',
127
+ fontWeight: 700,
128
+ paddingLeft: isMobile ? '0px' : '14px',
129
+ marginBottom: isMobile ? '0px' : '-8px',
130
+ marginTop: isMobile ? '0px' : '24px',
131
+ }}
132
+ >
133
+ {settings.preFilterTitle}
134
+ </Typography>
124
135
 
136
+ <Button onClick={handleClose}>
137
+ <CloseIcon />
138
+ </Button>
139
+ </div>
125
140
  <Box
126
141
  className="box-top"
127
- style={isMobile ? { padding: 0 } : undefined}
142
+ style={isMobile ? { padding: 0, marginTop: '16px' } : undefined}
128
143
  display={'flex'}
129
144
  justifyContent={'space-between'}
130
145
  alignItems={'center'}
@@ -172,16 +187,10 @@ function PreFilterComponent(props: Props) {
172
187
  }}
173
188
  />
174
189
  </Box>
175
-
176
- {!isMobile && (
177
- <Button onClick={handleClose}>
178
- <CloseIcon />
179
- </Button>
180
- )}
181
190
  </Box>
182
191
 
183
- <Box style={{ margin: '10px 16px' }}>
184
- {keyFilter && isMobile && (
192
+ {keyFilter && isMobile && (
193
+ <Box style={{ margin: '10px 16px' }}>
185
194
  <Box
186
195
  display={'flex'}
187
196
  className="box-keyFilter"
@@ -192,8 +201,8 @@ function PreFilterComponent(props: Props) {
192
201
  <CloseIcon style={{ fontSize: 12, color: '#2B2C46' }} />
193
202
  </Button>
194
203
  </Box>
195
- )}
196
- </Box>
204
+ </Box>
205
+ )}
197
206
  <Box
198
207
  className="box-bottom"
199
208
  height={'100%'}
@@ -274,7 +283,7 @@ function PreFilterComponent(props: Props) {
274
283
  <Typography>No result found</Typography>
275
284
  )}
276
285
  </Box>
277
- {keyFilter && !isMobile && (
286
+ {!isMobile && (
278
287
  <Box
279
288
  className="footer"
280
289
  style={{ height: 64, marginTop: 'auto' }}
@@ -308,7 +317,7 @@ function PreFilterComponent(props: Props) {
308
317
  </Button>
309
318
  </Box>
310
319
  )}
311
- {keyFilter && isMobile && (
320
+ {isMobile && (
312
321
  <Box
313
322
  className="footer"
314
323
  style={{
@@ -7,8 +7,7 @@ import { ReactComponent as IconLike } from 'common/assets/icons/icon_like.svg';
7
7
  import { ReactComponent as IconSearchImage } from 'common/assets/icons/icon_search_image2.svg';
8
8
  import React, { memo, useEffect, useState } from 'react';
9
9
  import NoImage from 'common/assets/images/unnamed.png';
10
- import { AppState } from 'types';
11
- import { useAppDispatch, useAppSelector } from 'Store/Store';
10
+ import { RootState, useAppDispatch, useAppSelector } from 'Store/Store';
12
11
  import DefaultModal from 'components/modal/DefaultModal';
13
12
  import DetailItem from 'components/DetailItem';
14
13
  import {
@@ -18,13 +17,15 @@ import {
18
17
  import { ShareModal } from '../ShareModal';
19
18
  import { truncateString } from 'helpers/truncateString';
20
19
  import { useTranslation } from 'react-i18next';
20
+ import { useMediaQuery } from 'react-responsive';
21
+ import { feedbackClickEpic, feedbackConversionEpic } from 'services/Feedback';
21
22
 
22
23
  interface Props {
23
24
  dataItem: any;
24
25
  handlerToggleModal?: any;
25
26
  handleClose?: () => void;
26
27
  isHover?: boolean;
27
- indexItem?: number;
28
+ indexItem: number;
28
29
  onSearchImage?: any;
29
30
  handlerFeedback?: any;
30
31
  handlerGroupItem?: any;
@@ -48,13 +49,15 @@ function ItemResult(props: Props) {
48
49
  } = props;
49
50
  const dispatch = useAppDispatch();
50
51
  const [urlImage, setUrlImage] = useState<string>('');
51
- const { settings } = useAppSelector<AppState>((state: any) => state);
52
+ const state = useAppSelector<RootState>((state: any) => state);
53
+ const { settings } = state;
52
54
  const [isOpenModalImage, setOpenModalImage] = useState<boolean>(false);
53
55
  const [isOpenModalShare, setOpenModalShare] = useState<boolean>(false);
54
56
  const [feedback, setFeedback] = useState('none');
55
57
  const { t } = useTranslation();
56
58
  const { sku, collap } = dataItem;
57
59
  const brand = dataItem[settings.field.productTag];
60
+ const isMobile = useMediaQuery({ query: '(max-width: 776px)' });
58
61
 
59
62
  useEffect(() => {
60
63
  if (main_image_link) {
@@ -92,6 +95,7 @@ function ItemResult(props: Props) {
92
95
  };
93
96
 
94
97
  const handlerToggleModal = (item: any) => {
98
+ feedbackClickEpic(state, indexItem, item.sku);
95
99
  setOpenModalImage(true);
96
100
  dispatch(onToggleModalItemDetail(true));
97
101
  dispatch(updateStatusLoading(true));
@@ -99,6 +103,7 @@ function ItemResult(props: Props) {
99
103
  dispatch(updateStatusLoading(false));
100
104
  }, 400);
101
105
  };
106
+
102
107
  return (
103
108
  <Box className="wrap-main-item-result">
104
109
  <DefaultModal
@@ -144,17 +149,15 @@ function ItemResult(props: Props) {
144
149
  </Box>
145
150
  )}
146
151
  {!isHover && main_image_link && (
147
- <Box className="box-icon-modal">
148
- <Button
149
- style={{ width: '100%', height: '100%', padding: 0, zIndex: 9 }}
150
- onClick={() => {
151
- if (urlImage.length > 1) {
152
- onSearchImage(main_image_link);
153
- }
154
- }}
155
- >
156
- <IconSearchImage color={settings.theme?.secondaryColor} />
157
- </Button>
152
+ <Box
153
+ className="box-icon-modal"
154
+ onClick={() => {
155
+ if (urlImage.length > 1) {
156
+ onSearchImage(main_image_link);
157
+ }
158
+ }}
159
+ >
160
+ <IconSearchImage width={16} height={16} color={'#AAABB5'} />
158
161
  </Box>
159
162
  )}
160
163
  <Box className="box-image">
@@ -199,7 +202,7 @@ function ItemResult(props: Props) {
199
202
  flexGrow: 1,
200
203
  }}
201
204
  >
202
- <Box className="box-top" style={{ minHeight: '90px' }}>
205
+ <Box className="box-top">
203
206
  <Grid container justifyContent="space-between">
204
207
  <Grid item xs={12}>
205
208
  <Tooltip
@@ -219,7 +222,7 @@ function ItemResult(props: Props) {
219
222
  <span style={{ marginRight: 3 }}>
220
223
  {settings.itemIdLabel || 'SKU'}:
221
224
  </span>
222
- {truncateString(sku, 16)}
225
+ {truncateString(sku, 20)}
223
226
  </Typography>
224
227
  </Tooltip>
225
228
 
@@ -283,85 +286,77 @@ function ItemResult(props: Props) {
283
286
  </Box>
284
287
  </Tooltip>
285
288
  )}
286
- {!settings.warehouseVariant && (
287
- <Typography
288
- className="text-f13 fw-600 max-line-3"
289
- style={{ color: '#1E1F31', marginTop: 12 }}
290
- >
291
- {dataItem[settings.field.productName]}
292
- </Typography>
293
- )}
294
289
  </Grid>
295
290
  </Grid>
296
291
  </Box>
297
292
  <div>
298
- {(settings.showMoreInfo || settings.warehouseVariant) && (
299
- <Tooltip
300
- title={dataItem[settings.field.productName]}
301
- placement="top"
302
- arrow={true}
303
- disableHoverListener={
304
- dataItem[settings.field.productName]?.length < 35 ||
305
- !settings.warehouseVariant
306
- }
293
+ <Tooltip
294
+ title={dataItem[settings.field.productName]}
295
+ placement="top"
296
+ arrow={true}
297
+ disableHoverListener={
298
+ dataItem[settings.field.productName]?.length < 45
299
+ }
300
+ >
301
+ <Box
302
+ style={{
303
+ boxShadow: '-2px 2px 4px rgba(170, 171, 181, 0.5)',
304
+ // marginBottom: 22,
305
+ height: 40,
306
+ background: `linear-gradient(270deg, ${settings.theme?.primaryColor}bb 0%, ${settings.theme?.primaryColor} 100%)`,
307
+ borderRadius: 4,
308
+ padding: '0px 8px',
309
+ marginTop: '12px',
310
+ }}
311
+ display={'flex'}
312
+ justifyItems={'center'}
313
+ alignItems={'center'}
314
+ justifyContent={'space-between'}
307
315
  >
308
316
  <Box
309
317
  style={{
310
- boxShadow: '-2px 2px 4px rgba(170, 171, 181, 0.5)',
311
- // marginBottom: 22,
312
- height: 40,
313
- background: `linear-gradient(270deg, ${settings.theme?.primaryColor}bb 0%, ${settings.theme?.primaryColor} 100%)`,
314
- borderRadius: 4,
315
- padding: '0px 8px',
316
- marginTop: '12px',
318
+ display: 'flex',
319
+ justifyContent: 'space-between',
320
+ width: '100%',
321
+ padding: 0,
322
+ cursor: dataItem[settings.field?.ctaLinkField]
323
+ ? 'pointer'
324
+ : 'normal',
325
+ }}
326
+ onClick={() => {
327
+ feedbackConversionEpic(state, indexItem, dataItem.sku);
328
+ window.open(
329
+ `${dataItem[settings.field.ctaLinkField]}`,
330
+ '_blank',
331
+ );
317
332
  }}
318
- display={'flex'}
319
- justifyItems={'center'}
320
- alignItems={'center'}
321
- justifyContent={'space-between'}
322
333
  >
323
- <Button
334
+ <Typography
335
+ className="text-white max-line-2"
324
336
  style={{
325
- display: 'flex',
326
- justifyContent: 'space-between',
327
- width: '100%',
328
- padding: 0,
337
+ overflow: 'hidden',
338
+ textOverflow: 'ellipsis',
339
+ fontWeight: 500,
340
+ fontSize: '11px',
341
+ letterSpacing: '0.27px',
342
+ wordBreak: 'break-all',
343
+ maxWidth:
344
+ !isMobile && dataItem[settings.field?.ctaLinkField]
345
+ ? '136px'
346
+ : '164x',
347
+ paddingRight: '8px',
329
348
  }}
330
- onClick={() =>
331
- window.open(
332
- `${dataItem[settings.field.ctaLinkField]}`,
333
- '_blank',
334
- )
335
- }
349
+ align="left"
336
350
  >
337
- <Typography
338
- className="text-white max-line-2"
339
- style={{
340
- textTransform: !settings.warehouseVariant
341
- ? 'uppercase'
342
- : 'none',
343
- overflow: 'hidden',
344
- textOverflow: 'ellipsis',
345
- fontWeight: !settings.warehouseVariant ? 700 : 500,
346
- fontSize: !settings.warehouseVariant ? '12px' : '11px',
347
- letterSpacing: '0.27px',
348
- wordBreak: !settings.warehouseVariant
349
- ? 'normal'
350
- : 'break-all',
351
- maxWidth: '136px',
352
- paddingRight: '8px',
353
- }}
354
- align="left"
355
- >
356
- {settings.warehouseVariant
357
- ? truncateString(dataItem[settings.field.productName], 35)
358
- : settings.productCtaText || 'MORE INFO'}
359
- </Typography>
351
+ {truncateString(dataItem[settings.field.productName], 45)}
352
+ </Typography>
353
+ {!isMobile && dataItem[settings.field?.ctaLinkField] && (
360
354
  <img src={IconOpenLink} alt="more-info" width={20} />
361
- </Button>
355
+ )}
362
356
  </Box>
363
- </Tooltip>
364
- )}
357
+ </Box>
358
+ </Tooltip>
359
+
365
360
  {settings.warehouseVariant && (
366
361
  <Box
367
362
  display="flex"
@@ -478,9 +473,9 @@ function ItemResult(props: Props) {
478
473
  <Button
479
474
  style={{ padding: '6px' }}
480
475
  className="btn-item"
481
- onClick={() => false}
476
+ onClick={() => setOpenModalShare(true)}
482
477
  >
483
- <IconShare width={16} height={16} color="#808080" />
478
+ <IconShare width={16} height={16} color="#000000" />
484
479
  </Button>
485
480
  </Box>
486
481
  </Grid>
package/src/constants.ts CHANGED
@@ -1,3 +1,16 @@
1
+ import img1 from 'common/assets/images/imageCaptureHelp/img-1-1.png';
2
+ import img2 from 'common/assets/images/imageCaptureHelp/img-1-2.png';
3
+ import img3 from 'common/assets/images/imageCaptureHelp/img2-1.png';
4
+ import img4 from 'common/assets/images/imageCaptureHelp/img2-2.png';
5
+ import img5 from 'common/assets/images/imageCaptureHelp/img3-1.png';
6
+ import img6 from 'common/assets/images/imageCaptureHelp/img3-2.png';
7
+ import img7 from 'common/assets/images/imageCaptureHelp/img4-1.png';
8
+ import img8 from 'common/assets/images/imageCaptureHelp/img4-2.png';
9
+ import img9 from 'common/assets/images/imageCaptureHelp/img5-1.png';
10
+ import img10 from 'common/assets/images/imageCaptureHelp/img5-2.png';
11
+ import img11 from 'common/assets/images/imageCaptureHelp/img6-1.png';
12
+ import img12 from 'common/assets/images/imageCaptureHelp/img6-2.png';
13
+
1
14
  export const DEFAULT_REGION = { x1: 0, x2: 1, y1: 0, y2: 1 };
2
15
  export const showHits = [
3
16
  { value: 10, label: '10' },
@@ -11,3 +24,46 @@ export const showHits = [
11
24
  { value: 90, label: '90' },
12
25
  { value: 100, label: '100' },
13
26
  ];
27
+ export const visualSearchHelp = [
28
+ {
29
+ title: 'SELECT THE RIGHT IMAGE AREA',
30
+ description:
31
+ 'The main object should occupy the major part of the image. Use the cropping tool available to crop the image and remove excess background.',
32
+ imageLeft: img1,
33
+ imageRight: img2,
34
+ },
35
+ {
36
+ title: 'PICTURE CLARITY',
37
+ description: 'The image should not be blurred or out of focus.',
38
+ imageLeft: img3,
39
+ imageRight: img4,
40
+ },
41
+ {
42
+ title: 'OPTIMAL LIGHTING',
43
+ description:
44
+ 'The images should be taken in a bright area or use your camera’s flash to take a well-lit picture.',
45
+ imageLeft: img5,
46
+ imageRight: img6,
47
+ },
48
+ {
49
+ title: 'MONOCHROME BACKGROUND',
50
+ description:
51
+ 'The object should be placed on a plain and light background and patterned background should be avoided.',
52
+ imageLeft: img7,
53
+ imageRight: img8,
54
+ },
55
+ {
56
+ title: 'VISIBILITY OF THE OBJECT',
57
+ description:
58
+ 'Click an image encapsulating most of the object’s key components.',
59
+ imageLeft: img9,
60
+ imageRight: img10,
61
+ },
62
+ {
63
+ title: 'OCR CAPTURE',
64
+ description:
65
+ 'It is recommended to take a clear picture of the text on the typeplate etc, to ensure that the model can detect the text and give accurate results.',
66
+ imageLeft: img11,
67
+ imageRight: img12,
68
+ },
69
+ ];