@nyris/nyris-webapp 0.3.45 → 0.3.47

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 (44) hide show
  1. package/build/asset-manifest.json +14 -12
  2. package/build/index.html +1 -1
  3. package/build/{precache-manifest.1f75904c53fde266565cfe8519296465.js → precache-manifest.694373c4d80fe3bb40d0d6526b473852.js} +18 -10
  4. package/build/service-worker.js +1 -1
  5. package/build/static/css/main.21021ebe.chunk.css +2 -0
  6. package/build/static/css/main.21021ebe.chunk.css.map +1 -0
  7. package/build/static/js/2.3e652625.chunk.js +3 -0
  8. package/build/static/js/2.3e652625.chunk.js.map +1 -0
  9. package/build/static/js/main.37e28702.chunk.js +3 -0
  10. package/build/static/js/main.37e28702.chunk.js.map +1 -0
  11. package/build/static/media/call.c3c23966.svg +3 -0
  12. package/build/static/media/icon_email.71b21005.svg +3 -0
  13. package/package.json +4 -4
  14. package/src/Store/constants.ts +0 -1
  15. package/src/common/assets/icons/call.svg +3 -0
  16. package/src/common/assets/icons/icon_email.svg +2 -2
  17. package/src/components/CadenasWebViewer.tsx +2 -2
  18. package/src/components/Feedback.tsx +36 -0
  19. package/src/components/Header.tsx +3 -4
  20. package/src/components/ImagePreviewMobile.tsx +51 -134
  21. package/src/components/Inquiry/InquiryBanner.tsx +103 -35
  22. package/src/components/Inquiry/InquiryModal.tsx +7 -10
  23. package/src/components/Layout.tsx +5 -0
  24. package/src/components/ProductDetailView.tsx +21 -11
  25. package/src/components/SidePanel.tsx +22 -15
  26. package/src/components/appMobile.scss +7 -0
  27. package/src/components/common.scss +134 -0
  28. package/src/components/drawer/cameraCustom.tsx +14 -64
  29. package/src/components/results/ItemResult.tsx +118 -123
  30. package/src/components/rfq/RfqModal.tsx +7 -5
  31. package/src/index.css +1 -1
  32. package/src/page/landingPage/common.scss +3 -4
  33. package/src/page/result/index.tsx +60 -3
  34. package/src/services/Feedback.ts +4 -13
  35. package/src/translations.ts +7 -0
  36. package/src/types.ts +21 -6
  37. package/build/static/css/main.1b40c5ff.chunk.css +0 -2
  38. package/build/static/css/main.1b40c5ff.chunk.css.map +0 -1
  39. package/build/static/js/2.21c7c0a2.chunk.js +0 -3
  40. package/build/static/js/2.21c7c0a2.chunk.js.map +0 -1
  41. package/build/static/js/main.ed5fecc0.chunk.js +0 -3
  42. package/build/static/js/main.ed5fecc0.chunk.js.map +0 -1
  43. /package/build/static/js/{2.21c7c0a2.chunk.js.LICENSE.txt → 2.3e652625.chunk.js.LICENSE.txt} +0 -0
  44. /package/build/static/js/{main.ed5fecc0.chunk.js.LICENSE.txt → main.37e28702.chunk.js.LICENSE.txt} +0 -0
