@nyris/nyris-webapp 0.3.34 → 0.3.36

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 (60) hide show
  1. package/build/asset-manifest.json +13 -13
  2. package/build/index.html +1 -1
  3. package/build/{precache-manifest.b85c7807a93875355f9f0f6490e6dc8c.js → precache-manifest.a2657ad49c132fb9c82629d37be15547.js} +14 -14
  4. package/build/service-worker.js +1 -1
  5. package/build/static/css/main.41fb4769.chunk.css +2 -0
  6. package/build/static/css/main.41fb4769.chunk.css.map +1 -0
  7. package/build/static/js/2.ff44260e.chunk.js +3 -0
  8. package/build/static/js/2.ff44260e.chunk.js.map +1 -0
  9. package/build/static/js/main.0b3b11fc.chunk.js +3 -0
  10. package/build/static/js/main.0b3b11fc.chunk.js.map +1 -0
  11. package/build/static/media/error.48b946a9.svg +3 -0
  12. package/package.json +3 -3
  13. package/public/index.html +13 -0
  14. package/src/Store/search/Search.ts +4 -4
  15. package/src/Store/search/search.initialState.ts +1 -1
  16. package/src/Store/search/types.ts +1 -1
  17. package/src/common/assets/icons/arrow_left.svg +3 -0
  18. package/src/common/assets/icons/arrow_right.svg +3 -0
  19. package/src/common/assets/icons/error.svg +3 -0
  20. package/src/components/AppMobile.tsx +111 -0
  21. package/src/components/DetailItem.tsx +21 -18
  22. package/src/components/DragDropFile.tsx +5 -4
  23. package/src/components/FooterMobile.tsx +9 -3
  24. package/src/components/Header.tsx +2 -1
  25. package/src/components/HeaderMobile.tsx +5 -3
  26. package/src/components/ImageCaptureHelpModal.tsx +7 -1
  27. package/src/components/ImagePreviewMobile.tsx +87 -0
  28. package/src/components/Layout.tsx +32 -92
  29. package/src/components/ProductList/index.tsx +4 -1
  30. package/src/components/RfqBanner.tsx +120 -0
  31. package/src/components/SidePanel.tsx +147 -0
  32. package/src/components/appMobile.scss +147 -142
  33. package/src/components/carousel/ImagePreviewCarousel.tsx +1 -7
  34. package/src/components/drawer/cameraCustom.tsx +5 -4
  35. package/src/components/input/inputSearch.tsx +12 -7
  36. package/src/components/modal/DefaultModal.tsx +1 -1
  37. package/src/components/pre-filter/index.tsx +144 -83
  38. package/src/components/results/ItemResult.tsx +9 -20
  39. package/src/components/rfq/RfqModal.tsx +262 -0
  40. package/src/helpers/ToastHelper.ts +10 -0
  41. package/src/helpers/getCroppedCanvas.ts +26 -0
  42. package/src/hooks/useFilteredRegions.ts +37 -0
  43. package/src/index.css +0 -4
  44. package/src/page/landingPage/AppMD.tsx +0 -11
  45. package/src/page/landingPage/AppMobile.tsx +1 -0
  46. package/src/page/landingPage/common.scss +44 -60
  47. package/src/page/result/index.tsx +256 -309
  48. package/src/translations.ts +2 -2
  49. package/src/types.ts +1 -0
  50. package/src/utils.ts +0 -1
  51. package/build/static/css/main.f2aa67fc.chunk.css +0 -2
  52. package/build/static/css/main.f2aa67fc.chunk.css.map +0 -1
  53. package/build/static/js/2.d1f7e826.chunk.js +0 -3
  54. package/build/static/js/2.d1f7e826.chunk.js.map +0 -1
  55. package/build/static/js/main.e9aec8a9.chunk.js +0 -3
  56. package/build/static/js/main.e9aec8a9.chunk.js.map +0 -1
  57. package/build/static/media/support3.4a17f96e.svg +0 -3
  58. package/src/hooks/useVisualSearch.tsx +0 -77
  59. /package/build/static/js/{2.d1f7e826.chunk.js.LICENSE.txt → 2.ff44260e.chunk.js.LICENSE.txt} +0 -0
  60. /package/build/static/js/{main.e9aec8a9.chunk.js.LICENSE.txt → main.0b3b11fc.chunk.js.LICENSE.txt} +0 -0
