@@ -27,15 +27,10 @@ const AddUser = (props) => {
27
27
password : "" ,
28
28
role : ""
29
29
} ) ;
30
- const [ amount , setAmount ] = useState ( {
31
- quantity : 1 ,
32
- price : 0 ,
33
- totalPrice : 0
34
- } ) ;
30
+ const [ amount , setAmount ] = useState ( { quantity : 1 , price : 0 } ) ;
35
31
const [ planInfo , setPlanInfo ] = useState ( {
36
32
priceperUser : 0 ,
37
33
price : 0 ,
38
- totalPrice : 0 ,
39
34
totalAllowedUser : 0
40
35
} ) ;
41
36
const [ isFormLoader , setIsFormLoader ] = useState ( false ) ;
@@ -59,14 +54,9 @@ const AddUser = (props) => {
59
54
setPlanInfo ( ( prev ) => ( {
60
55
...prev ,
61
56
priceperUser : resSub . price ,
62
- totalPrice : resSub . totalPrice ,
63
57
totalAllowedUser : resSub . totalAllowedUser
64
58
} ) ) ;
65
- setAmount ( ( prev ) => ( {
66
- ...prev ,
67
- price : resSub . price ,
68
- totalPrice : resSub . price + resSub . totalPrice
69
- } ) ) ;
59
+ setAmount ( ( prev ) => ( { ...prev , price : resSub . price } ) ) ;
70
60
const res = await Parse . Cloud . run ( "allowedusers" ) ;
71
61
if ( props . setFormHeader ) {
72
62
if ( res > 0 ) {
@@ -287,13 +277,7 @@ const AddUser = (props) => {
287
277
const handlePricePerUser = ( e ) => {
288
278
const quantity = e . target . value ;
289
279
const price = e . target ?. value > 0 ? planInfo . priceperUser * quantity : 0 ;
290
- const totalprice = price + planInfo . totalPrice ;
291
- setAmount ( ( prev ) => ( {
292
- ...prev ,
293
- quantity : quantity ,
294
- price : price ,
295
- totalPrice : totalprice
296
- } ) ) ;
280
+ setAmount ( ( prev ) => ( { ...prev , quantity : quantity , price : price } ) ) ;
297
281
} ;
298
282
const handleAddOnSubmit = async ( e ) => {
299
283
e . preventDefault ( ) ;
@@ -529,15 +513,7 @@ const AddUser = (props) => {
529
513
</ div >
530
514
</ div >
531
515
< hr className = "text-base-content mb-3" />
532
- < div className = " flex justify-between" >
533
- < label className = "block text-sm text-gray-700 font-semibold" >
534
- { t ( "Total-price-for-next-time" ) }
535
- </ label >
536
- < div className = "w-1/4 flex justify-center items-center text-sm font-semibold" >
537
- USD { amount . totalPrice }
538
- </ div >
539
- </ div >
540
- < button className = "op-btn op-btn-primary w-full mt-2" >
516
+ < button className = "op-btn op-btn-primary w-full" >
541
517
{ t ( "Proceed" ) }
542
518
</ button >
543
519
</ form >
0 commit comments