@@ -0,0 +1,3 @@
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M12.3849 14H12.2933C1.71255 13.3915 0.210246 4.46385 0.000245939 1.73923C-0.0166751 1.52739 0.00837059 1.31429 0.0739478 1.11214C0.139525 0.909999 0.244345 0.722779 0.382401 0.561213C0.520458 0.399646 0.689038 0.266909 0.878482 0.170606C1.06793 0.0743029 1.27451 0.0163271 1.4864 5.04857e-07H4.45332C4.66901 -0.000208291 4.87979 0.0643519 5.05836 0.185318C5.23693 0.306285 5.37506 0.478084 5.45486 0.678462L6.27332 2.69231C6.35213 2.88806 6.37168 3.10266 6.32956 3.30943C6.28744 3.51621 6.1855 3.70605 6.0364 3.85539L4.88948 5.01308C5.06863 6.03117 5.55619 6.96967 6.28619 7.70159C7.01619 8.43352 7.9534 8.92355 8.97101 9.10538L10.1395 7.94769C10.2911 7.80024 10.4827 7.70067 10.6905 7.66141C10.8983 7.62215 11.113 7.64494 11.3079 7.72692L13.3379 8.54C13.5353 8.62232 13.7037 8.76153 13.8216 8.9399C13.9396 9.11827 14.0018 9.32771 14.0002 9.54154V12.3846C14.0002 12.813 13.8301 13.2239 13.5271 13.5269C13.2242 13.8298 12.8133 14 12.3849 14ZM1.61563 1.07692C1.47282 1.07692 1.33586 1.13365 1.23488 1.23464C1.1339 1.33562 1.07717 1.47258 1.07717 1.61539V1.65846C1.32486 4.84615 2.91332 12.3846 12.3526 12.9231C12.4233 12.9275 12.4942 12.9178 12.5612 12.8947C12.6282 12.8716 12.69 12.8355 12.743 12.7885C12.7961 12.7415 12.8393 12.6845 12.8702 12.6207C12.9012 12.5569 12.9192 12.4877 12.9233 12.4169V9.54154L10.8933 8.72846L9.34794 10.2631L9.08948 10.2308C4.40486 9.64385 3.76948 4.95923 3.76948 4.91077L3.73717 4.65231L5.2664 3.10692L4.45871 1.07692H1.61563Z" fill="currentColor"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="17" height="12" viewBox="0 0 17 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M15.6888 0C16.0047 0 16.2931 0.192151 16.4241 0.489651C16.4738 0.593965 16.5 0.711618 16.5 0.830018V11.1561C16.5 11.2133 16.494 11.2703 16.4821 11.3256C16.4737 11.3686 16.462 11.4111 16.4474 11.4521C16.3285 11.7849 16.0308 12 15.6888 12H1.30961C0.967644 12 0.669889 11.7849 0.551024 11.4521C0.511476 11.3414 0.494785 11.2261 0.501415 11.1094V0.890625C0.494785 0.773926 0.511476 0.658628 0.551024 0.547891C0.669878 0.215062 0.967644 0 1.30961 0H15.6888ZM8.49921 6.90797L15.0048 1.10306H1.99367L8.49921 6.90797ZM5.8515 6L1.56406 9.8257V2.1743L5.8515 6ZM6.66657 6.72729L7.97182 7.89199C8.11913 8.02342 8.30643 8.0958 8.49921 8.0958C8.692 8.0958 8.87929 8.02342 9.02659 7.89199L10.3319 6.7273L15.0048 10.8969H1.99367L6.66657 6.72729ZM15.4374 9.82838L11.1469 6L15.4374 2.17162V9.82838Z" fill="currentColor"/>
3
+ </svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nyris/nyris-webapp",
3
- "version": "0.3.45",
3
+ "version": "0.3.47",
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.45",
17
- "@nyris/nyris-react-components": "^0.3.45",
16
+ "@nyris/nyris-api": "^0.3.47",
17
+ "@nyris/nyris-react-components": "^0.3.47",
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.1",
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",
@@ -24,7 +24,6 @@ export const defaultSettings: AppSettings = {
24
24
  '^https?://(www.)?dai.ly/',
25
25
  ],
26
26
  theme: {},
