@nyris/nyris-webapp 0.3.39 → 0.3.41

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 (52) hide show
  1. package/build/asset-manifest.json +16 -13
  2. package/build/index.html +1 -1
  3. package/build/{precache-manifest.3b5a3a7e1d0fa75fd54cc6ebaf64d225.js → precache-manifest.d9bae9c81b3a390a89a437be45e3a94b.js} +22 -10
  4. package/build/service-worker.js +1 -1
  5. package/build/static/css/main.86d40309.chunk.css +2 -0
  6. package/build/static/css/main.86d40309.chunk.css.map +1 -0
  7. package/build/static/js/2.1e5f374f.chunk.js +3 -0
  8. package/build/static/js/2.1e5f374f.chunk.js.map +1 -0
  9. package/build/static/js/main.909efae2.chunk.js +3 -0
  10. package/build/static/js/main.909efae2.chunk.js.map +1 -0
  11. package/build/static/media/arrow_down.c1b611db.svg +3 -0
  12. package/build/static/media/arrow_up.fcd6b144.svg +3 -0
  13. package/build/static/media/trash.1624780d.svg +3 -0
  14. package/package.json +3 -3
  15. package/src/App.tsx +14 -14
  16. package/src/Store/constants.ts +1 -0
  17. package/src/common/assets/icons/arrow_down.svg +3 -0
  18. package/src/common/assets/icons/arrow_up.svg +3 -0
  19. package/src/common/assets/icons/trash.svg +3 -0
  20. package/src/components/AppMobile.tsx +1 -0
  21. package/src/components/CadenasLoading.tsx +4 -3
  22. package/src/components/DragDropFile.tsx +8 -8
  23. package/src/components/HeaderMobile.tsx +11 -5
  24. package/src/components/ImageCaptureHelpModal.tsx +9 -4
  25. package/src/components/ImagePreviewMobile.tsx +230 -43
  26. package/src/components/Inquiry/InquiryBanner.tsx +1 -1
  27. package/src/components/Inquiry/InquiryModal.tsx +58 -57
  28. package/src/components/Layout.tsx +35 -3
  29. package/src/components/Loading.tsx +69 -0
  30. package/src/components/PanelResult/index.tsx +6 -2
  31. package/src/components/ProductDetailView.tsx +2 -2
  32. package/src/components/ProductList/index.tsx +4 -2
  33. package/src/components/appMobile.scss +4 -28
  34. package/src/components/common.scss +68 -3
  35. package/src/components/drawer/cameraCustom.tsx +2 -2
  36. package/src/components/input/inputSearch.tsx +3 -3
  37. package/src/components/results/ItemResult.tsx +2 -2
  38. package/src/components/rfq/RfqBanner.tsx +2 -2
  39. package/src/components/rfq/RfqModal.tsx +56 -53
  40. package/src/page/landingPage/AppMD.tsx +11 -10
  41. package/src/page/landingPage/common.scss +5 -81
  42. package/src/page/result/index.tsx +1 -1
  43. package/src/translations.ts +59 -8
  44. package/src/types.ts +1 -0
  45. package/build/static/css/main.37f029a6.chunk.css +0 -2
  46. package/build/static/css/main.37f029a6.chunk.css.map +0 -1
  47. package/build/static/js/2.38a0d15b.chunk.js +0 -3
  48. package/build/static/js/2.38a0d15b.chunk.js.map +0 -1
  49. package/build/static/js/main.263e0030.chunk.js +0 -3
  50. package/build/static/js/main.263e0030.chunk.js.map +0 -1
  51. /package/build/static/js/{2.38a0d15b.chunk.js.LICENSE.txt → 2.1e5f374f.chunk.js.LICENSE.txt} +0 -0
  52. /package/build/static/js/{main.263e0030.chunk.js.LICENSE.txt → main.909efae2.chunk.js.LICENSE.txt} +0 -0
@@ -9,6 +9,7 @@ import { TextareaAutosize } from '@material-ui/core';
9
9
  import toast from 'react-hot-toast';
