@nyris/nyris-webapp 0.3.34 → 0.3.35

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 (26) hide show
  1. package/build/asset-manifest.json +12 -12
  2. package/build/index.html +1 -1
  3. package/build/{precache-manifest.b85c7807a93875355f9f0f6490e6dc8c.js → precache-manifest.375ac411683570ee1df5aea6de03409d.js} +10 -10
  4. package/build/service-worker.js +1 -1
  5. package/build/static/css/{main.f2aa67fc.chunk.css → main.f5a1c730.chunk.css} +2 -2
  6. package/build/static/css/main.f5a1c730.chunk.css.map +1 -0
  7. package/build/static/js/2.724f4cba.chunk.js +3 -0
  8. package/build/static/js/2.724f4cba.chunk.js.map +1 -0
  9. package/build/static/js/main.f579fa9f.chunk.js +3 -0
  10. package/build/static/js/main.f579fa9f.chunk.js.map +1 -0
  11. package/package.json +3 -3
  12. package/src/components/DetailItem.tsx +21 -18
  13. package/src/components/FooterMobile.tsx +1 -1
  14. package/src/components/Layout.tsx +1 -1
  15. package/src/components/carousel/ImagePreviewCarousel.tsx +1 -7
  16. package/src/components/pre-filter/index.tsx +39 -35
  17. package/src/components/results/ItemResult.tsx +8 -19
  18. package/src/page/landingPage/common.scss +3 -2
  19. package/build/static/css/main.f2aa67fc.chunk.css.map +0 -1
  20. package/build/static/js/2.d1f7e826.chunk.js +0 -3
  21. package/build/static/js/2.d1f7e826.chunk.js.map +0 -1
  22. package/build/static/js/main.e9aec8a9.chunk.js +0 -3
  23. package/build/static/js/main.e9aec8a9.chunk.js.map +0 -1
  24. package/src/hooks/useVisualSearch.tsx +0 -77
  25. /package/build/static/js/{2.d1f7e826.chunk.js.LICENSE.txt → 2.724f4cba.chunk.js.LICENSE.txt} +0 -0
  26. /package/build/static/js/{main.e9aec8a9.chunk.js.LICENSE.txt → main.f579fa9f.chunk.js.LICENSE.txt} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nyris/nyris-webapp",
3
- "version": "0.3.34",
3
+ "version": "0.3.35",
4
4
  "homepage": "./",