27
- templateId: '',
28
27
  field: {
29
28
  ctaLinkField: '',
30
29
  productName: '',
@@ -0,0 +1,3 @@
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M12.3849 14H12.2933C1.71255 13.3915 0.210246 4.46385 0.000245939 1.73923C-0.0166751 1.52739 0.00837059 1.31429 0.0739478 1.11214C0.139525 0.909999 0.244345 0.722779 0.382401 0.561213C0.520458 0.399646 0.689038 0.266909 0.878482 0.170606C1.06793 0.0743029 1.27451 0.0163271 1.4864 5.04857e-07H4.45332C4.66901 -0.000208291 4.87979 0.0643519 5.05836 0.185318C5.23693 0.306285 5.37506 0.478084 5.45486 0.678462L6.27332 2.69231C6.35213 2.88806 6.37168 3.10266 6.32956 3.30943C6.28744 3.51621 6.1855 3.70605 6.0364 3.85539L4.88948 5.01308C5.06863 6.03117 5.55619 6.96967 6.28619 7.70159C7.01619 8.43352 7.9534 8.92355 8.97101 9.10538L10.1395 7.94769C10.2911 7.80024 10.4827 7.70067 10.6905 7.66141C10.8983 7.62215 11.113 7.64494 11.3079 7.72692L13.3379 8.54C13.5353 8.62232 13.7037 8.76153 13.8216 8.9399C13.9396 9.11827 14.0018 9.32771 14.0002 9.54154V12.3846C14.0002 12.813 13.8301 13.2239 13.5271 13.5269C13.2242 13.8298 12.8133 14 12.3849 14ZM1.61563 1.07692C1.47282 1.07692 1.33586 1.13365 1.23488 1.23464C1.1339 1.33562 1.07717 1.47258 1.07717 1.61539V1.65846C1.32486 4.84615 2.91332 12.3846 12.3526 12.9231C12.4233 12.9275 12.4942 12.9178 12.5612 12.8947C12.6282 12.8716 12.69 12.8355 12.743 12.7885C12.7961 12.7415 12.8393 12.6845 12.8702 12.6207C12.9012 12.5569 12.9192 12.4877 12.9233 12.4169V9.54154L10.8933 8.72846L9.34794 10.2631L9.08948 10.2308C4.40486 9.64385 3.76948 4.95923 3.76948 4.91077L3.73717 4.65231L5.2664 3.10692L4.45871 1.07692H1.61563Z" fill="currentColor"/>
3
+ </svg>
@@ -1,3 +1,3 @@
1
- <svg width="12" height="9" viewBox="0 0 12 9" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M11.1429 0H0.857143C0.629814 0 0.411797 0.0903058 0.251051 0.251051C0.0903058 0.411797 0 0.629814 0 0.857143V7.71429C0 7.94161 0.0903058 8.15963 0.251051 8.32038C0.411797 8.48112 0.629814 8.57143 0.857143 8.57143H11.1429C11.3702 8.57143 11.5882 8.48112 11.7489 8.32038C11.9097 8.15963 12 7.94161 12 7.71429V0.857143C12 0.629814 11.9097 0.411797 11.7489 0.251051C11.5882 0.0903058 11.3702 0 11.1429 0ZM10.2 0.857143L6 3.76286L1.8 0.857143H10.2ZM0.857143 7.71429V1.24714L5.75571 4.63714C5.82746 4.68691 5.91269 4.71358 6 4.71358C6.08731 4.71358 6.17254 4.68691 6.24429 4.63714L11.1429 1.24714V7.71429H0.857143Z" fill="#55566B"/>
1
+ <svg width="17" height="12" viewBox="0 0 17 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M15.6888 0C16.0047 0 16.2931 0.192151 16.4241 0.489651C16.4738 0.593965 16.5 0.711618 16.5 0.830018V11.1561C16.5 11.2133 16.494 11.2703 16.4821 11.3256C16.4737 11.3686 16.462 11.4111 16.4474 11.4521C16.3285 11.7849 16.0308 12 15.6888 12H1.30961C0.967644 12 0.669889 11.7849 0.551024 11.4521C0.511476 11.3414 0.494785 11.2261 0.501415 11.1094V0.890625C0.494785 0.773926 0.511476 0.658628 0.551024 0.547891C0.669878 0.215062 0.967644 0 1.30961 0H15.6888ZM8.49921 6.90797L15.0048 1.10306H1.99367L8.49921 6.90797ZM5.8515 6L1.56406 9.8257V2.1743L5.8515 6ZM6.66657 6.72729L7.97182 7.89199C8.11913 8.02342 8.30643 8.0958 8.49921 8.0958C8.692 8.0958 8.87929 8.02342 9.02659 7.89199L10.3319 6.7273L15.0048 10.8969H1.99367L6.66657 6.72729ZM15.4374 9.82838L11.1469 6L15.4374 2.17162V9.82838Z" fill="currentColor"/>
3
3
  </svg>
@@ -74,14 +74,14 @@ function CadenasWebViewer({
74
74
 
75
75
  // initialize 3d viewer
76
76
  let webviewer3d = new psol.components.WebViewer3D(webViewer3DSettings);
77
- psol.core.setApiKey(settings.cadenasAPIKey);
77
+ psol.core.setApiKey(settings.cadenas?.cadenasAPIKey);
78
78
  setStatus3dView('loading');
79
79
  // run search and display result in 3D viewer.
80
80
  psol.core
81
81
  .ajaxGetOrPost({
82
82
  url: psol.core.getServiceBaseUrl() + '/service/reversemap',
83
83
  data: {
84
- catalog: settings.catalog,
84
+ catalog: settings.cadenas?.catalog,
85
85
  part: sku,
86
86
  exact: '0',
87
87
  },
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { ReactComponent as IconLike } from 'common/assets/icons/icon_like.svg';
3
+ import { ReactComponent as IconDislike } from 'common/assets/icons/icon_dislike.svg';
4
+ import { ReactComponent as IconClose } from 'common/assets/icons/close.svg';
5
+
6
+ function Feedback({
7
+ submitFeedback,
8
+ onFeedbackClose,
9
+ }: {
10
+ submitFeedback: any;
11
+ onFeedbackClose: any;
12
+ }) {
13
+ return (
14
+ <div className="feedback-wrapper">
15
+ <p>Are these results useful?</p>
16
+ <div
17
+ className="feedback-icon-wrapper"
18
+ onClick={() => submitFeedback(false)}
19
+ >
20
+ <IconDislike />
21
+ </div>
22
+ <div
23
+ className="feedback-icon-wrapper"
24
+ onClick={() => submitFeedback(true)}
25
+ >
26
+ <IconLike />
27
+ </div>
28
+
29
+ <div className="feedback-icon-wrapper" onClick={() => onFeedbackClose()}>
30
+ <IconClose />
31
+ </div>
32
+ </div>
33
+ );
34
+ }
35
+
36
+ export default Feedback;
@@ -1,6 +1,5 @@
1
1
  import { Box, Menu, MenuProps, withStyles } from '@material-ui/core';
2
2
  import React from 'react';
3
- import { NavLink } from 'react-router-dom';
4
3
  import './common.scss';
5
4
  import { useAppDispatch, useAppSelector } from 'Store/Store';
6
5
  import { reset, setPreFilter } from 'Store/search/Search';
@@ -62,8 +61,8 @@ function Header(): JSX.Element {
62
61
 
63
62
  return (
64
63
  <Box className="box-content" display={'flex'}>
65
- <NavLink
66
- to="/"
64
+ <a
65
+ href={window.location.origin}
67
66
  style={{ lineHeight: 0, paddingLeft: '10px' }}
68
67
  onClick={() => {
69
68
  dispatch(reset(''));
@@ -79,7 +78,7 @@ function Header(): JSX.Element {
79
78
  height: settings.theme?.logoHeight,
80
79
  }}
81
80
  />
82
- </NavLink>
81
+ </a>
83
82
 
84
83
  {auth0.enabled && isAuthenticated && (
85
84
  <div style={{ position: 'relative' }}>
@@ -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
- {editActive && (
121
- <div>
122
- <Box className="box-preview">
123
- <Box
124
- className="preview-item expand-animation"
125
- style={{ backgroundColor: 'transparent' }}
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,51 @@ function ImagePreviewMobileComponent({
133
133
  image={requestImage?.canvas}
134
134
  selection={imageSelection || DEFAULT_REGION}
135
135
  regions={filteredRegions}
136
- maxWidth={240}
137
- maxHeight={240}
138
- dotColor={'#FBD914'}
139
- minCropWidth={60}
140
- minCropHeight={60}
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={true}
143
- />
144
- </Box>
145
- {(showAdjustInfoBasedOnConfidence || showAdjustInfo) && (
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
- <IconInfo color="white" />
158
- <Typography
159
- style={{
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
+ />
151
+ </div>
170
152
  </Box>
171
- <Hidden>
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>
153
+ {(showAdjustInfoBasedOnConfidence || showAdjustInfo) && (
197
154
  <Box
198
- className="slideDown"
199
- sx={{
200
- position: 'absolute',
201
- bottom: '25px',
202
- right: '20px',
155
+ className="box-title_col-left"
156
+ alignItems="center"
157
+ style={{
158
+ backgroundColor: '#3E36DC',
159
+ display: 'flex',
160
+ columnGap: '6px',
161
+ padding: '5px',
162
+ width: 'fit-content',
163
+ minWidth: '180px',
203
164
  }}
204
- onClick={handleArrowClick}
205
165
  >
206
- <Box
207
- bgcolor={'white'}
208
- sx={{
209
- width: '24px',
210
- height: '24px',
211
- justifyContent: 'center',
212
- alignItems: 'center',
213
- display: 'flex',
214
- borderRadius: '100%',
166
+ <IconInfo color="white" />
167
+ <Typography
168
+ style={{
169
+ fontSize: 10,
170
+ color: '#fff',
215
171
  }}
216
172
  >
217
- <ArrowUp color="black" />
218
- </Box>
173
+ {showAdjustInfo
174
+ ? t('Crop the image for better results')
175
+ : 'Crop the image for better results'}
176
+ </Typography>
219
177
  </Box>
220
- </Hidden>
221
- </div>
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
- >
178
+ )}
179
+ </Box>
180
+ <>
234
181
  <Hidden>
235
182
  <Box
236
183
  sx={{
@@ -242,7 +189,6 @@ function ImagePreviewMobileComponent({
242
189
  onClick={onImageRemove}
243
190
  >
244
191
  <Box
245
- // className={showShrinkAnimation ? 'slideUp' : ''}
246
192
  sx={{
247
193
  width: '24px',
248
194
  height: '24px',
@@ -256,49 +202,19 @@ function ImagePreviewMobileComponent({
256
202
  </Box>
257
203
  </Box>
258
204
  </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
205
 
282
- <div
283
- className={
284
- showShrinkAnimation
285
- ? 'shrink-animation circle-layer'
286
- : 'circle-layer'
287
- }
288
- ></div>
289
- </Box>
290
206
  <Hidden mdUp>
291
207
  <Box
208
+ className="slideDown"
292
209
  sx={{
293
210
  position: 'absolute',
294
- right: '25px',
295
- padding: '4px',
211
+ bottom: '25px',
212
+ right: '20px',
296
213
  }}
297
214
  onClick={handleArrowClick}
298
215
  >
299
216
  <Box
300
217
  bgcolor={'white'}
301
- className={showShrinkAnimation ? 'slideUp' : ''}
302
218
  sx={{
303
219
  width: '24px',
304
220
  height: '24px',
@@ -308,12 +224,13 @@ function ImagePreviewMobileComponent({
308
224
  borderRadius: '100%',
309
225
  }}
310
226
  >
311
- <ArrowDown color="black" fill="black" />
227
+ {editActive && <ArrowUp color="black" />}
228
+ {!editActive && <ArrowDown color="black" fill="black" />}
312
229
  </Box>
313
230
  </Box>
314
231
  </Hidden>
315
- </Box>
316
- )}
232
+ </>
233
+ </div>
317
234
  </Box>
318
235
  );
319
236
  }
@@ -3,6 +3,10 @@ import { getCroppedCanvas } from 'helpers/getCroppedCanvas';
3
3
  import React, { useEffect, useState } from 'react';
4
4
  import { useMediaQuery } from 'react-responsive';
5
5
  import InquiryModal from './InquiryModal';
6
+ import { useAppSelector } from 'Store/Store';
7
+ import { ReactComponent as EmailIcon } from 'common/assets/icons/icon_email.svg';
8
+ import { ReactComponent as CallIcon } from 'common/assets/icons/call.svg';
9
+ import { useTranslation } from 'react-i18next';
6
10
 
7
11
  function InquiryBanner({
8
12
  requestImage,
@@ -23,6 +27,13 @@ function InquiryBanner({
23
27
  setInquiryStatus('inactive');
24
28
  }, [selectedRegion, query]);
25
29
 
30
+ const { description, emailInquiry, supportNumber } =
31
+ useAppSelector(state => state.settings.support) || {};
32
+ const { secondaryColor } =
33
+ useAppSelector(state => state.settings.theme) || {};
34
+
35
+ const { t } = useTranslation();
36
+
26
37
  return (
27
38
  <>
28
39
  {isInquiryModalOpen && (
@@ -31,18 +42,17 @@ function InquiryBanner({
31
42
  selectedRegion={selectedRegion}
32
43
  setIsInquiryModalOpen={setIsInquiryModalOpen}
33
44
  isInquiryModalOpen={isInquiryModalOpen}
34
- setInquiryStatus={setInquiryStatus}
35
45
  />
36
46
  )}
37
47
  <Box
38
48
  style={{
39
- padding: !isMobile ? '24px 40px 24px 40px' : '16px 16px 16px 16px',
40
49
  backgroundColor: '#F3F3F5',
41
50
  width: '100%',
42
51
  marginBottom: '32px',
43
52
  alignSelf: 'end',
44
53
  display: 'flex',
45
54
  alignItems: 'center',
55
+ marginRight: '12px',
46
56
  }}
47
57
  className="rfq-box"
48
58
  >
@@ -50,9 +60,8 @@ function InquiryBanner({
50
60
  style={{
51
61
  width: '100%',
52
62
  display: 'flex',
53
- columnGap: !isMobile ? '26px' : '8px',
63
+ columnGap: !isMobile ? '26px' : '16px',
54
64
  alignItems: 'center',
55
- justifyContent: 'space-between',
56
65
  }}
57
66
  >
58
67
  {requestImage && (
@@ -64,8 +73,7 @@ function InquiryBanner({
64
73
  )?.toDataURL()}
65
74
  alt="request_image"
66
75
  style={{
67
- mixBlendMode:
68
- inquiryStatus !== 'inactive' ? 'overlay' : 'unset',
76
+ mixBlendMode: 'unset',
69
77
  maxHeight: !isMobile ? '181px' : '120px',
70
78
  maxWidth: !isMobile ? '181px' : '120px',
71
79
  borderRadius: '2px',
@@ -74,10 +82,10 @@ function InquiryBanner({
74
82
  </div>
75
83
  )}
76
84
 
77
- <Box>
85
+ <Box style={{ width: '100%' }}>
78
86
  <Box
79
87
  style={{
80
- paddingBottom: '12px',
88
+ paddingBottom: '8px',
81
89
  paddingLeft: '16px',
82
90
  }}
83
91
  >
@@ -89,47 +97,107 @@ function InquiryBanner({
89
97
  }}
90
98
  >
91
99
  {isMobile
92
- ? 'No matches found?'
93
- : 'No matches found for your request?'}
100
+ ? `${t('No matches found')}?`
101
+ : `${t('No matches found for your request')}?`}
94
102
  </Box>
95
103
  <Box
96
104
  style={{
97
- fontSize: '12px',
105
+ fontSize: '14px',
98
106
  maxWidth: '320x',
99
- lineHeight: '14.1px',
107
+ lineHeight: '16px',
100
108
  color: inquiryStatus === 'inactive' ? '#4B4B4A' : '#2B2C46',
101
109
  fontWeight: 'normal',
102
110
  }}
103
111
  >
104
- Get personalised help from our team of product experts.
112
+ {description}
105
113
  </Box>
106
114
  </Box>
107
- <button
115
+ <div
108
116
  style={{
109
- width: '200px',
110
- background:
111
- inquiryStatus === 'inactive' ? '#2B2C46' : '#E9E9EC',
112
- boxShadow:
113
- inquiryStatus === 'inactive'
114
- ? '0px 0px 4px 0px rgba(0, 0, 0, 0.25)'
115
- : '',
116
- borderRadius: '2px',
117
- padding: '16px 16px 16px 16px',
118
117
  display: 'flex',
119
- alignItems: 'center',
120
- color: inquiryStatus === 'inactive' ? '#fff' : '#CACAD1',
121
- fontSize: '14px',
122
- height: '48px',
123
- cursor: inquiryStatus === 'inactive' ? 'pointer' : 'default',
124
- border: 'none',
125
- }}
126
- disabled={inquiryStatus !== 'inactive'}
127
- onClick={() => {
128
- setIsInquiryModalOpen(true);
118
+ gap: isMobile ? '8px' : '16px',
119
+ width: isMobile ? '100%' : '100%',
120
+ maxWidth: '400px',
129
121
  }}
122
+ className="support-button-wrapper"
130
123
  >
131
- Submit an Inquiry
132
- </button>
124
+ {emailInquiry && (
125
+ <div
126
+ style={{
127
+ width: emailInquiry && supportNumber ? '50%' : '100%',
128
+ maxWidth: '170px',
129
+ minWidth: '86px',
130
+ background:
131
+ inquiryStatus === 'inactive' ? secondaryColor : '#E9E9EC',
132
+ boxShadow:
133
+ inquiryStatus === 'inactive'
134
+ ? '0px 0px 4px 0px rgba(0, 0, 0, 0.25)'
135
+ : '',
136
+ borderRadius: '2px',
137
+ padding: !isMobile
138
+ ? '8px 16px 8px 16px'
139
+ : '8px 8px 8px 8px',
140
+ display: 'flex',
141
+ alignItems: 'center',
142
+ color: inquiryStatus === 'inactive' ? '#fff' : '#CACAD1',
143
+ fontSize: '13px',
144
+ cursor:
145
+ inquiryStatus === 'inactive' ? 'pointer' : 'default',
146
+ border: 'none',
147
+ }}
148
+ onClick={() => {
149
+ setIsInquiryModalOpen(true);
150
+ }}
151
+ >
152
+ <div
153
+ style={{
154
+ width: '100%',
155
+ display: 'flex',
156
+ alignItems: 'center',
157
+ justifyContent: 'space-between',
158
+ }}
159
+ >
160
+ <p>Inquiry</p>
161
+ <EmailIcon color="#fff" width={16} height={16} />
162
+ </div>
163
+ </div>
164
+ )}
165
+ {supportNumber && (
166
+ <a
167
+ style={{
168
+ width: emailInquiry && supportNumber ? '50%' : '100%',
169
+ maxWidth: '170px',
170
+ minWidth: '86px',
171
+ background: secondaryColor,
172
+ boxShadow: '0px 0px 4px 0px rgba(0, 0, 0, 0.25)',
173
+ borderRadius: '2px',
174
+ padding: !isMobile
175
+ ? '8px 16px 8px 16px'
176
+ : '8px 8px 8px 8px',
177
+ display: 'flex',
178
+ alignItems: 'center',
179
+ color: '#fff',
180
+ fontSize: '13px',
181
+ cursor: 'pointer',
182
+ border: 'none',
183
+ fontWeight: 500,
184
+ }}
185
+ href={`tel:${supportNumber}`}
186
+ >
187
+ <div
188
+ style={{
189
+ width: '100%',
190
+ display: 'flex',
191
+ alignItems: 'center',
192
+ justifyContent: 'space-between',
193
+ }}
194
+ >
195
+ <p> Call us</p>
196
+ <CallIcon color="#fff" width={16} height={16} />
197
+ </div>
198
+ </a>
199
+ )}
200
+ </div>
133
201
  </Box>
134
202
  </Box>
135
203
  </Box>
@@ -17,7 +17,6 @@ interface Props {
17
17
  selectedRegion: any;
18
18
  setIsInquiryModalOpen: any;
19
19
  isInquiryModalOpen?: any;
20
- setInquiryStatus: any;
21
20
  }
22
21
  // eslint-disable-next-line
23
22
  const emailRegex = /.+\@.+\..+$/;
@@ -41,7 +40,6 @@ export default function InquiryModal({
41
40
  selectedRegion,
42
41
  setIsInquiryModalOpen,
43
42
  isInquiryModalOpen,
44
- setInquiryStatus,
45
43
  }: Props) {
46
44
  const stateGlobal = useAppSelector(state => state);
47
45
  const {
@@ -78,20 +76,19 @@ export default function InquiryModal({
78
76
  : null;
79
77
  const serviceId = 'service_zfsxshi';
80
78
  setIsInquiryModalOpen(false);
81
- if (settings.templateId) {
79
+ const templateId = settings.support?.emailTemplateId;
80
+ if (templateId) {
82
81
  try {
83
- setInquiryStatus('loading');
84
- await emailjs.send(serviceId, settings.templateId, {
82
+ await emailjs.send(serviceId, templateId, {
85
83
  email_id: email.trim(),
86
- information_text: information,
84
+ information_text: information ? information : '<not specified>',
87
85
  request_image: croppedImage?.toDataURL(),
88
- prefilter_values: preFilterValues.join(', '),
86
+ prefilter_values: preFilterValues?.length
87
+ ? preFilterValues.join(', ')
88
+ : '<not specified>',
89
89
  });
90
- setInquiryStatus('sent');
91
90
  ToastHelper.success('Request sent successfully');
92
91
  } catch (error) {
93
- setInquiryStatus('inactive');
94
-
95
92
  toast(
96
93
  t => {
97
94
  return (