@@ -6,6 +6,7 @@ import { getBase64FromUrl } from "../../constant/Utils";
6
6
import { themeColor } from "../../constant/const" ;
7
7
import printModule from "print-js" ;
8
8
import Loader from "../../primitives/Loader" ;
9
+ import ModalUi from "../../primitives/ModalUi" ;
9
10
10
11
function EmailComponent ( {
11
12
isEmail,
@@ -170,146 +171,146 @@ function EmailComponent({
170
171
< div >
171
172
{ /* isEmail */ }
172
173
{ isEmail && (
173
- < div className = "modaloverlay" >
174
- < div className = "modalcontainer" >
175
- { isLoading && (
176
- < div className = "absolute w-full h-full flex flex-col justify-center items-center z-[20] bg-[#e6f2f2] bg-opacity-80" >
177
- < Loader />
178
- < span className = "text-[12px] font-bold" >
179
- This might take some time
180
- </ span >
181
- </ div >
182
- ) }
183
- < div style = { { background : "#32a3ac" } } className = "modalheader" >
184
- < span className = "text-white" > Successfully signed!</ span >
185
- < div className = "flex flex-row" >
186
- < div > </ div >
187
- { ! isAndroid && (
188
- < button
189
- onClick = { handleToPrint }
190
- className = "op-btn op-btn-neutral op-btn-sm text-[15px]"
191
- >
192
- < i className = "fa fa-print" aria-hidden = "true" > </ i >
193
- Print
194
- </ button >
195
- ) }
174
+ < ModalUi isOpen showHeader = { false } >
175
+ { isLoading && (
176
+ < div className = "absolute w-full h-full flex flex-col justify-center items-center z-[20] bg-[#e6f2f2]/70" >
177
+ < Loader />
178
+ < span className = "text-[12px] font-bold" >
179
+ This might take some time
180
+ </ span >
181
+ </ div >
182
+ ) }
183
+ < div className = "flex justify-between items-center py-[10px] px-[20px] border-b-[1px] border-base-content" >
184
+ < span className = "text-base-content font-semibold" >
185
+ Successfully signed!
186
+ </ span >
187
+ < div className = "flex flex-row" >
188
+ < div > </ div >
189
+ { ! isAndroid && (
196
190
< button
197
- className = "op-btn op-btn-primary op-btn-sm text-[15px] ml-2"
198
- onClick = { ( ) => handleDownloadPdf ( ) }
191
+ onClick = { handleToPrint }
192
+ className = "op-btn op-btn-neutral op-btn-sm text-[15px]"
199
193
>
200
- < i className = "fa fa-download " aria-hidden = "true" > </ i >
201
- Download
194
+ < i className = "fa fa-print " aria-hidden = "true" > </ i >
195
+ Print
202
196
</ button >
203
- </ div >
204
- </ div >
205
- < div className = "h-full p-[20px]" >
206
- { isEmailCelebration && (
207
- < div className = "absolute w-[100%] flex justify-center items-center" >
208
- < img alt = "celeb" width = { 300 } height = { 250 } src = { celebration } />
209
- </ div >
210
- ) }
211
- < p className = "font-medium text-[15px] mb-[5px] text-base-content align-baseline" >
212
- Recipients added here will get a copy of the signed document.
213
- </ p >
214
- { emailList . length > 0 ? (
215
- < >
216
- < div className = "addEmail" >
217
- < div className = "flex flex-row flex-wrap" >
218
- { emailList . map ( ( data , ind ) => {
219
- return (
220
- < div
221
- className = "flex flex-row items-center bg-[#47a3ad] m-[4px] rounded-md py-[5px] px-[10px]"
222
- key = { ind }
223
- >
224
- < span className = "text-white text-[13px]" >
225
- { data }
226
- </ span >
227
- < span
228
- className = "text-white text-[13px] font-semibold ml-[7px] cursor-pointer"
229
- onClick = { ( ) => removeChip ( ind ) }
230
- >
231
- < i className = "fa-solid fa-xmark" > </ i >
232
- </ span >
233
- </ div >
234
- ) ;
235
- } ) }
236
- </ div >
237
- { emailList . length <= 9 && (
238
- < input
239
- type = "text"
240
- value = { emailValue }
241
- className = "p-[10px] pb-[20px] rounded w-full text-[15px] bg-white outline-none"
242
- onChange = { handleEmailValue }
243
- onKeyDown = { handleEnterPress }
244
- onBlur = { ( ) => {
245
- if ( emailValue ) {
246
- handleEnterPress ( "add" ) ;
247
- }
248
- } }
249
- required
250
- />
251
- ) }
252
- </ div >
253
- </ >
254
- ) : (
255
- < div >
256
- < input
257
- type = "text"
258
- value = { emailValue }
259
- className = "p-[10px] pb-[20px] rounded w-full text-[15px] outline-none bg-white border-2 border-[#47a3ad]"
260
- onChange = { handleEmailValue }
261
- onKeyDown = { handleEnterPress }
262
- placeholder = "Add the email addresses"
263
- onBlur = { ( ) => {
264
- if ( emailValue ) {
265
- handleEnterPress ( "add" ) ;
266
- }
267
- } }
268
- required
269
- />
270
- </ div >
271
197
) }
272
198
< button
273
- className = { `${
274
- emailValue ? "cursor-pointer" : "cursor-default"
275
- } op-btn op-btn-primary op-btn-sm m-2 shadow-md`}
276
- onClick = { ( ) => {
277
- if ( emailValue ) {
278
- handleEnterPress ( "add" ) ;
279
- }
280
- } }
199
+ className = "op-btn op-btn-primary op-btn-sm text-[15px] ml-2"
200
+ onClick = { ( ) => handleDownloadPdf ( ) }
281
201
>
282
- < i className = "fa fa-plus" aria-hidden = "true" > </ i >
202
+ < i className = "fa fa-download" aria-hidden = "true" > </ i >
203
+ Download
283
204
</ button >
284
-
285
- < div className = "bg-[#e3e2e1] mt-[10px] p-[5px] rounded" >
286
- < span className = "font-bold" > Note: </ span >
287
- < span className = "text-[15px]" >
288
- You can only send to ten recipients at a time.
289
- </ span >
205
+ </ div >
206
+ </ div >
207
+ < div className = "h-full p-[20px]" >
208
+ { isEmailCelebration && (
209
+ < div className = "absolute w-[100%] flex justify-center items-center" >
210
+ < img alt = "celeb" width = { 300 } height = { 250 } src = { celebration } / >
290
211
</ div >
291
- < div className = "h-[1px] w-full my-[15px] bg-[#9f9f9f]" > </ div >
292
- < button
293
- type = "button"
294
- className = "op-btn op-btn-primary"
295
- onClick = { ( ) => emailList . length > 0 && sendEmail ( ) }
296
- >
297
- Send
298
- </ button >
299
- < button
300
- type = "button"
301
- className = "op-btn op-btn-ghost ml-2"
302
- onClick = { ( ) => {
303
- setIsEmail ( false ) ;
304
- setEmailValue ( "" ) ;
305
- setEmailList ( [ ] ) ;
306
- } }
307
- >
308
- Close
309
- </ button >
212
+ ) }
213
+ < p className = "font-medium text-[15px] mb-[5px] text-base-content align-baseline" >
214
+ Recipients added here will get a copy of the signed document.
215
+ </ p >
216
+ { emailList . length > 0 ? (
217
+ < >
218
+ < div className = "p-0 border-[1.5px] op-border-primary rounded w-full text-[15px]" >
219
+ < div className = "flex flex-row flex-wrap" >
220
+ { emailList . map ( ( data , ind ) => {
221
+ return (
222
+ < div
223
+ className = "flex flex-row items-center op-bg-primary m-[4px] rounded-md py-[5px] px-[10px]"
224
+ key = { ind }
225
+ >
226
+ < span className = "text-base-100 text-[13px]" >
227
+ { data }
228
+ </ span >
229
+ < span
230
+ className = "text-base-100 text-[13px] font-semibold ml-[7px] cursor-pointer"
231
+ onClick = { ( ) => removeChip ( ind ) }
232
+ >
233
+ < i className = "fa-solid fa-xmark" > </ i >
234
+ </ span >
235
+ </ div >
236
+ ) ;
237
+ } ) }
238
+ </ div >
239
+ { emailList . length <= 9 && (
240
+ < input
241
+ type = "text"
242
+ value = { emailValue }
243
+ className = "p-[10px] pb-[20px] rounded w-full text-[15px] bg-transparent outline-none"
244
+ onChange = { handleEmailValue }
245
+ onKeyDown = { handleEnterPress }
246
+ onBlur = { ( ) => {
247
+ if ( emailValue ) {
248
+ handleEnterPress ( "add" ) ;
249
+ }
250
+ } }
251
+ required
252
+ />
253
+ ) }
254
+ </ div >
255
+ </ >
256
+ ) : (
257
+ < div >
258
+ < input
259
+ type = "text"
260
+ value = { emailValue }
261
+ className = "p-[10px] pb-[20px] rounded w-full text-[15px] outline-none bg-transparent border-[1.5px] op-border-primary"
262
+ onChange = { handleEmailValue }
263
+ onKeyDown = { handleEnterPress }
264
+ placeholder = "Add the email addresses"
265
+ onBlur = { ( ) => {
266
+ if ( emailValue ) {
267
+ handleEnterPress ( "add" ) ;
268
+ }
269
+ } }
270
+ required
271
+ />
272
+ </ div >
273
+ ) }
274
+ < button
275
+ className = { `${
276
+ emailValue ? "cursor-pointer" : "cursor-default"
277
+ } op-btn op-btn-primary op-btn-sm m-2 shadow-md`}
278
+ onClick = { ( ) => {
279
+ if ( emailValue ) {
280
+ handleEnterPress ( "add" ) ;
281
+ }
282
+ } }
283
+ >
284
+ < i className = "fa fa-plus" aria-hidden = "true" > </ i >
285
+ </ button >
286
+
287
+ < div className = "bg-[#e3e2e1] mt-[10px] p-[5px] rounded" >
288
+ < span className = "font-bold" > Note: </ span >
289
+ < span className = "text-[15px]" >
290
+ You can only send to ten recipients at a time.
291
+ </ span >
310
292
</ div >
293
+ < hr className = "w-full my-[15px] bg-base-content" />
294
+ < button
295
+ type = "button"
296
+ className = "op-btn op-btn-primary"
297
+ onClick = { ( ) => emailList . length > 0 && sendEmail ( ) }
298
+ >
299
+ Send
300
+ </ button >
301
+ < button
302
+ type = "button"
303
+ className = "op-btn op-btn-ghost ml-2"
304
+ onClick = { ( ) => {
305
+ setIsEmail ( false ) ;
306
+ setEmailValue ( "" ) ;
307
+ setEmailList ( [ ] ) ;
308
+ } }
309
+ >
310
+ Close
311
+ </ button >
311
312
</ div >
312
- </ div >
313
+ </ ModalUi >
313
314
) }
314
315
</ div >
315
316
) ;
0 commit comments