@@ -0,0 +1,3 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M10 0.000191037C8.68453 -0.0079651 7.38053 0.245119 6.16361 0.744768C4.94669 1.24442 3.84108 1.98069 2.91088 2.91088C1.98069 3.84108 1.24442 4.94669 0.744768 6.16361C0.245119 7.38053 -0.0079651 8.68453 0.000191037 10C-0.0079651 11.3155 0.245119 12.6195 0.744768 13.8364C1.24442 15.0533 1.98069 16.1589 2.91088 17.0891C3.84108 18.0193 4.94669 18.7556 6.16361 19.2552C7.38053 19.7549 8.68453 20.008 10 19.9998C11.3155 20.008 12.6195 19.7549 13.8364 19.2552C15.0533 18.7556 16.1589 18.0193 17.0891 17.0891C18.0193 16.1589 18.7556 15.0533 19.2552 13.8364C19.7549 12.6195 20.008 11.3155 19.9998 10C20.008 8.68453 19.7549 7.38053 19.2552 6.16361C18.7556 4.94669 18.0193 3.84108 17.0891 2.91088C16.1589 1.98069 15.0533 1.24442 13.8364 0.744768C12.6195 0.245119 11.3155 -0.0079651 10 0.000191037ZM13.8891 14.9999L5.0001 6.11129L6.11129 5.0001L14.9999 13.8891L13.8891 14.9999Z" fill="#E31B5D"/>
3
+ </svg>
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.36",
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.36",
16
+ "@nyris/nyris-react-components": "^0.3.36",
17
17
  "@reduxjs/toolkit": "^1.6.1",
18
18
  "@splidejs/react-splide": "^0.7.12",
19
19
  "@types/blueimp-load-image": "^2.23.4",
package/public/index.html CHANGED
@@ -107,6 +107,19 @@
107
107
  <script async src="https://www.google-analytics.com/analytics.js"></script>
108
108
  <!-- End Google Analytics -->
109
109
 
110
+ <!-- Piwik Analytics -->
111
+ <script type="text/javascript">
112
+ (function(window, document, dataLayerName, id) {
113
+ window[dataLayerName]=window[dataLayerName]||[],window[dataLayerName].push({start:(new Date).getTime(),event:"stg.start"});var scripts=document.getElementsByTagName('script')[0],tags=document.createElement('script');
114
+ function stgCreateCookie(a,b,c){var d="";if(c){var e=new Date;e.setTime(e.getTime()+24*c*60*60*1e3),d="; expires="+e.toUTCString();f="; SameSite=Strict"}document.cookie=a+"="+b+d+f+"; path=/"}
115
+ var isStgDebug=(window.location.href.match("stg_debug")||document.cookie.match("stg_debug"))&&!window.location.href.match("stg_disable_debug");stgCreateCookie("stg_debug",isStgDebug?1:"",isStgDebug?14:-1);
116
+ var qP=[];dataLayerName!=="dataLayer"&&qP.push("data_layer_name="+dataLayerName),isStgDebug&&qP.push("stg_debug");var qPString=qP.length>0?("?"+qP.join("&")):"";
117
+ tags.async=!0,tags.src="https://marium.containers.piwik.pro/"+id+".js"+qPString,scripts.parentNode.insertBefore(tags,scripts);
118
+ !function(a,n,i){a[n]=a[n]||{};for(var c=0;c<i.length;c++)!function(i){a[n][i]=a[n][i]||{},a[n][i].api=a[n][i].api||function(){var a=[].slice.call(arguments,0);"string"==typeof a[0]&&window[dataLayerName].push({event:n+"."+i+":"+a[0],parameters:[].slice.call(arguments,1)})}}(i[c])}(window,"ppms",["tm","cm"]);
119
+ })(window, document, 'dataLayer', '94dae4cc-0947-4fee-b515-08fc58c1e7bc');
120
+ </script>
121
+ <!-- End Piwik Analytics -->
122
+
110
123
  <script
111
124
  src="https://863a167094994e54bc22149eafac1699.js.ubembed.com"
112
125
  async
