@nyris/nyris-webapp 0.3.40 → 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.
- package/build/asset-manifest.json +5 -5
- package/build/index.html +1 -1
- package/build/{precache-manifest.ad1e72495167d7e9d93f00c47916ab94.js → precache-manifest.d9bae9c81b3a390a89a437be45e3a94b.js} +5 -5
- package/build/service-worker.js +1 -1
- package/build/static/js/main.909efae2.chunk.js +3 -0
- package/build/static/js/main.909efae2.chunk.js.map +1 -0
- package/package.json +3 -3
- package/src/Store/constants.ts +1 -0
- package/src/components/Inquiry/InquiryModal.tsx +58 -57
- package/src/components/rfq/RfqModal.tsx +56 -53
- package/src/types.ts +1 -0
- package/build/static/js/main.1532f80b.chunk.js +0 -3
- package/build/static/js/main.1532f80b.chunk.js.map +0 -1
- /package/build/static/js/{main.1532f80b.chunk.js.LICENSE.txt → main.909efae2.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.
|
|
3
|
+
"version": "0.3.41",
|
|
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.
|
|
16
|
-
"@nyris/nyris-react-components": "^0.3.
|
|
15
|
+
"@nyris/nyris-api": "^0.3.41",
|
|
16
|
+
"@nyris/nyris-react-components": "^0.3.41",
|
|
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/src/Store/constants.ts
CHANGED
|
@@ -77,71 +77,72 @@ export default function InquiryModal({
|
|
|
77
77
|
? getCroppedCanvas(canvas, selectedRegion)
|
|
78
78
|
: null;
|
|
79
79
|
const serviceId = 'service_zfsxshi';
|
|
80
|
-
const templateId = 'template_rxsi7w9';
|
|
81
80
|
setIsInquiryModalOpen(false);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
81
|
+
if (settings.templateId) {
|
|
82
|
+
try {
|
|
83
|
+
setInquiryStatus('loading');
|
|
84
|
+
await emailjs.send(serviceId, settings.templateId, {
|
|
85
|
+
email_id: email.trim(),
|
|
86
|
+
information_text: information,
|
|
87
|
+
request_image: croppedImage?.toDataURL(),
|
|
88
|
+
prefilter_values: preFilterValues.join(', '),
|
|
89
|
+
});
|
|
90
|
+
setInquiryStatus('sent');
|
|
91
|
+
ToastHelper.success('Request sent successfully');
|
|
92
|
+
} catch (error) {
|
|
93
|
+
setInquiryStatus('inactive');
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
95
|
+
toast(
|
|
96
|
+
t => {
|
|
97
|
+
return (
|
|
98
|
+
<div
|
|
99
|
+
style={{
|
|
100
|
+
display: 'flex',
|
|
101
|
+
flexDirection: 'column',
|
|
102
|
+
fontSize: '14px',
|
|
103
|
+
width: '294px',
|
|
104
|
+
}}
|
|
105
|
+
>
|
|
106
|
+
<span style={{ fontWeight: 'bold' }}>Email not sent</span>
|
|
107
|
+
<span>{getErrorMessage(error)}</span>
|
|
108
|
+
<a
|
|
109
|
+
href={`mailto:support@nyris.io?subject=Request for quotation&body=${encodeURIComponent(`Hello,
|
|
110
110
|
I filled out the support form on the Search Suite, but it failed. I inquired the following:
|
|
111
111
|
email:
|
|
112
112
|
Pre-filter:
|
|
113
113
|
Additional Text: `)}`}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
duration: 5000,
|
|
131
|
-
style: {
|
|
132
|
-
background: '#FFE5EF',
|
|
133
|
-
color: '#000000',
|
|
134
|
-
maxWidth: '400px',
|
|
114
|
+
style={{
|
|
115
|
+
padding: '8px 16px 8px 16px',
|
|
116
|
+
border: '1px solid #000',
|
|
117
|
+
marginTop: '16px',
|
|
118
|
+
backgroundColor: 'transparent',
|
|
119
|
+
color: '#000',
|
|
120
|
+
cursor: 'pointer',
|
|
121
|
+
width: 'fit-content',
|
|
122
|
+
}}
|
|
123
|
+
>
|
|
124
|
+
support@nyris.io
|
|
125
|
+
</a>
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
135
128
|
},
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
129
|
+
{
|
|
130
|
+
duration: 5000,
|
|
131
|
+
style: {
|
|
132
|
+
background: '#FFE5EF',
|
|
133
|
+
color: '#000000',
|
|
134
|
+
maxWidth: '400px',
|
|
135
|
+
},
|
|
136
|
+
icon: (
|
|
137
|
+
<div style={{ minWidth: '20px', minHeight: '20px' }}>
|
|
138
|
+
<ErrorIcon />
|
|
139
|
+
</div>
|
|
140
|
+
),
|
|
141
|
+
},
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
setIsInquiryModalOpen(false);
|
|
143
145
|
}
|
|
144
|
-
setIsInquiryModalOpen(false);
|
|
145
146
|
};
|
|
146
147
|
|
|
147
148
|
return (
|
|
@@ -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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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 (
|
package/src/types.ts
CHANGED