10
10
  import { ReactComponent as ErrorIcon } from 'common/assets/icons/error.svg';
11
11
  import { useMediaQuery } from 'react-responsive';
12
+ import { useAppSelector } from '../../Store/Store';
12
13
  interface Props {
13
14
  requestImage: any;
14
15
  selectedRegion: any;
@@ -43,6 +44,7 @@ export default function RfqModal({
43
44
  const [email, setEmail] = useState('');
44
45
  const [emailValid, setEmailValid] = useState<boolean | undefined>(undefined);
45
46
  const isMobile = useMediaQuery({ query: '(max-width: 776px)' });
47
+ const { settings } = useAppSelector(state => state);
46
48
 
47
49
  const [information, setInformation] = useState('');
48
50
  const setFormattedContent = React.useCallback(
@@ -62,66 +64,67 @@ export default function RfqModal({
62
64
  const { canvas }: any = requestImage;
63
65
  const croppedImage = getCroppedCanvas(canvas, selectedRegion);
64
66
  const serviceId = 'service_zfsxshi';
65
- const templateId = 'template_jlgc9le';
66
67
  setIsRfqModalOpen(false);
67
- try {
68
- setRfqStatus('loading');
69
- await emailjs.send(serviceId, templateId, {
70
- email_id: email.trim(),
71
- information_text: information,
72
- request_image: croppedImage?.toDataURL(),
73
- });
74
- setRfqStatus('sent');
75
- ToastHelper.success('Request sent successfully');
76
- } catch (error) {
77
- setRfqStatus('inactive');
68
+ if (settings.templateId) {
69
+ try {
70
+ setRfqStatus('loading');
71
+ await emailjs.send(serviceId, settings.templateId, {
72
+ email_id: email.trim(),
73
+ information_text: information,
74
+ request_image: croppedImage?.toDataURL(),
75
+ });
76
+ setRfqStatus('sent');
77
+ ToastHelper.success('Request sent successfully');
78
+ } catch (error) {
79
+ setRfqStatus('inactive');
78
80
 
79
- toast(
80
- t => {
81
- return (
82
- <div
83
- style={{
84
- display: 'flex',
85
- flexDirection: 'column',
86
- fontSize: '14px',
87
- width: '294px',
88
- }}
89
- >
90
- <span style={{ fontWeight: 'bold' }}>Email not sent</span>
91
- <span>{getErrorMessage(error)}</span>
92
- <a
93
- href={`mailto:support@nyris.io?subject=Request for quotation&body=${information}`}
81
+ toast(
82
+ t => {
83
+ return (
84
+ <div
94
85
  style={{
95
- padding: '8px 16px 8px 16px',
96
- border: '1px solid #000',
97
- marginTop: '16px',
98
- backgroundColor: 'transparent',
99
- color: '#000',
100
- cursor: 'pointer',
101
- width: 'fit-content',
86
+ display: 'flex',
87
+ flexDirection: 'column',
88
+ fontSize: '14px',
89
+ width: '294px',
102
90
  }}
103
91
  >
104
- support@nyris.io
105
- </a>
106
- </div>
107
- );
108
- },
109
- {
110
- duration: 5000,
111
- style: {
112
- background: '#FFE5EF',
113
- color: '#000000',
114
- maxWidth: '400px',
92
+ <span style={{fontWeight: 'bold'}}>Email not sent</span>
93
+ <span>{getErrorMessage(error)}</span>
94
+ <a
95
+ href={`mailto:support@nyris.io?subject=Request for quotation&body=${information}`}
96
+ style={{
97
+ padding: '8px 16px 8px 16px',
98
+ border: '1px solid #000',
99
+ marginTop: '16px',
100
+ backgroundColor: 'transparent',
101
+ color: '#000',
102
+ cursor: 'pointer',
103
+ width: 'fit-content',
104
+ }}
105
+ >
106
+ support@nyris.io
107
+ </a>
108
+ </div>
109
+ );
115
110
  },
116
- icon: (
117
- <div style={{ minWidth: '20px', minHeight: '20px' }}>
118
- <ErrorIcon />
119
- </div>
120
- ),
121
- },
122
- );
111
+ {
112
+ duration: 5000,
113
+ style: {
114
+ background: '#FFE5EF',
115
+ color: '#000000',
116
+ maxWidth: '400px',
117
+ },
118
+ icon: (
119
+ <div style={{minWidth: '20px', minHeight: '20px'}}>
120
+ <ErrorIcon/>
121
+ </div>
122
+ ),
123
+ },
124
+ );
125
+ }
126
+ setIsRfqModalOpen(false);
123
127
  }
124
- setIsRfqModalOpen(false);
125
128
  };
126
129
 
127
130
  return (
@@ -32,19 +32,20 @@ function AppMD() {
32
32
 
33
33
  return (
34
34
  <Box className={`box-content-main ${isLoading ? 'loading' : ''}`}>
35
- <Box className="box-content_top">
35
+ <Box className="box-content_top" style={{ position: 'relative' }}>
36
36
  {settings.headerText && (
37
- <Box className="fw-700 text-f32 text-dark2">
38
- <h1>{settings.headerText}</h1>
39
- </Box>
37
+ <Box
38
+ className="fw-700 text-f32 text-dark2"
39
+ style={{ position: 'absolute', bottom: '49px' }}
40
+ >
41
+ <h1>{settings.headerText}</h1>
42
+ </Box>
40
43
  )}
41
- <div className="box-input">
42
- <div className="wrap-input-search">
43
- <div style={{ display: 'none' }}>
44
- <CustomInfiniteHits />
45
- </div>
46
- <CustomSearchBox />
44
+ <div className="wrap-input-search">
45
+ <div style={{ display: 'none' }}>
46
+ <CustomInfiniteHits />
47
47
  </div>
48
+ <CustomSearchBox />
48
49
  </div>
49
50
  </Box>
50
51
  <Box className="box-content_bottom">
@@ -217,88 +217,14 @@ button {
217
217
  position: absolute;
218
218
  width: 104px;
219
219
  height: 104px;
220
- top: calc(-104px / 2);
220
+
221
221
  // background: #fff;
222
222
  border-radius: 100%;
223
223
  z-index: 111;
224
224
  left: 0;
225
225
  right: 0;
226
226
  margin: auto;
227
- &::after {
228
- content: 'loading';
229
- position: absolute;
230
- top: 0;
231
- margin: auto;
232
- bottom: 0;
233
- width: 87%;
234
- height: 87%;
235
- display: flex;
236
- justify-content: center;
237
- align-items: center;
238
- z-index: 112;
239
- font-size: 14px !important;
240
- line-height: 38px;
241
- font-weight: 500;
242
- color: #fff;
243
- background: rgba(43, 44, 70, 1);
244
- margin: auto;
245
- left: 0;
246
- right: 0;
247
- bottom: 0;
248
- border-radius: 100%;
249
- }
250
- &::before {
251
- content: '';
252
- }
253
- .box-content-spin {
254
- width: 104px;
255
- height: 104px;
256
- position: absolute;
257
- border-radius: 100%;
258
- animation: spin 2s linear infinite;
259
- &:before {
260
- content: '';
261
- position: absolute;
262
- top: 0;
263
- right: 0;
264
- bottom: 0;
265
- left: 0;
266
- z-index: 0;
267
- border-radius: 100%;
268
- // background: linear-gradient(
269
- // 180deg,
270
- // #3e36dc 0%,
271
- // #e31b5d 44.27%,
272
- // rgba(255, 255, 255, 0) 100%
273
- // );
274
- background: conic-gradient(
275
- from 90deg at 50.46% 50.46%,
276
- #322bb0 -30.73deg,
277
- #3e36dc 111.58deg,
278
- #00ff94 212.7deg,
279
- #322bb0 329.27deg,
280
- #3e36dc 471.58deg
281
- );
282
- box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.25);
283
- }
284
- @-webkit-keyframes spin {
285
- 0% {
286
- -webkit-transform: rotate(0deg);
287
- }
288
- 100% {
289
- -webkit-transform: rotate(360deg);
290
- }
291
- }
292
227
 
293
- @keyframes spin {
294
- 0% {
295
- transform: rotate(0deg);
296
- }
297
- 100% {
298
- transform: rotate(360deg);
299
- }
300
- }
301
- }
302
228
  }
303
229
 
304
230
  .box-modal-default {
@@ -786,7 +712,7 @@ button {
786
712
  }
787
713
  display: flex;
788
714
  flex-direction: column;
789
- justify-content: space-between;
715
+ justify-content: center;
790
716
  align-items: center;
791
717
  height: 100%;
792
718
  background: #FAFAFA;
@@ -794,7 +720,6 @@ button {
794
720
 
795
721
  width: 100%;
796
722
  // min-height: calc(100% - 341px);
797
- margin-top: 300px;
798
723
  display: flex;
799
724
  justify-content: center;
800
725
  align-items: center;
@@ -826,10 +751,8 @@ button {
826
751
  }
827
752
  .box-content_bottom {
828
753
  width: 100%;
829
- height: 256px;
830
754
  max-width: 512px;
831
755
  position: relative;
832
- margin-bottom: auto;
833
756
  @media screen and (min-width: 2047px) {
834
757
  position: initial;
835
758
  .loadingSpinCT {
@@ -852,6 +775,7 @@ button {
852
775
  padding-top: 16px;
853
776
  padding-bottom: 16px;
854
777
  color: #CACAD1;
778
+ border: 2px dashed transparent;
855
779
  &:hover {
856
780
  border-radius: 60px;
857
781
  border: 2px dashed #E0E0E0;
@@ -992,7 +916,7 @@ button {
992
916
  }
993
917
  }
994
918
  .box-result {
995
- height: calc(100svh - 148px);
919
+ height: calc(100vh - 148px);
996
920
  @media screen and (max-width: 776px) {
997
921
  height: 100%
998
922
  }
@@ -1556,7 +1480,7 @@ button {
1556
1480
 
1557
1481
  .wrap-main-support-page {
1558
1482
  background-color: #2b2c46;
1559
- min-height: calc(100svh - 32px);
1483
+ min-height: calc(100vh - 32px);
1560
1484
  // max-width: 1280px;
1561
1485
  padding: 40px;
1562
1486
  margin: auto;
@@ -382,7 +382,7 @@ function ResultComponent(props: Props) {
382
382
  settings.preview && 'ml-auto mr-auto'
383
383
  } ${isMobile && 'col-right-result-mobile'}`}
384
384
  style={{
385
- paddingTop: isMobile ? '16px' : '40px',
385
+ paddingTop: isMobile ? '8px' : '40px',
386
386
  overflow: !isMobile ? 'auto' : '',
387
387
  display: 'flex',
388
388
  flexDirection: 'column',
@@ -2,9 +2,10 @@ export const translations = {
2
2
  en: {
3
3
  translation: {
4
4
  Search: 'Search',
5
- 'Choose an image': 'Drag and drop ',
6
- 'or drag it here': 'an image here',
5
+ 'Drag and drop': 'Drag and drop',
6
+ 'an image here': 'an image here',
7
7
  'Manufacturer Number': 'Manufacturer No.',
8
+ 'Mfr. No.': 'Mfr. No.',
8
9
  'Close group': 'Close group',
9
10
  'Show group': 'Show group',
10
11
  'Adjust the search frame around your object for improved results':
@@ -13,24 +14,74 @@ export const translations = {
13
14
  'Items per page': 'Items per page',
14
15
  'Search with an image': 'Search with an image',
15
16
  'Clear text search': 'Clear text search',
17
+ 'View details': 'View details',
18
+ 'Clear image search': 'Clear image search ',
19
+ 'Add or change pre-filter': 'Add or change pre-filter',
20
+ 'Expand all': 'Expand all',
21
+ 'Collapse all': 'Collapse all',
22
+ Brand: 'Brand',
23
+ loading: 'loading',
24
+ 'No products were found matching your search criteria.':
25
+ 'No products were found matching your search criteria.',
26
+ 'Please upload an image or enter a keyword to search.':
27
+ 'Please upload an image or enter a keyword to search.',
16
28
  },
17
29
  },
18
30
  de: {
19
31
  translation: {
20
32
  Search: 'Suche',
21
- 'Choose an image': 'Bild wählen',
22
- 'or drag it here': 'oder hierhin ziehen',
23
- 'Manufacturer Number': 'Herst. Teile-Nr.',
33
+ 'Drag and drop': 'Bild hierher ziehen',
34
+ 'an image here': '',
35
+ 'Mfr. No.': 'Herst. Teile-Nr.',
36
+ 'Manufacturer Number': 'Herstellerteilenummer',
24
37
  'Close group': 'Schließe Gruppe',
25
38
  'Show group': 'Zeige Gruppe',
26
39
  'Adjust the search frame around your object for improved results':
27
40
  'Anpassen des Rahmens für bessere Ergebnisse',
28
- 'Crop the image for better results':
29
- 'Bildausschnitt anpassen für bessere Ergebnisse',
30
-
41
+ 'Crop the image for better results': 'Zuschneiden für bessere Ergebnisse',
31
42
  'Items per page': 'Artikel pro Seite',
32
43
  'Search with an image': 'Bildsuche',
33
44
  'Clear text search': 'Suchtext löschen',
45
+ 'View details': 'Details anzeigen',
46
+ 'Clear image search': 'Bildsuche zurück setzen',
47
+ 'Add or change pre-filter': 'Vorfilter hinzufügen oder ändern',
48
+ 'Expand all': 'Alles anzeigen',
49
+ 'Collapse all': 'Alles einklappen',
50
+ Brand: 'Marke',
51
+ loading: 'Lädt',
52
+ 'No products were found matching your search criteria.':
53
+ 'Keine Produkte entsprechen Ihren Suchkriterien.',
54
+ 'Please upload an image or enter a keyword to search.':
55
+ 'Für die Suche bitte Bild hochladen oder Stichwort eingeben.',
56
+ },
57
+ },
58
+ pt: {
59
+ translation: {
60
+ Search: 'Busca',
61
+ 'Drag and drop': 'Escolha uma imagem',
62
+ 'an image here': '',
63
+ 'Manufacturer Number': 'Número do fabricante',
64
+ 'Mfr. No.': 'Nr. do Fab',
65
+ 'Close group': 'Fechar grupo',
66
+ 'Show group': 'Mostrar grupo',
67
+ 'Adjust the search frame around your object for improved results':
68
+ 'Ajuste a caixa de busca para melhores resultados',
69
+ 'Crop the image for better results':
70
+ 'Ajuste o campo de imagem para melhores resultados',
71
+ 'Items per page': 'Itens por página',
72
+ 'Search with an image': 'Busque com uma imagem',
73
+ 'Clear text search': 'Limpar busca',
74
+ 'View details': 'Ver detalhes',
75
+ 'Clear image search': 'Limpar imagem',
76
+ 'Add or change pre-filter': 'Adicionar ou selecionar pre-filtro',
77
+ 'Expand all': 'Expandir',
78
+ 'Collapse all': 'esconder tudo',
79
+ Brand: 'Marca',
80
+ loading: 'Carregando',
81
+ 'No products were found matching your search criteria.':
82
+ 'Nenhum produto foi encontrado com estes critérios ',
83
+ 'Please upload an image or enter a keyword to search.':
84
+ 'Faça o upload de uma imagem ou busque via texto',
34
85
  },
35
86
  },
36
87
  };
package/src/types.ts CHANGED
@@ -39,6 +39,7 @@ export interface AppSettings extends NyrisAPISettings {
39
39
  cadenas3dWebView?: boolean;
40
40
  rfq?: boolean;
41
41
  inquiry?: boolean;
42
+ templateId?: string;
42
43
  warehouseVariant?: boolean;
43
44
  preFilterTitle?: string;
44
45
  postFilterOption?: boolean;