@@ -149,7 +149,7 @@ export const searchSlice = createSlice({
149
149
  imageThumbSearchInput: '',
150
150
  textSearchInputMobile: '',
151
151
  isShowModalDetailItemMobile: false,
152
- keyFilter: state.keyFilter || '',
152
+ preFilter: state.preFilter || {},
153
153
  preFilterDropdown: false,
154
154
  imageCaptureHelpModal: false,
155
155
  };
@@ -229,11 +229,11 @@ export const searchSlice = createSlice({
229
229
  isShowModalDetailItemMobile: payload,
230
230
  };
231
231
  },
232
- setUpdateKeyFilterDesktop: (state, data: PayloadAction<string>) => {
232
+ setPreFilter: (state, data: PayloadAction<Record<string, boolean>>) => {
233
233
  const { payload } = data;
234
234
  return {
235
235
  ...state,
236
- keyFilter: payload,
236
+ preFilter: payload,
237
237
  };
238
238
  },
239
239
  setPreFilterDropdown: (state, data: PayloadAction<boolean>) => {
@@ -277,7 +277,7 @@ export const {
277
277
  setRequestImage,
278
278
  setSearchResults,
279
279
  setSelectedRegion,
280
- setUpdateKeyFilterDesktop,
280
+ setPreFilter,
281
281
  setUpdateSession,
282
282
  updateResultChangePosition,
283
283
  updateResults,
@@ -11,7 +11,7 @@ export const initialState: SearchState = {
11
11
  filters: [],
12
12
  imageThumbSearchInput: '',
13
13
  isShowModalDetailItemMobile: false,
14
- keyFilter: '',
14
+ preFilter: {},
15
15
  loadingSearchAlgolia: false,
16
16
  preFilterDropdown: false,
17
17
  imageCaptureHelpModal: false,
@@ -18,7 +18,7 @@ export interface SearchState {
18
18
  filters: any[];
19
19
  imageThumbSearchInput?: any;
20
20
  isShowModalDetailItemMobile?: boolean;
21
- keyFilter?: string;
21
+ preFilter: Record<string, boolean>;
22
22
  loadingSearchAlgolia: boolean;
23
23
  preFilterDropdown?: boolean;
24
24
  imageCaptureHelpModal?: boolean;
@@ -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>
@@ -0,0 +1,3 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M10 0.000191037C8.68453 -0.0079651 7.38053 0.245119 6.16361 0.744768C4.94669 1.24442 3.84108 1.98069 2.91088 2.91088C1.98069 3.84108 1.24442 4.94669 0.744768 6.16361C0.245119 7.38053 -0.0079651 8.68453 0.000191037 10C-0.0079651 11.3155 0.245119 12.6195 0.744768 13.8364C1.24442 15.0533 1.98069 16.1589 2.91088 17.0891C3.84108 18.0193 4.94669 18.7556 6.16361 19.2552C7.38053 19.7549 8.68453 20.008 10 19.9998C11.3155 20.008 12.6195 19.7549 13.8364 19.2552C15.0533 18.7556 16.1589 18.0193 17.0891 17.0891C18.0193 16.1589 18.7556 15.0533 19.2552 13.8364C19.7549 12.6195 20.008 11.3155 19.9998 10C20.008 8.68453 19.7549 7.38053 19.2552 6.16361C18.7556 4.94669 18.0193 3.84108 17.0891 2.91088C16.1589 1.98069 15.0533 1.24442 13.8364 0.744768C12.6195 0.245119 11.3155 -0.0079651 10 0.000191037ZM13.8891 14.9999L5.0001 6.11129L6.11129 5.0001L14.9999 13.8891L13.8891 14.9999Z" fill="#E31B5D"/>
3
+ </svg>
@@ -0,0 +1,111 @@
1
+ import React, { ReactNode, useState } from 'react';
2
+ import HeaderMobile from './HeaderMobile';
3
+ import { Box } from '@material-ui/core';
4
+ import {
5
+ setPreFilterDropdown,
6
+ setImageCaptureHelpModal,
7
+ } from 'Store/search/Search';
8
+ import { isUndefined } from 'lodash';
9
+ import ImageCaptureHelpModal from './ImageCaptureHelpModal';
10
+ import MobilePostFilter from './MobilePostFilter';
11
+ import PreFilterComponent from './pre-filter';
12
+ import { useAppDispatch, useAppSelector } from 'Store/Store';
13
+ import { AppState } from 'types';
14
+ import FooterMobile from './FooterMobile';
15
+
16
+ function AppMobile({ children }: { children: ReactNode }) {
17
+ const dispatch = useAppDispatch();
18
+ const { search } = useAppSelector<AppState>((state: any) => state);
19
+ const { preFilterDropdown, imageCaptureHelpModal } = search;
20
+ const [isOpenFilter, setOpenFilter] = useState<boolean>(false);
21
+
22
+ return (
23
+ <>
24
+ <div className="wrap-mobile">
25
+ <div className="box-header-mobile-main">
26
+ <HeaderMobile
27
+ onToggleFilterMobile={(show: boolean) => {
28
+ setOpenFilter(isUndefined(show) ? !isOpenFilter : show);
29
+ }}
30
+ />
31
+ </div>
32
+ <div
33
+ style={{
34
+ display: 'flex',
35
+ flexGrow: 1,
36
+ flexDirection: 'column',
37
+ overflowY: 'auto',
38
+ overflowX: 'hidden',
39
+ }}
40
+ >
41
+ {children}
42
+ </div>
43
+ <div
44
+ className="footer-wrap-main"
45
+ style={{
46
+ zIndex: 999,
47
+ }}
48
+ >
49
+ <FooterMobile />
50
+ </div>
51
+ </div>
52
+ <Box
53
+ className={`box-filter ${isOpenFilter ? 'open' : 'close'} `}
54
+ position={'absolute'}
55
+ style={{
56
+ top: '0px',
57
+ height: '100%',
58
+ width: '100%',
59
+ }}
60
+ >
61
+ <MobilePostFilter
62
+ onApply={() => {
63
+ setOpenFilter(!isOpenFilter);
64
+ }}
65
+ />
66
+ </Box>
67
+
68
+ {preFilterDropdown && (
69
+ <Box
70
+ className={`box-filter open`}
71
+ position={'absolute'}
72
+ style={{ top: '0px', height: '100%', width: '100%', zIndex: 999 }}
73
+ >
74
+ <div style={{ width: '100%' }} className={'wrap-filter-desktop'}>
75
+ <div className={'bg-white box-filter-desktop isMobile'}>
76
+ <PreFilterComponent
77
+ handleClose={() =>
78
+ dispatch(setPreFilterDropdown(!preFilterDropdown))
79
+ }
80
+ />
81
+ </div>
82
+ </div>
83
+ </Box>
84
+ )}
85
+
86
+ {imageCaptureHelpModal && (
87
+ <Box
88
+ className={`box-filter open`}
89
+ position={'absolute'}
90
+ style={{
91
+ top: '0px',
92
+ width: '100%',
93
+ zIndex: 100,
94
+ }}
95
+ >
96
+ <div style={{ width: '100%' }} className={'wrap-filter-desktop'}>
97
+ <div className={'bg-white box-filter-desktop isMobile'}>
98
+ <ImageCaptureHelpModal
99
+ handleClose={() =>
100
+ dispatch(setImageCaptureHelpModal(!imageCaptureHelpModal))
101
+ }
102
+ />
103
+ </div>
104
+ </div>
105
+ </Box>
106
+ )}
107
+ </>
108
+ );
109
+ }
110
+
111
+ export default AppMobile;
@@ -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">
@@ -19,6 +19,7 @@ import { useState } from 'react';
19
19
  import IconUpload from 'common/assets/images/Icon_Upload.svg';
20
20
  import { RectCoords } from '@nyris/nyris-api';
21
21
  import { useTranslation } from 'react-i18next';
22
+ import { isEmpty } from 'lodash';
22
23
 
23
24
  interface Props {
24
25
  acceptTypes: any;
@@ -33,7 +34,7 @@ function DragDropFile(props: Props) {
33
34
  const searchState = useAppSelector(state => state);
34
35
  const {
35
36
  settings,
36
- search: { keyFilter },
37
+ search: { preFilter },
37
38
  } = searchState;
38
39
  const [isLoadingLoadFile, setLoadingLoadFile] = useState<any>(false);
39
40
  const { t } = useTranslation();
@@ -50,10 +51,10 @@ function DragDropFile(props: Props) {
50
51
  dispatch(setImageSearchInput(URL.createObjectURL(fs[0])));
51
52
  let image = await createImage(fs[0]);
52
53
  dispatch(setRequestImage(image));
53
- const preFilter = [
54
+ const preFilterValues = [
54
55
  {
55
56
  key: settings.visualSearchFilterKey,
56
- values: [`${keyFilter}`],
57
+ values: Object.keys(preFilter) as string[],
57
58
  },
58
59
  ];
59
60
  let region: RectCoords | undefined;
@@ -68,7 +69,7 @@ function DragDropFile(props: Props) {
68
69
  image,
69
70
  settings,
70
71
  region,
71
- filters: keyFilter ? preFilter : undefined,
72
+ filters: !isEmpty(preFilter) ? preFilterValues : undefined,
72
73
  }).then((res: any) => {
73
74
  res?.results.map((item: any) => {
74
75
  filters.push({
@@ -6,7 +6,11 @@ import { ReactComponent as Home } from 'common/assets/icons/home.svg';
6
6
  import { NavLink, useHistory } from 'react-router-dom';
7
7
  import { useAppDispatch, useAppSelector } from 'Store/Store';
8
8
  import { ReactComponent as IconInfo } from 'common/assets/icons/info-tooltip.svg';
9
- import { setImageCaptureHelpModal } from 'Store/search/Search';
9
+ import {
10
+ reset,
11
+ setImageCaptureHelpModal,
12
+ setPreFilter,
13
+ } from 'Store/search/Search';
10
14
 
11
15
  interface Props {
12
16
  onLoadingMobile?: any;
@@ -30,7 +34,7 @@ function FooterMobile(props: Props): JSX.Element {
30
34
  alignItems={'center'}
31
35
  height={'100%'}
32
36
  justifyContent={'space-between'}
33
- style={{ paddingLeft: '40px', paddingRight: '40px' }}
37
+ style={{ paddingLeft: '40px', paddingRight: '40px', height: '64px' }}
34
38
  >
35
39
  <NavLink
36
40
  style={{
@@ -49,6 +53,8 @@ function FooterMobile(props: Props): JSX.Element {
49
53
  to={'/'}
50
54
  className="nav-link p-0 menu-children rounded-0"
51
55
  onClick={() => {
56
+ dispatch(reset(''));
57
+ dispatch(setPreFilter({}));
52
58
  dispatch(setImageCaptureHelpModal(false));
53
59
  }}
54
60
  >
@@ -60,7 +66,7 @@ function FooterMobile(props: Props): JSX.Element {
60
66
  }
61
67
  />
62
68
  </NavLink>
63
- {history.location?.pathname !== '/' && (
69
+ {history.location?.pathname !== '/' && !imageCaptureHelpModal && (
64
70
  <Box className="box-icon-camera-mobile">
65
71
  <Button
66
72
  onClick={() => {
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { NavLink } from 'react-router-dom';
4
4
  import './common.scss';
5
5
  import { useAppDispatch, useAppSelector } from 'Store/Store';
6
- import { reset } from 'Store/search/Search';
6
+ import { reset, setPreFilter } from 'Store/search/Search';
7
7
 
8
8
  function Header(): JSX.Element {
9
9
  const dispatch = useAppDispatch();
@@ -15,6 +15,7 @@ function Header(): JSX.Element {
15
15
  style={{ lineHeight: 0, paddingLeft: '10px' }}
16
16
  onClick={() => {
17
17
  dispatch(reset(''));
18
+ dispatch(setPreFilter({}));
18
19
  }}
19
20
  >
20
21
  <img
@@ -16,6 +16,7 @@ import {
16
16
  reset,
17
17
  updateValueTextSearchMobile,
18
18
  setPreFilterDropdown,
19
+ setPreFilter,
19
20
  } from 'Store/search/Search';
20
21
  import { useAppDispatch, useAppSelector } from 'Store/Store';
21
22
  import { AppState } from 'types';
@@ -39,7 +40,7 @@ function HeaderMobileComponent(props: Props): JSX.Element {
39
40
  const {
40
41
  imageThumbSearchInput,
41
42
  textSearchInputMobile,
42
- keyFilter,
43
+ preFilter,
43
44
  preFilterDropdown,
44
45
  valueTextSearch,
45
46
  } = search;
@@ -141,6 +142,7 @@ function HeaderMobileComponent(props: Props): JSX.Element {
141
142
  style={{ lineHeight: 0, paddingLeft: '10px' }}
142
143
  onClick={() => {
143
144
  dispatch(reset(''));
145
+ dispatch(setPreFilter({}));
144
146
  }}
145
147
  >
146
148
  <img
@@ -194,7 +196,7 @@ function HeaderMobileComponent(props: Props): JSX.Element {
194
196
  <div
195
197
  className="icon-hover"
196
198
  style={{
197
- ...(keyFilter
199
+ ...(!isEmpty(preFilter)
198
200
  ? {
199
201
  backgroundColor: `${settings.theme?.primaryColor}`,
200
202
  }
@@ -209,7 +211,7 @@ function HeaderMobileComponent(props: Props): JSX.Element {
209
211
  {!settings.preFilterOption && (
210
212
  <IconSearch width={16} height={16} />
211
213
  )}
212
- {keyFilter && (
214
+ {!isEmpty(preFilter) && (
213
215
  <div
214
216
  style={{
215
217
  position: 'absolute',
@@ -9,7 +9,13 @@ interface Props {
9
9
 
10
10
  function ImageCaptureHelpModal({ handleClose }: Props) {
11
11
  return (
12
- <Box style={{ paddingLeft: '24px', paddingRight: '24px' }}>
12
+ <Box
13
+ style={{
14
+ paddingLeft: '24px',
15
+ paddingRight: '24px',
16
+ paddingBottom: '24px',
17
+ }}
18
+ >
13
19
  <Box
14
20
  display={'flex'}
15
21
  justifyContent={'end'}
@@ -0,0 +1,87 @@
1
+ import React from 'react';
2
+ import { Box, Typography } from '@material-ui/core';
3
+ import { RectCoords } from '@nyris/nyris-api';
4
+ import { Preview } from '@nyris/nyris-react-components';
5
+ import { DEFAULT_REGION } from '../constants';
6
+ import { ReactComponent as IconInfo } from 'common/assets/icons/info-tooltip.svg';
7
+ import { useTranslation } from 'react-i18next';
8
+
9
+ function ImagePreviewMobile({
10
+ requestImage,
11
+ imageSelection,
12
+ setImageSelection,
13
+ debouncedOnImageSelectionChange,
14
+ filteredRegions,
15
+ showAdjustInfo,
16
+ showAdjustInfoBasedOnConfidence,
17
+ }: {
18
+ requestImage: any;
19
+ imageSelection: any;
20
+ setImageSelection: any;
21
+ debouncedOnImageSelectionChange: any;
22
+ filteredRegions: any;
23
+ showAdjustInfoBasedOnConfidence: any;
24
+ showAdjustInfo: any;
25
+ }) {
26
+ const { t } = useTranslation();
27
+
28
+ return (
29
+ <Box
30
+ className="col-left"
31
+ style={{
32
+ backgroundColor: '#AAABB5',
33
+ marginBottom: '15px',
34
+ }}
35
+ >
36
+ {
37
+ <Box className="box-preview">
38
+ <Box className="preview-item" style={{ backgroundColor: 'white' }}>
39
+ <Preview
40
+ key={requestImage?.id}
41
+ onSelectionChange={(r: RectCoords) => {
42
+ setImageSelection(r);
43
+ debouncedOnImageSelectionChange(r);
44
+ }}
45
+ image={requestImage?.canvas}
46
+ selection={imageSelection || DEFAULT_REGION}
47
+ regions={filteredRegions}
48
+ maxWidth={240}
49
+ maxHeight={240}
50
+ dotColor={'#FBD914'}
51
+ minCropWidth={60}
52
+ minCropHeight={60}
53
+ rounded={false}
54
+ />
55
+ </Box>
56
+ {(showAdjustInfoBasedOnConfidence || showAdjustInfo) && (
57
+ <Box
58
+ className="box-title_col-left"
59
+ alignItems="center"
60
+ style={{
61
+ backgroundColor: '#3E36DC',
62
+ display: 'flex',
63
+ columnGap: '6px',
64
+ padding: '5px',
65
+ width: 'fit-content',
66
+ }}
67
+ >
68
+ <IconInfo color="white" />
69
+ <Typography
70
+ style={{
71
+ fontSize: 10,
72
+ color: '#fff',
73
+ }}
74
+ >
75
+ {showAdjustInfo
76
+ ? t('Crop the image for better results')
77
+ : 'Crop the image for better results'}
78
+ </Typography>
79
+ </Box>
80
+ )}
81
+ </Box>
82
+ }
83
+ </Box>
84
+ );
85
+ }
86
+
87
+ export default ImagePreviewMobile;