5
5
  "dependencies": {
6
6
  "@algolia/autocomplete-js": "^1.7.1",
@@ -12,8 +12,8 @@
12
12
  "@material-ui/data-grid": "^4.0.0-alpha.37",
13
13
  "@material-ui/icons": "^4.4.1",
14
14
  "@material-ui/lab": "^4.0.0-alpha.60",
15
- "@nyris/nyris-api": "^0.3.34",
16
- "@nyris/nyris-react-components": "^0.3.34",
15
+ "@nyris/nyris-api": "^0.3.35",
16
+ "@nyris/nyris-react-components": "^0.3.35",
17
17
  "@reduxjs/toolkit": "^1.6.1",
18
18
  "@splidejs/react-splide": "^0.7.12",
19
19
  "@types/blueimp-load-image": "^2.23.4",
@@ -79,6 +79,7 @@ function DetailItem(props: Props) {
79
79
  setDataImageCarouSel(valueKey);
80
80
  };
81
81
  const { t } = useTranslation();
82
+ const ctaLink = dataItem[settings.field?.ctaLinkField];
82
83
 
83
84
  return (
84
85
  <Box
@@ -101,11 +102,7 @@ function DetailItem(props: Props) {
101
102
  }
102
103
  >
103
104
  {dataImageCarousel.length > 0 ? (
104
- <ImagePreviewCarousel
105
- imgItem={dataImageCarousel}
106
- onSearchImage={onSearchImage}
107
- handlerCloseModal={() => handlerCloseModal?.()}
108
- />
105
+ <ImagePreviewCarousel imgItem={dataImageCarousel} />
109
106
  ) : (
110
107
  <img
111
108
  src={NoImage}
@@ -215,20 +212,24 @@ function DetailItem(props: Props) {
215
212
  alignItems={'center'}
216
213
  className="btn-detail-item"
217
214
  >
218
- <Button
215
+ <Box
219
216
  style={{
220
217
  display: 'flex',
221
218
  justifyContent: 'space-between',
219
+ alignItems: 'center',
222
220
  width: '100%',
223
221
  padding: '0px 12px',
224
222
  minHeight: 64,
223
+ cursor: ctaLink ? 'pointer' : 'normal',
224
+ }}
225
+ onClick={() => {
226
+ if (ctaLink) {
227
+ window.open(
228
+ `${dataItem[settings.field.ctaLinkField]}`,
229
+ '_blank',
230
+ );
231
+ }
225
232
  }}
226
- onClick={() =>
227
- window.open(
228
- `${dataItem[settings.field.ctaLinkField]}`,
229
- '_blank',
230
- )
231
- }
232
233
  >
233
234
  <Typography
234
235
  className="text-f18 fw-700 text-white max-line-2"
@@ -241,12 +242,14 @@ function DetailItem(props: Props) {
241
242
  >
242
243
  {dataItem[settings.field.productName]}
243
244
  </Typography>
244
- <img
245
- src={IconOpenLink}
246
- alt=""
247
- style={{ minWidth: 23, marginLeft: 5 }}
248
- />
249
- </Button>
245
+ {ctaLink && (
246
+ <img
247
+ src={IconOpenLink}
248
+ alt=""
249
+ style={{ minWidth: 23, marginLeft: 5 }}
250
+ />
251
+ )}
252
+ </Box>
250
253
  </Box>
251
254
  {dataItem[settings.field.productDetails] && (
252
255
  <Box className="w-100">
@@ -60,7 +60,7 @@ function FooterMobile(props: Props): JSX.Element {
60
60
  }
61
61
  />
62
62
  </NavLink>
63
- {history.location?.pathname !== '/' && (
63
+ {history.location?.pathname !== '/' && !imageCaptureHelpModal && (
64
64
  <Box className="box-icon-camera-mobile">
65
65
  <Button
66
66
  onClick={() => {
@@ -189,7 +189,7 @@ function Layout({ children }: ReactNode): JSX.Element {
189
189
  <Box
190
190
  className={`box-fillter open`}
191
191
  position={'absolute'}
192
- style={{ top: '0px', height: '100%' }}
192
+ style={{ top: '0px', height: 'calc(100% - 64px)' }}
193
193
  >
194
194
  <div
195
195
  style={{ width: !isMobile ? '90%' : '100%' }}
@@ -12,7 +12,7 @@ interface Props {
12
12
  }
13
13
 
14
14
  export const ImagePreviewCarousel = (props: Props) => {
15
- let { imgItem, onSearchImage, handlerCloseModal } = props;
15
+ let { imgItem } = props;
16
16
  const isMobile = useMediaQuery({ query: '(max-width: 776px)' });
17
17
  const mainRef: any = useRef(null);
18
18
  const thumbsRef: any = useRef(null);
@@ -60,12 +60,6 @@ export const ImagePreviewCarousel = (props: Props) => {
60
60
  style={{ objectFit: 'contain', minHeight: '400px' }}
61
61
  alt="preview"
62
62
  src={slide.url}
63
- onClick={() => {
64
- if (!thumbs) {
65
- handlerCloseModal();
66
- onSearchImage(slide.url);
67
- }
68
- }}
69
63
  />
70
64
  </SplideSlide>
71
65
  ));
@@ -5,7 +5,6 @@ import IconSearch from 'common/assets/icons/icon_search.svg';
5
5
  import { getFilters, searchFilters } from 'services/filter';
6
6
  import { useAppDispatch, useAppSelector } from 'Store/Store';
7
7
  import { setUpdateKeyFilterDesktop } from 'Store/search/Search';
8
- import { ToggleButton, ToggleButtonGroup } from '@material-ui/lab';
9
8
  import { useMediaQuery } from 'react-responsive';
10
9
  import { isEmpty } from 'lodash';
11
10
  import { Skeleton } from '@material-ui/lab';
@@ -37,8 +36,10 @@ function PreFilterComponent(props: Props) {
37
36
  const arrResult =
38
37
  res.find(value => value.key === settings.visualSearchFilterKey)
39
38
  ?.values || [];
39
+
40
40
  const newResult = arrResult.sort().reduce((a: any, c: any) => {
41
- let k = c[0].toLocaleUpperCase();
41
+ if (!c[0]) return a;
42
+ let k = c[0]?.toLocaleUpperCase();
42
43
  if (a[k]) a[k].push(c);
43
44
  else a[k] = [c];
44
45
  return a;
@@ -61,13 +62,6 @@ function PreFilterComponent(props: Props) {
61
62
  // eslint-disable-next-line react-hooks/exhaustive-deps
62
63
  }, []);
63
64
 
64
- const handleAlignment = (
65
- event: React.MouseEvent<HTMLElement>,
66
- value: any,
67
- ) => {
68
- setKeyFilter(value);
69
- };
70
-
71
65
  const filterSearchHandler = async (value: any) => {
72
66
  if (!value) {
73
67
  getDataFilterDesktop();
@@ -196,7 +190,9 @@ function PreFilterComponent(props: Props) {
196
190
  className="box-keyFilter"
197
191
  style={{ display: 'inline-flex' }}
198
192
  >
199
- <Typography className="keyFilter">{keyFilter}</Typography>
193
+ <Typography className="keyFilter max-line-1">
194
+ {keyFilter}
195
+ </Typography>
200
196
  <Button style={{ padding: 0 }} onClick={() => setKeyFilter('')}>
201
197
  <CloseIcon style={{ fontSize: 12, color: '#2B2C46' }} />
202
198
  </Button>
@@ -216,25 +212,25 @@ function PreFilterComponent(props: Props) {
216
212
  >
217
213
  {Object.entries(resultFilter).map(([key, value]: any, i: any) => {
218
214
  return (
219
- <Box
220
- className="box-group-items"
221
- style={
222
- columns <= 4 ? { width: 'fit-content' } : { width: '100%' }
223
- }
224
- >
225
- <Typography
226
- style={{ fontWeight: 'bold', color: '#000', paddingLeft: 11 }}
215
+ <Box className="box-group-items" key={key}>
216
+ <Box
217
+ style={{
218
+ display: 'flex',
219
+ flexDirection: 'column',
220
+ rowGap: '12px',
221
+ width: '100%',
222
+ }}
227
223
  >
228
- {key}
229
- </Typography>
224
+ <Typography
225
+ style={{
226
+ fontWeight: 'bold',
227
+ color: '#000',
228
+ fontSize: '12px',
229
+ }}
230
+ >
231
+ {key}
232
+ </Typography>
230
233
 
231
- <ToggleButtonGroup
232
- value={keyFilter}
233
- exclusive
234
- onChange={handleAlignment}
235
- aria-label=""
236
- className="box-btn-group"
237
- >
238
234
  {value.map((item: any, index: any) => {
239
235
  return (
240
236
  <Tooltip
@@ -242,22 +238,30 @@ function PreFilterComponent(props: Props) {
242
238
  title={item}
243
239
  placement="top"
244
240
  arrow={true}
245
- disableHoverListener={item.length < 20}
241
+ disableHoverListener={item.length < 35}
246
242
  >
247
- <ToggleButton
248
- value={item}
243
+ <Box
249
244
  aria-label={item}
250
- className="item-btn"
251
- onChange={() => {
245
+ style={{
246
+ cursor: 'pointer',
247
+ fontSize: '12px',
248
+ minHeight: '20px',
249
+ color: '#2B2C46',
250
+ width: '100%',
251
+ overflow: 'hidden',
252
+ textOverflow: 'ellipsis',
253
+ whiteSpace: 'nowrap',
254
+ }}
255
+ onClick={() => {
252
256
  setKeyFilter(item);
253
257
  }}
254
258
  >
255
- {truncateString(item, !isMobile ? 20 : 35)}
256
- </ToggleButton>
259
+ {truncateString(item, !isMobile ? 35 : 35)}
260
+ </Box>
257
261
  </Tooltip>
258
262
  );
259
263
  })}
260
- </ToggleButtonGroup>
264
+ </Box>
261
265
  </Box>
262
266
  );
263
267
  })}
@@ -103,7 +103,7 @@ function ItemResult(props: Props) {
103
103
  dispatch(updateStatusLoading(false));
104
104
  }, 400);
105
105
  };
106
-
106
+ const ctaLink = dataItem[settings.field?.ctaLinkField];
107
107
  return (
108
108
  <Box className="wrap-main-item-result">
109
109
  <DefaultModal
@@ -185,11 +185,6 @@ function ItemResult(props: Props) {
185
185
  />
186
186
  )}
187
187
  </Button>
188
- {isHover && (
189
- <Box className="box-hover">
190
- <Button>View item</Button>
191
- </Box>
192
- )}
193
188
  </Box>
194
189
  </Box>
195
190
 
@@ -319,16 +314,13 @@ function ItemResult(props: Props) {
319
314
  justifyContent: 'space-between',
320
315
  width: '100%',
321
316
  padding: 0,
322
- cursor: dataItem[settings.field?.ctaLinkField]
323
- ? 'pointer'
324
- : 'normal',
317
+ cursor: ctaLink ? 'pointer' : 'normal',
325
318
  }}
326
319
  onClick={() => {
327
- feedbackConversionEpic(state, indexItem, dataItem.sku);
328
- window.open(
329
- `${dataItem[settings.field.ctaLinkField]}`,
330
- '_blank',
331
- );
320
+ if (ctaLink) {
321
+ feedbackConversionEpic(state, indexItem, dataItem.sku);
322
+ window.open(`${ctaLink}`, '_blank');
323
+ }
332
324
  }}
333
325
  >
334
326
  <Typography
@@ -340,17 +332,14 @@ function ItemResult(props: Props) {
340
332
  fontSize: '11px',
341
333
  letterSpacing: '0.27px',
342
334
  wordBreak: 'break-all',
343
- maxWidth:
344
- !isMobile && dataItem[settings.field?.ctaLinkField]
345
- ? '136px'
346
- : '164x',
335
+ maxWidth: !isMobile && ctaLink ? '136px' : '164x',
347
336
  paddingRight: '8px',
348
337
  }}
349
338
  align="left"
350
339
  >
351
340
  {truncateString(dataItem[settings.field.productName], 45)}
352
341
  </Typography>
353
- {!isMobile && dataItem[settings.field?.ctaLinkField] && (
342
+ {!isMobile && ctaLink && (
354
343
  <img src={IconOpenLink} alt="more-info" width={20} />
355
344
  )}
356
345
  </Box>
@@ -1960,7 +1960,8 @@ button {
1960
1960
 
1961
1961
  .box-filter-desktop {
1962
1962
  background-color: #fff;
1963
- width: 70%;
1963
+ width: 90%;
1964
+ max-width: 1500px;
1964
1965
  height: 80%;
1965
1966
  margin: auto;
1966
1967
  &.isMobile {
@@ -2001,7 +2002,7 @@ button {
2001
2002
  }
2002
2003
  }
2003
2004
  .box-bottom {
2004
- column-gap: 30px;
2005
+ column-gap: 20px;
2005
2006
  padding: 0px 20px;
2006
2007
  flex-wrap: wrap;
2007
2008
  width: 100%;