@traund/orquezta-widget-calculator 1.0.4 → 1.1.0
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/dist/index.js +1176 -978
- package/dist/index.js.map +1 -1
- package/dist/module.js +1098 -900
- package/dist/module.js.map +1 -1
- package/package.json +36 -31
- package/src/calculatorV2.js +824 -824
- package/src/components/disclaimers.jsx +29 -30
- package/src/components/fees.jsx +80 -79
- package/src/components/inputAmount.js +48 -39
- package/src/components/paymentMethodSelector.jsx +4 -4
- package/src/components/simulatorStyles.js +5 -2
- package/src/components/taxFeeAlert.js +3 -5
- package/src/core/signature.js +1 -2
- package/src/firebase.config.js +1 -1
- package/src/index.js +38 -11
- package/src/model/enums.js +0 -1
- package/src/simulator.js +49 -35
- package/src/theme.js +99 -0
- package/src/utils/operationsHelper.js +4 -3
package/src/calculatorV2.js
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import React, { Component, Fragment } from "react";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
import {
|
|
3
|
+
Paper,
|
|
4
|
+
Typography,
|
|
5
|
+
InputBase,
|
|
6
|
+
InputAdornment,
|
|
7
|
+
TextField,
|
|
8
|
+
Select,
|
|
9
|
+
MenuItem,
|
|
10
|
+
FormControl,
|
|
11
|
+
FormHelperText,
|
|
12
|
+
Button,
|
|
13
|
+
Divider,
|
|
14
|
+
CircularProgress,
|
|
15
|
+
Tooltip,
|
|
16
|
+
Autocomplete,
|
|
17
|
+
Box
|
|
18
|
+
} from '@mui/material';
|
|
19
|
+
import Grid from '@mui/material/Grid2';
|
|
20
|
+
import { HighlightOffOutlined as HighlightOffOutlinedIcon } from '@mui/icons-material';
|
|
16
21
|
import { matchSorter } from "match-sorter";
|
|
17
22
|
import en from "./locale/en";
|
|
18
23
|
import es from "./locale/es";
|
|
@@ -80,6 +85,7 @@ class Calculator extends Component {
|
|
|
80
85
|
isCountryFromPayPal: false,
|
|
81
86
|
onlySimulation: this.props.onlySimulation,
|
|
82
87
|
reference:this.props.reference,
|
|
88
|
+
secretKey: this.props.secretKey,
|
|
83
89
|
taxSender: 0.00,
|
|
84
90
|
taxReceiver: 0.00
|
|
85
91
|
};
|
|
@@ -93,8 +99,7 @@ class Calculator extends Component {
|
|
|
93
99
|
|
|
94
100
|
async componentDidMount() {
|
|
95
101
|
//if (db) db.clearPersistence();
|
|
96
|
-
|
|
97
|
-
|
|
102
|
+
const firebase = await loadFirebaseDB(this.state.testMode, this.state.config);
|
|
98
103
|
const db = firebase.firestore();
|
|
99
104
|
|
|
100
105
|
this.subscribeCalculatorConfig(db);
|
|
@@ -362,10 +367,12 @@ class Calculator extends Component {
|
|
|
362
367
|
rates[c] = { buy: 0, sell: 0 };
|
|
363
368
|
}
|
|
364
369
|
|
|
365
|
-
if (usdRate
|
|
370
|
+
if (usdRate && typeof usdRate.result === "number") {
|
|
366
371
|
rates[c].buy = rates[c].sell = parseFloat(
|
|
367
372
|
c == "SV" ? usdRate.result : usdRate.result.toFixed(2)
|
|
368
373
|
);
|
|
374
|
+
} else {
|
|
375
|
+
rates[c].buy = rates[c].sell = 1;
|
|
369
376
|
}
|
|
370
377
|
if (body[country].countryTo[c]) {
|
|
371
378
|
body[country].countryTo[c].usdBuy = rates[c].buy;
|
|
@@ -425,8 +432,10 @@ class Calculator extends Component {
|
|
|
425
432
|
sessionStorage.removeItem("storeId");
|
|
426
433
|
|
|
427
434
|
//if (db) db.clearPersistence();
|
|
428
|
-
|
|
435
|
+
//const { db } = await loadFirebaseDB(this.state.testMode, this.state.config);
|
|
436
|
+
const firebase = await loadFirebaseDB(this.state.testMode, this.state.config);
|
|
429
437
|
const db = firebase.firestore();
|
|
438
|
+
|
|
430
439
|
return await db
|
|
431
440
|
.collection("transactions")
|
|
432
441
|
.doc(`${this.state.storeId}`)
|
|
@@ -695,6 +704,7 @@ class Calculator extends Component {
|
|
|
695
704
|
couponValue: this.state.couponValue,
|
|
696
705
|
couponRedeemed: false,
|
|
697
706
|
reference: this.state.reference ,
|
|
707
|
+
secretKey: this.state.secretKey,
|
|
698
708
|
plus: 0
|
|
699
709
|
});
|
|
700
710
|
if (this.state.recalc) {
|
|
@@ -727,7 +737,7 @@ class Calculator extends Component {
|
|
|
727
737
|
model,
|
|
728
738
|
{
|
|
729
739
|
headers: {
|
|
730
|
-
"x-api-access-sig": getSignatureHeader('POST', url, model,this.state.reference)
|
|
740
|
+
"x-api-access-sig": getSignatureHeader('POST', url, model,this.state.reference,this.state.secretKey)
|
|
731
741
|
},
|
|
732
742
|
}
|
|
733
743
|
);
|
|
@@ -786,7 +796,7 @@ class Calculator extends Component {
|
|
|
786
796
|
model,
|
|
787
797
|
{
|
|
788
798
|
headers: {
|
|
789
|
-
"x-api-access-sig": getSignatureHeader('POST', url, model,this.state.reference)
|
|
799
|
+
"x-api-access-sig": getSignatureHeader('POST', url, model,this.state.reference,this.state.secretKey)
|
|
790
800
|
},
|
|
791
801
|
}
|
|
792
802
|
);
|
|
@@ -982,9 +992,9 @@ class Calculator extends Component {
|
|
|
982
992
|
}
|
|
983
993
|
|
|
984
994
|
//if (db) db.clearPersistence();
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
995
|
+
const firebase = await loadFirebaseDB(this.state.testMode, this.state.config);
|
|
996
|
+
const db = firebase.firestore();
|
|
997
|
+
|
|
988
998
|
if (this.state.couponRedeemed && this.state.couponValue != "") {
|
|
989
999
|
try {
|
|
990
1000
|
const userFS = await db
|
|
@@ -1067,7 +1077,7 @@ class Calculator extends Component {
|
|
|
1067
1077
|
url,
|
|
1068
1078
|
{
|
|
1069
1079
|
headers: {
|
|
1070
|
-
"x-api-access-sig": getSignatureHeader('GET', url, null,this.state.reference)
|
|
1080
|
+
"x-api-access-sig": getSignatureHeader('GET', url, null,this.state.reference,this.state.secretKey)
|
|
1071
1081
|
},
|
|
1072
1082
|
}
|
|
1073
1083
|
);
|
|
@@ -1352,806 +1362,796 @@ class Calculator extends Component {
|
|
|
1352
1362
|
}
|
|
1353
1363
|
|
|
1354
1364
|
return (
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
variant="subtitle1"
|
|
2146
|
-
|
|
2147
|
-
>
|
|
2148
|
-
<span style={{fontSize: "10px", textAlign: "center" }} >Powered by </span>
|
|
2149
|
-
<span style={{ fontWeight: "bold", textAlign: "center",fontSize: "12px", }}>Orquezta</span>
|
|
2150
|
-
</Typography>
|
|
2151
|
-
</Grid>
|
|
2152
|
-
</Grid>
|
|
2153
|
-
</Paper >
|
|
2154
|
-
</Fragment >
|
|
1365
|
+
<Fragment>
|
|
1366
|
+
<link
|
|
1367
|
+
href="https://fonts.googleapis.com/css2?family=Poppins:wght@500&display=swap"
|
|
1368
|
+
rel="stylesheet"
|
|
1369
|
+
/>
|
|
1370
|
+
<link
|
|
1371
|
+
href="https://fonts.googleapis.com/css2?family=Poppins:wght@400&display=swap"
|
|
1372
|
+
rel="stylesheet"
|
|
1373
|
+
/>
|
|
1374
|
+
<Paper sx={classes.root}>
|
|
1375
|
+
<Grid container direction="column" spacing={0}>
|
|
1376
|
+
<Grid container direction="column" spacing={0}>
|
|
1377
|
+
<Grid>
|
|
1378
|
+
<Typography
|
|
1379
|
+
sx={classes.labelAmount}
|
|
1380
|
+
gutterBottom
|
|
1381
|
+
variant="subtitle1"
|
|
1382
|
+
component="div"
|
|
1383
|
+
>
|
|
1384
|
+
{content.landing.send_content}
|
|
1385
|
+
</Typography>
|
|
1386
|
+
</Grid>
|
|
1387
|
+
<Grid size={{ xs: 12}} container>
|
|
1388
|
+
<Grid size={{ xs: 8, md:9}}
|
|
1389
|
+
>
|
|
1390
|
+
<Paper sx={classes.inputAmount}>
|
|
1391
|
+
<InputBase
|
|
1392
|
+
id="send"
|
|
1393
|
+
sx={classes.inputAmountText}
|
|
1394
|
+
required
|
|
1395
|
+
value={sendValue}
|
|
1396
|
+
type="number"
|
|
1397
|
+
disabled={loadingFrom || loadingTo}
|
|
1398
|
+
startAdornment={
|
|
1399
|
+
<InputAdornment
|
|
1400
|
+
position="start"
|
|
1401
|
+
sx={{ marginTop: "0px" }}
|
|
1402
|
+
>
|
|
1403
|
+
<span>{loadingFrom && <CircularProgress size={18} />}</span>
|
|
1404
|
+
</InputAdornment>
|
|
1405
|
+
}
|
|
1406
|
+
slotProps={{
|
|
1407
|
+
input: { min: minFromValue, max: maxFromValue }
|
|
1408
|
+
}}
|
|
1409
|
+
onChange={this.handleSend}
|
|
1410
|
+
/>
|
|
1411
|
+
</Paper>
|
|
1412
|
+
</Grid>
|
|
1413
|
+
<Grid size={{ xs: 4, md:3}}
|
|
1414
|
+
>
|
|
1415
|
+
<Autocomplete
|
|
1416
|
+
disabled={loadingTo || loadingFrom}
|
|
1417
|
+
options={countries.filter((country) => {
|
|
1418
|
+
if (
|
|
1419
|
+
calculator &&
|
|
1420
|
+
calculator[country.code] &&
|
|
1421
|
+
calculator[country.code].active
|
|
1422
|
+
)
|
|
1423
|
+
return country;
|
|
1424
|
+
})}
|
|
1425
|
+
sx={{
|
|
1426
|
+
fontSize: 14,
|
|
1427
|
+
"& > span": {
|
|
1428
|
+
marginRight: 10,
|
|
1429
|
+
fontSize: 18,
|
|
1430
|
+
},
|
|
1431
|
+
}}
|
|
1432
|
+
value={
|
|
1433
|
+
countries.filter(
|
|
1434
|
+
(country) => country.code == fromCountryValue
|
|
1435
|
+
)[0]
|
|
1436
|
+
}
|
|
1437
|
+
autoHighlight
|
|
1438
|
+
getOptionLabel={(option) => `${option.currency}`}
|
|
1439
|
+
renderOption={(props, option) => (
|
|
1440
|
+
<Box component="li" {...props}>
|
|
1441
|
+
<span style={{ marginRight: "5px" }}>
|
|
1442
|
+
<FlagsHelpers code={option.code == "PE-USD" ? "PE" : option.code} />
|
|
1443
|
+
</span>
|
|
1444
|
+
{option.currency}
|
|
1445
|
+
</Box>
|
|
1446
|
+
)}
|
|
1447
|
+
disableClearable
|
|
1448
|
+
renderInput={(params) => (
|
|
1449
|
+
<Paper variant="outlined" sx={classes.rootFlags}>
|
|
1450
|
+
<TextField
|
|
1451
|
+
sx={{ fontSize: "15px" }}
|
|
1452
|
+
{...params}
|
|
1453
|
+
variant="standard"
|
|
1454
|
+
slotProps={{
|
|
1455
|
+
input: {
|
|
1456
|
+
...params.InputProps,
|
|
1457
|
+
startAdornment: (
|
|
1458
|
+
<FlagsHelpers
|
|
1459
|
+
code={this.state.fromCountryValue == "PE-USD" ?
|
|
1460
|
+
"PE" :
|
|
1461
|
+
this.state.fromCountryValue
|
|
1462
|
+
}>
|
|
1463
|
+
</FlagsHelpers>
|
|
1464
|
+
),
|
|
1465
|
+
disableUnderline: true,
|
|
1466
|
+
}
|
|
1467
|
+
}}
|
|
1468
|
+
/>
|
|
1469
|
+
</Paper>
|
|
1470
|
+
)}
|
|
1471
|
+
onChange={this.handleOnChangeFromCountry}
|
|
1472
|
+
/>
|
|
1473
|
+
</Grid>
|
|
1474
|
+
</Grid>
|
|
1475
|
+
<Grid size={{ xs: 12}} container>
|
|
1476
|
+
{!isLoading && !loadingFrom && !loadingTo && (
|
|
1477
|
+
<FormHelperText sx={{ color: "red" }}>
|
|
1478
|
+
{(sendValue < minFromValue &&
|
|
1479
|
+
content.landing.min_value.replace(
|
|
1480
|
+
"minValue",
|
|
1481
|
+
minFromValue
|
|
1482
|
+
)) ||
|
|
1483
|
+
(sendValue > maxFromValue &&
|
|
1484
|
+
content.landing.max_value.replace(
|
|
1485
|
+
"maxValue",
|
|
1486
|
+
maxFromValue
|
|
1487
|
+
))}
|
|
1488
|
+
</FormHelperText>
|
|
1489
|
+
)}
|
|
1490
|
+
</Grid>
|
|
1491
|
+
</Grid>
|
|
1492
|
+
{(!isLoading && !loadingFrom && !loadingTo) &&
|
|
1493
|
+
<Grid size={{ xs: 12}} container direction="column">
|
|
1494
|
+
<Grid size={{ xs: 12}} container spacing={1}>
|
|
1495
|
+
<Grid size={{ xs: 1}}>
|
|
1496
|
+
<Typography variant="body2" color="textSecondary"></Typography>
|
|
1497
|
+
</Grid>
|
|
1498
|
+
<Grid size={{ xs: 3, md: 4 }} >
|
|
1499
|
+
<Typography
|
|
1500
|
+
variant="body2"
|
|
1501
|
+
color="textSecondary"
|
|
1502
|
+
sx={{ textAlign: "right" }}
|
|
1503
|
+
>
|
|
1504
|
+
{traundFee}
|
|
1505
|
+
</Typography>
|
|
1506
|
+
</Grid>
|
|
1507
|
+
<Grid size={{ xs: 1}}>
|
|
1508
|
+
<Typography variant="body2" color="textSecondary">
|
|
1509
|
+
{fromCurrencyValue}
|
|
1510
|
+
</Typography>
|
|
1511
|
+
</Grid>
|
|
1512
|
+
<Grid size={{ xs: 1}}>
|
|
1513
|
+
<Typography variant="body2" color="textSecondary">{" "}</Typography>
|
|
1514
|
+
</Grid>
|
|
1515
|
+
<Grid size="grow">
|
|
1516
|
+
<Typography
|
|
1517
|
+
variant="body2"
|
|
1518
|
+
color="textSecondary"
|
|
1519
|
+
sx={{ fontWeight: "bold", textAlign: "left", marginLeft: "10px" }}
|
|
1520
|
+
>
|
|
1521
|
+
{content.calculator.comision}
|
|
1522
|
+
</Typography>
|
|
1523
|
+
</Grid>
|
|
1524
|
+
</Grid>
|
|
1525
|
+
{this.state.isCountryFromPayPal &&
|
|
1526
|
+
<Grid size={{ xs: 12}} container spacing={1}>
|
|
1527
|
+
<Grid size={{ xs: 1}}>
|
|
1528
|
+
<Typography variant="body2" color="textSecondary"></Typography>
|
|
1529
|
+
</Grid>
|
|
1530
|
+
<Grid size={{ xs: 3, md: 4 }} >
|
|
1531
|
+
<Typography
|
|
1532
|
+
variant="body2"
|
|
1533
|
+
color="textSecondary"
|
|
1534
|
+
sx={{ textAlign: "right" }}
|
|
1535
|
+
>
|
|
1536
|
+
{paypalFee}
|
|
1537
|
+
</Typography>
|
|
1538
|
+
</Grid>
|
|
1539
|
+
<Grid size={{ xs: 1}}>
|
|
1540
|
+
<Typography variant="body2" color="textSecondary">
|
|
1541
|
+
{fromCurrencyValue}
|
|
1542
|
+
</Typography>
|
|
1543
|
+
</Grid>
|
|
1544
|
+
<Grid size={{ xs: 1}}>
|
|
1545
|
+
<Typography variant="body2" color="textSecondary">{" "}</Typography>
|
|
1546
|
+
</Grid>
|
|
1547
|
+
<Grid size="grow">
|
|
1548
|
+
<Typography
|
|
1549
|
+
variant="body2"
|
|
1550
|
+
color="textSecondary"
|
|
1551
|
+
sx={{ fontWeight: "bold", textAlign: "left", marginLeft: "10px" }}
|
|
1552
|
+
>
|
|
1553
|
+
{content.calculator.paypal_fee}
|
|
1554
|
+
</Typography>
|
|
1555
|
+
</Grid>
|
|
1556
|
+
</Grid>
|
|
1557
|
+
}
|
|
1558
|
+
{this.state.isUsdt &&
|
|
1559
|
+
<Grid size={{ xs: 12}} container spacing={1}>
|
|
1560
|
+
<Grid size={{ xs: 1}}>
|
|
1561
|
+
<Typography variant="body2" color="textSecondary"></Typography>
|
|
1562
|
+
</Grid>
|
|
1563
|
+
<Grid size={{ xs: 3, md: 4 }}>
|
|
1564
|
+
<Typography
|
|
1565
|
+
variant="body2"
|
|
1566
|
+
color="textSecondary"
|
|
1567
|
+
sx={{ textAlign: "right" }}
|
|
1568
|
+
>
|
|
1569
|
+
{networkFee}
|
|
1570
|
+
</Typography>
|
|
1571
|
+
</Grid>
|
|
1572
|
+
<Grid size={{ xs: 1}}>
|
|
1573
|
+
<Typography variant="body2" color="textSecondary">
|
|
1574
|
+
{fromCurrencyValue}
|
|
1575
|
+
</Typography>
|
|
1576
|
+
</Grid>
|
|
1577
|
+
<Grid size={{ xs: 1}}>
|
|
1578
|
+
<Typography variant="body2" color="textSecondary">{" "}</Typography>
|
|
1579
|
+
</Grid>
|
|
1580
|
+
<Grid size="grow">
|
|
1581
|
+
<Typography
|
|
1582
|
+
variant="body2"
|
|
1583
|
+
color="textSecondary"
|
|
1584
|
+
sx={{ fontWeight: "bold", textAlign: "left", marginLeft: "10px" }}
|
|
1585
|
+
>
|
|
1586
|
+
{content.calculator.tron_network_fee}
|
|
1587
|
+
</Typography>
|
|
1588
|
+
</Grid>
|
|
1589
|
+
</Grid>
|
|
1590
|
+
}
|
|
1591
|
+
<Grid size={{ xs: 10}}>
|
|
1592
|
+
<Divider sx={{ margin: 4 }}></Divider>
|
|
1593
|
+
</Grid>
|
|
1594
|
+
{taxSender > 0 &&
|
|
1595
|
+
<>
|
|
1596
|
+
<Grid size={{ xs: 12}} container spacing={1}>
|
|
1597
|
+
<Grid size={{ xs: 1}}>
|
|
1598
|
+
<Typography
|
|
1599
|
+
variant="subtitle2"
|
|
1600
|
+
color="textPrimary"
|
|
1601
|
+
sx={{ fontWeight: "bold", textAlign: "right" }}
|
|
1602
|
+
>
|
|
1603
|
+
-
|
|
1604
|
+
</Typography>
|
|
1605
|
+
</Grid>
|
|
1606
|
+
<Grid size={{ xs: 3, md: 4 }}>
|
|
1607
|
+
<Typography
|
|
1608
|
+
variant="subtitle2"
|
|
1609
|
+
color="textPrimary"
|
|
1610
|
+
sx={{ fontWeight: "bold", textAlign: "right" }}
|
|
1611
|
+
>
|
|
1612
|
+
{taxSender}
|
|
1613
|
+
</Typography>
|
|
1614
|
+
</Grid>
|
|
1615
|
+
<Grid size={{ xs: 1}}>
|
|
1616
|
+
<Typography
|
|
1617
|
+
variant="subtitle2"
|
|
1618
|
+
color="textPrimary"
|
|
1619
|
+
sx={{ fontWeight: "bold" }}
|
|
1620
|
+
>
|
|
1621
|
+
{fromCurrencyValue}
|
|
1622
|
+
</Typography>
|
|
1623
|
+
</Grid>
|
|
1624
|
+
<Grid size={{ xs: 1}}>
|
|
1625
|
+
<Typography variant="subtitle2" color="textPrimary">{" "}</Typography>
|
|
1626
|
+
</Grid>
|
|
1627
|
+
<Grid size="grow">
|
|
1628
|
+
<Typography
|
|
1629
|
+
variant="subtitle2"
|
|
1630
|
+
color="textPrimary"
|
|
1631
|
+
sx={{ fontWeight: "bold", textAlign: "left", marginLeft: "10px" }}
|
|
1632
|
+
>
|
|
1633
|
+
{fromCurrencyValue == "COP" ? content?.calculator.tax_co : content?.calculator.tax_pe}
|
|
1634
|
+
</Typography>
|
|
1635
|
+
</Grid>
|
|
1636
|
+
</Grid>
|
|
1637
|
+
<Grid size={{ xs: 12}} container spacing={1}>
|
|
1638
|
+
<Grid size={{ xs: 1}}>
|
|
1639
|
+
<Typography
|
|
1640
|
+
variant="subtitle2"
|
|
1641
|
+
color="textPrimary"
|
|
1642
|
+
sx={{ fontWeight: "bold", textAlign: "right" }}
|
|
1643
|
+
>
|
|
1644
|
+
=
|
|
1645
|
+
</Typography>
|
|
1646
|
+
</Grid>
|
|
1647
|
+
<Grid size={{ xs: 3, md: 4 }}>
|
|
1648
|
+
<Typography
|
|
1649
|
+
variant="subtitle2"
|
|
1650
|
+
color="textPrimary"
|
|
1651
|
+
sx={{ fontWeight: "bold", textAlign: "right" }}
|
|
1652
|
+
>
|
|
1653
|
+
{this.state.isUsdt ? convertValueCrypto : (+convertValue).toFixed(2)}
|
|
1654
|
+
</Typography>
|
|
1655
|
+
</Grid>
|
|
1656
|
+
<Grid size={{ xs: 1}}>
|
|
1657
|
+
<Typography
|
|
1658
|
+
variant="subtitle2"
|
|
1659
|
+
color="textPrimary"
|
|
1660
|
+
sx={{ fontWeight: "bold" }}
|
|
1661
|
+
>
|
|
1662
|
+
{this.state.isUsdt ? 'USD' : fromCurrencyValue}
|
|
1663
|
+
</Typography>
|
|
1664
|
+
</Grid>
|
|
1665
|
+
<Grid size="grow">
|
|
1666
|
+
<Typography variant="subtitle2" color="textPrimary" sx={{ fontWeight: "bold", textAlign: "left", marginLeft: "10px" }}>{content.calculator.receiver}</Typography>
|
|
1667
|
+
</Grid>
|
|
1668
|
+
<Grid size="grow">
|
|
1669
|
+
<Typography
|
|
1670
|
+
variant="subtitle2"
|
|
1671
|
+
color="textPrimary"
|
|
1672
|
+
sx={{ fontWeight: "bold", textAlign: "left", marginLeft: "10px" }}
|
|
1673
|
+
>
|
|
1674
|
+
{content.calculator.we_receive}
|
|
1675
|
+
</Typography>
|
|
1676
|
+
</Grid>
|
|
1677
|
+
</Grid>
|
|
1678
|
+
</>
|
|
1679
|
+
}
|
|
1680
|
+
{this.state.showTotalFees &&
|
|
1681
|
+
<Grid size={{ xs: 12}} container spacing={1}>
|
|
1682
|
+
<Grid size={{ xs: 1}}>
|
|
1683
|
+
<Typography
|
|
1684
|
+
variant="subtitle2"
|
|
1685
|
+
color="textPrimary"
|
|
1686
|
+
sx={{ fontWeight: "bold", textAlign: "right" }}
|
|
1687
|
+
>
|
|
1688
|
+
-
|
|
1689
|
+
</Typography>
|
|
1690
|
+
</Grid>
|
|
1691
|
+
<Grid size={{ xs: 3, md: 4 }}>
|
|
1692
|
+
<Typography
|
|
1693
|
+
variant="subtitle2"
|
|
1694
|
+
color="textPrimary"
|
|
1695
|
+
sx={{ fontWeight: "bold", textAlign: "right" }}
|
|
1696
|
+
>
|
|
1697
|
+
{totalFees}
|
|
1698
|
+
</Typography>
|
|
1699
|
+
</Grid>
|
|
1700
|
+
<Grid size={{ xs: 1}}>
|
|
1701
|
+
<Typography
|
|
1702
|
+
variant="subtitle2"
|
|
1703
|
+
color="textPrimary"
|
|
1704
|
+
sx={{ fontWeight: "bold" }}
|
|
1705
|
+
>
|
|
1706
|
+
{fromCurrencyValue}
|
|
1707
|
+
</Typography>
|
|
1708
|
+
</Grid>
|
|
1709
|
+
<Grid size={{ xs: 1}}>
|
|
1710
|
+
<Typography variant="body2" color="textSecondary">{" "}</Typography>
|
|
1711
|
+
</Grid>
|
|
1712
|
+
<Grid size="grow">
|
|
1713
|
+
<Typography
|
|
1714
|
+
variant="subtitle2"
|
|
1715
|
+
color="textPrimary"
|
|
1716
|
+
sx={{ fontWeight: "bold", textAlign: "left", marginLeft: "10px" }}
|
|
1717
|
+
>
|
|
1718
|
+
{content.calculator.total_fees}
|
|
1719
|
+
</Typography>
|
|
1720
|
+
</Grid>
|
|
1721
|
+
</Grid>
|
|
1722
|
+
}
|
|
1723
|
+
<Grid size={{ xs: 12}} container spacing={1}>
|
|
1724
|
+
<Grid size={{ xs: 1}}>
|
|
1725
|
+
<Typography
|
|
1726
|
+
variant="subtitle2"
|
|
1727
|
+
color="textPrimary"
|
|
1728
|
+
sx={{ fontWeight: "bold", textAlign: "right" }}
|
|
1729
|
+
>
|
|
1730
|
+
{this.state.exchangeRateLabel}
|
|
1731
|
+
</Typography>
|
|
1732
|
+
</Grid>
|
|
1733
|
+
<Grid size={{ xs: 3, md: 4 }} >
|
|
1734
|
+
<Typography
|
|
1735
|
+
variant="subtitle2"
|
|
1736
|
+
color="textPrimary"
|
|
1737
|
+
sx={{ fontWeight: "bold", textAlign: "right" }}
|
|
1738
|
+
>
|
|
1739
|
+
{exchangeRate}
|
|
1740
|
+
</Typography>
|
|
1741
|
+
</Grid>
|
|
1742
|
+
<Grid size={{ xs: 1}}>
|
|
1743
|
+
<Typography
|
|
1744
|
+
variant="subtitle2"
|
|
1745
|
+
color="textPrimary"
|
|
1746
|
+
sx={{ fontWeight: "bold" }}
|
|
1747
|
+
>
|
|
1748
|
+
{this.state.isUsdt ? 'USDT' : toCurrencyValue}
|
|
1749
|
+
</Typography>
|
|
1750
|
+
</Grid>
|
|
1751
|
+
<Grid size={{ xs: 1}}>
|
|
1752
|
+
<Typography variant="body2" color="textSecondary">{" "}</Typography>
|
|
1753
|
+
</Grid>
|
|
1754
|
+
<Grid size="grow">
|
|
1755
|
+
<Typography
|
|
1756
|
+
variant="subtitle2"
|
|
1757
|
+
color="textPrimary"
|
|
1758
|
+
sx={{ fontWeight: "bold", textAlign: "left", marginLeft: "10px" }}
|
|
1759
|
+
>
|
|
1760
|
+
{content.calculator.exchange_rate}
|
|
1761
|
+
</Typography>
|
|
1762
|
+
</Grid>
|
|
1763
|
+
</Grid>
|
|
1764
|
+
<Grid size={{ xs: 12}} container spacing={1}>
|
|
1765
|
+
<Grid size={{ xs: 1}}>
|
|
1766
|
+
<Typography
|
|
1767
|
+
variant="subtitle2"
|
|
1768
|
+
color="textPrimary"
|
|
1769
|
+
sx={{ fontWeight: "bold", textAlign: "right" }}
|
|
1770
|
+
>
|
|
1771
|
+
=
|
|
1772
|
+
</Typography>
|
|
1773
|
+
</Grid>
|
|
1774
|
+
<Grid size={{ xs: 3, md: 4 }} >
|
|
1775
|
+
<Typography
|
|
1776
|
+
variant="subtitle2"
|
|
1777
|
+
color="textPrimary"
|
|
1778
|
+
sx={{ fontWeight: "bold", textAlign: "right" }}
|
|
1779
|
+
>
|
|
1780
|
+
{this.state.isUsdt ? convertValueCrypto : (+receivedValue + taxReceiver).toFixed(2)}
|
|
1781
|
+
</Typography>
|
|
1782
|
+
</Grid>
|
|
1783
|
+
<Grid size={{ xs: 1}}>
|
|
1784
|
+
<Typography
|
|
1785
|
+
variant="subtitle2"
|
|
1786
|
+
color="textPrimary"
|
|
1787
|
+
sx={{ fontWeight: "bold" }}
|
|
1788
|
+
>
|
|
1789
|
+
{this.state.isUsdt ? 'USD' : toCurrencyValue}
|
|
1790
|
+
</Typography>
|
|
1791
|
+
</Grid>
|
|
1792
|
+
<Grid size={{ xs: 1}}>
|
|
1793
|
+
<Typography variant="body2" color="textSecondary">{" "}</Typography>
|
|
1794
|
+
</Grid>
|
|
1795
|
+
<Grid size="grow">
|
|
1796
|
+
<Typography
|
|
1797
|
+
variant="subtitle2"
|
|
1798
|
+
color="textPrimary"
|
|
1799
|
+
sx={{ fontWeight: "bold", textAlign: "left", marginLeft: "10px" }}
|
|
1800
|
+
>
|
|
1801
|
+
{content.calculator.converted_amount}
|
|
1802
|
+
</Typography>
|
|
1803
|
+
</Grid>
|
|
1804
|
+
</Grid>
|
|
1805
|
+
|
|
1806
|
+
{taxReceiver > 0 &&
|
|
1807
|
+
<Grid size={{ xs: 12}} container spacing={1}>
|
|
1808
|
+
<Grid size={{ xs: 1}}>
|
|
1809
|
+
<Typography
|
|
1810
|
+
variant="subtitle2"
|
|
1811
|
+
color="textPrimary"
|
|
1812
|
+
sx={{ fontWeight: "bold", textAlign: "right" }}
|
|
1813
|
+
>
|
|
1814
|
+
-
|
|
1815
|
+
</Typography>
|
|
1816
|
+
</Grid>
|
|
1817
|
+
<Grid size={{ xs: 3, md: 4 }} >
|
|
1818
|
+
<Typography
|
|
1819
|
+
variant="subtitle2"
|
|
1820
|
+
color="textPrimary"
|
|
1821
|
+
sx={{ fontWeight: "bold", textAlign: "right" }}
|
|
1822
|
+
>
|
|
1823
|
+
{(+taxReceiver).toFixed(2)}
|
|
1824
|
+
</Typography>
|
|
1825
|
+
</Grid>
|
|
1826
|
+
<Grid size={{ xs: 1}}>
|
|
1827
|
+
<Typography
|
|
1828
|
+
variant="subtitle2"
|
|
1829
|
+
color="textPrimary"
|
|
1830
|
+
sx={{ fontWeight: "bold" }}
|
|
1831
|
+
>
|
|
1832
|
+
{toCurrencyValue}
|
|
1833
|
+
</Typography>
|
|
1834
|
+
</Grid>
|
|
1835
|
+
<Grid size={{ xs: 1}}>
|
|
1836
|
+
<Typography variant="body2" color="textSecondary">{" "}</Typography>
|
|
1837
|
+
</Grid>
|
|
1838
|
+
<Grid size="grow">
|
|
1839
|
+
<Typography
|
|
1840
|
+
variant="subtitle2"
|
|
1841
|
+
color="textPrimary"
|
|
1842
|
+
sx={{ fontWeight: "bold", textAlign: "left", marginLeft: "10px" }}
|
|
1843
|
+
>
|
|
1844
|
+
{toCurrencyValue == "COP" ? content?.calculator.tax_co : content?.calculator.tax_pe}
|
|
1845
|
+
</Typography>
|
|
1846
|
+
</Grid>
|
|
1847
|
+
</Grid>
|
|
1848
|
+
}
|
|
1849
|
+
</Grid>
|
|
1850
|
+
}
|
|
1851
|
+
<br></br>
|
|
1852
|
+
<Grid container direction="column" spacing={0} >
|
|
1853
|
+
<Grid>
|
|
1854
|
+
<Typography
|
|
1855
|
+
sx={classes.labelAmount}
|
|
1856
|
+
gutterBottom
|
|
1857
|
+
variant="subtitle1"
|
|
1858
|
+
component="div"
|
|
1859
|
+
>
|
|
1860
|
+
{content.landing.receiver_content}
|
|
1861
|
+
</Typography>
|
|
1862
|
+
</Grid>
|
|
1863
|
+
<Grid size={{ xs: 12}} container>
|
|
1864
|
+
<Grid size={{ xs: 8, md:9}}
|
|
1865
|
+
>
|
|
1866
|
+
<Paper sx={classes.inputAmount}>
|
|
1867
|
+
<InputBase
|
|
1868
|
+
id="receiver"
|
|
1869
|
+
sx={classes.inputAmountText}
|
|
1870
|
+
type="number"
|
|
1871
|
+
required
|
|
1872
|
+
value={receivedValue}
|
|
1873
|
+
disabled={true}
|
|
1874
|
+
startAdornment={
|
|
1875
|
+
<InputAdornment
|
|
1876
|
+
position="start"
|
|
1877
|
+
>
|
|
1878
|
+
<span>{loadingTo && <CircularProgress size={18} />}</span>
|
|
1879
|
+
</InputAdornment>
|
|
1880
|
+
}
|
|
1881
|
+
endAdornment={
|
|
1882
|
+
<InputAdornment
|
|
1883
|
+
position="end"
|
|
1884
|
+
>
|
|
1885
|
+
<span sx={{
|
|
1886
|
+
fontSize: "10px",
|
|
1887
|
+
fontWeight: "500",
|
|
1888
|
+
paddingTop: "15px",
|
|
1889
|
+
paddingRight: "5px"
|
|
1890
|
+
}}>
|
|
1891
|
+
{
|
|
1892
|
+
(toCountryValue == "AR" &&
|
|
1893
|
+
paymentMethods.length &&
|
|
1894
|
+
paymentMethods[0].isWallet &&
|
|
1895
|
+
!loadingTo &&
|
|
1896
|
+
!loadingFrom) ? `(${paymentMethods[0].amount} ARS)` : ''
|
|
1897
|
+
}
|
|
1898
|
+
</span>
|
|
1899
|
+
</InputAdornment>
|
|
1900
|
+
}
|
|
1901
|
+
slotProps={{
|
|
1902
|
+
input: { min: minFromValue, max: maxFromValue }
|
|
1903
|
+
}}
|
|
1904
|
+
onChange={this.handleReceived}
|
|
1905
|
+
/>
|
|
1906
|
+
</Paper>
|
|
1907
|
+
</Grid>
|
|
1908
|
+
<Grid size={{ xs: 4, md:3}}
|
|
1909
|
+
>
|
|
1910
|
+
<Autocomplete
|
|
1911
|
+
disabled={loadingTo || loadingFrom}
|
|
1912
|
+
options={countries.filter((country) => {
|
|
1913
|
+
if (
|
|
1914
|
+
calculator &&
|
|
1915
|
+
calculator[fromCountryValue] &&
|
|
1916
|
+
calculator[fromCountryValue].active &&
|
|
1917
|
+
calculator[fromCountryValue].countryTo[
|
|
1918
|
+
country.code
|
|
1919
|
+
] &&
|
|
1920
|
+
calculator[fromCountryValue].countryTo[country.code]
|
|
1921
|
+
.active
|
|
1922
|
+
) {
|
|
1923
|
+
return country;
|
|
1924
|
+
}
|
|
1925
|
+
})}
|
|
1926
|
+
sx={{
|
|
1927
|
+
fontSize: 14,
|
|
1928
|
+
"& > span": {
|
|
1929
|
+
marginRight: 10,
|
|
1930
|
+
fontSize: 18,
|
|
1931
|
+
},
|
|
1932
|
+
}}
|
|
1933
|
+
disableClearable
|
|
1934
|
+
value={
|
|
1935
|
+
countries.filter(
|
|
1936
|
+
(country) => country.code == toCountryValue
|
|
1937
|
+
)[0]
|
|
1938
|
+
}
|
|
1939
|
+
autoHighlight
|
|
1940
|
+
getOptionLabel={(option) => `${option.currency}`}
|
|
1941
|
+
renderOption={(props, option) => (
|
|
1942
|
+
<Box component="li" {...props}>
|
|
1943
|
+
<span style={{ marginRight: "5px" }}>
|
|
1944
|
+
<FlagsHelpers code={option.code == "PE-USD" ? "PE" : option.code} />
|
|
1945
|
+
</span>
|
|
1946
|
+
{option.currency}
|
|
1947
|
+
</Box>
|
|
1948
|
+
)}
|
|
1949
|
+
renderInput={(params) => (
|
|
1950
|
+
<Paper variant="outlined" sx={classes.rootFlags}>
|
|
1951
|
+
<TextField
|
|
1952
|
+
{...params}
|
|
1953
|
+
variant="standard"
|
|
1954
|
+
slotProps={{
|
|
1955
|
+
input: {
|
|
1956
|
+
...params.InputProps,
|
|
1957
|
+
startAdornment: (
|
|
1958
|
+
<FlagsHelpers
|
|
1959
|
+
code={this.state.toCountryValue == "PE-USD" ?
|
|
1960
|
+
"PE" : this.state.toCountryValue
|
|
1961
|
+
}>
|
|
1962
|
+
</FlagsHelpers>
|
|
1963
|
+
),
|
|
1964
|
+
disableUnderline: true,
|
|
1965
|
+
}
|
|
1966
|
+
}}
|
|
1967
|
+
/>
|
|
1968
|
+
</Paper>
|
|
1969
|
+
)}
|
|
1970
|
+
onChange={this.handleOnChangeToCountry}
|
|
1971
|
+
/>
|
|
1972
|
+
</Grid>
|
|
1973
|
+
</Grid>
|
|
1974
|
+
<Grid size={{ xs: 12}} container>
|
|
1975
|
+
<Grid size={{ xs: 12}}>
|
|
1976
|
+
{!isLoading && !loadingFrom && !loadingTo && (
|
|
1977
|
+
<FormHelperText sx={{ color: "red" }}>
|
|
1978
|
+
{(receivedValue < minToValue &&
|
|
1979
|
+
content.landing.min_value.replace(
|
|
1980
|
+
"minValue",
|
|
1981
|
+
minToValue
|
|
1982
|
+
)) ||
|
|
1983
|
+
(receivedValue > maxToValue &&
|
|
1984
|
+
content.landing.max_value.replace(
|
|
1985
|
+
"maxValue",
|
|
1986
|
+
maxToValue
|
|
1987
|
+
))}
|
|
1988
|
+
</FormHelperText>
|
|
1989
|
+
)}
|
|
1990
|
+
</Grid>
|
|
1991
|
+
</Grid>
|
|
1992
|
+
{(toCountryValue == "VE" || toCountryValue == "AR") &&
|
|
1993
|
+
paymentMethods &&
|
|
1994
|
+
!loadingTo &&
|
|
1995
|
+
!loadingFrom && (
|
|
1996
|
+
<Grid size={{ xs: 12}}>
|
|
1997
|
+
<FormControl fullWidth>
|
|
1998
|
+
<Select
|
|
1999
|
+
id="demo-customized-select-native"
|
|
2000
|
+
value="Banks"
|
|
2001
|
+
onChange={this.changeBank}
|
|
2002
|
+
>
|
|
2003
|
+
{paymentMethods &&
|
|
2004
|
+
paymentMethods.map((payment, index) => {
|
|
2005
|
+
if (payment.id == "trc20") {
|
|
2006
|
+
return <MenuItem key={payment.name + index} value={payment.id}>
|
|
2007
|
+
Tron TRC20 ({payment.currency})
|
|
2008
|
+
</MenuItem>
|
|
2009
|
+
}
|
|
2010
|
+
return <MenuItem key={payment.name + index} value={payment.id}>
|
|
2011
|
+
{payment.label}
|
|
2012
|
+
</MenuItem>
|
|
2013
|
+
})}
|
|
2014
|
+
</Select>
|
|
2015
|
+
</FormControl>
|
|
2016
|
+
</Grid>
|
|
2017
|
+
)
|
|
2018
|
+
}
|
|
2019
|
+
</Grid>
|
|
2020
|
+
<br></br>
|
|
2021
|
+
{!onlySimulation &&
|
|
2022
|
+
<>
|
|
2023
|
+
<Grid container direction="column" spacing={0}>
|
|
2024
|
+
{this.state.hasValidCoupon && (plus != null && plus != 'undefined' && plus != 0) &&
|
|
2025
|
+
<Grid>
|
|
2026
|
+
<p
|
|
2027
|
+
style={{
|
|
2028
|
+
textAlign: "center",
|
|
2029
|
+
}}
|
|
2030
|
+
>
|
|
2031
|
+
{content.calculator.plus
|
|
2032
|
+
.replace("amount", plus)
|
|
2033
|
+
.replace("currency", this.state.isUsdt ? 'USDT' : toCurrencyValue)}
|
|
2034
|
+
</p>
|
|
2035
|
+
</Grid>
|
|
2036
|
+
}
|
|
2037
|
+
<Grid>
|
|
2038
|
+
<Typography
|
|
2039
|
+
sx={classes.labelCoupon}
|
|
2040
|
+
gutterBottom
|
|
2041
|
+
variant="subtitle1"
|
|
2042
|
+
component="div"
|
|
2043
|
+
>
|
|
2044
|
+
{content.landing.coupon_content}
|
|
2045
|
+
</Typography>
|
|
2046
|
+
</Grid>
|
|
2047
|
+
<Grid size={{ xs: 12}} container>
|
|
2048
|
+
<Grid size={{ xs: 5}}>
|
|
2049
|
+
<Paper sx={classes.inputCoupon}>
|
|
2050
|
+
<InputBase
|
|
2051
|
+
sx={classes.inputCouponText}
|
|
2052
|
+
value={couponValue}
|
|
2053
|
+
disabled={loadingFrom || loadingTo}
|
|
2054
|
+
type="text"
|
|
2055
|
+
onChange={this.handleCoupon}
|
|
2056
|
+
/>
|
|
2057
|
+
</Paper>
|
|
2058
|
+
</Grid>
|
|
2059
|
+
|
|
2060
|
+
{this.state.hasValidCoupon && (plus != null && plus != 'undefined' && plus != 0) &&
|
|
2061
|
+
<Grid size={{ xs: 2}} sx={{ paddingLeft: "3px" }}>
|
|
2062
|
+
<Tooltip title={content.calculator.remove_coupon}>
|
|
2063
|
+
<Button
|
|
2064
|
+
sx={classes.buttonRemoveCoupon}
|
|
2065
|
+
onClick={this.removeCoupon}
|
|
2066
|
+
>
|
|
2067
|
+
<HighlightOffOutlinedIcon
|
|
2068
|
+
sx={{ color: "white" }} />
|
|
2069
|
+
</Button>
|
|
2070
|
+
</Tooltip>
|
|
2071
|
+
</Grid>
|
|
2072
|
+
}
|
|
2073
|
+
</Grid>
|
|
2074
|
+
{!this.state.hasValidCoupon && (
|
|
2075
|
+
<Grid size={{ xs: 12}}>
|
|
2076
|
+
<Typography
|
|
2077
|
+
sx={{
|
|
2078
|
+
color: "red",
|
|
2079
|
+
textAlign: "center",
|
|
2080
|
+
maxWidth: "100%",
|
|
2081
|
+
//paddingTop: "10px"
|
|
2082
|
+
}}
|
|
2083
|
+
>
|
|
2084
|
+
{
|
|
2085
|
+
this.state.countryError.hasErrors ?
|
|
2086
|
+
<>
|
|
2087
|
+
{this.state.countryError.value == "from" ? content.calculator.invalid_coupon_country_from : ""}
|
|
2088
|
+
{this.state.countryError.value == "to" ? content.calculator.invalid_coupon_country_to : ""}
|
|
2089
|
+
{this.state.countryError.value == "amount_from" ? content.calculator.invalid_coupon_amount_from : ""}
|
|
2090
|
+
{this.state.countryError.value == "" ? content.calculator.invalid_coupon_message : ""}
|
|
2091
|
+
</>
|
|
2092
|
+
: ""
|
|
2093
|
+
}
|
|
2094
|
+
</Typography>
|
|
2095
|
+
</Grid>
|
|
2096
|
+
)}
|
|
2097
|
+
</Grid>
|
|
2098
|
+
<br></br>
|
|
2099
|
+
<Grid size={{ xs: 12}} sx={{ marginTop: "20px", marginBottom: "10px" }}>
|
|
2100
|
+
<Button
|
|
2101
|
+
sx={startDisabled ? classes.buttonStartDisabled : classes.buttonStart}
|
|
2102
|
+
variant="contained"
|
|
2103
|
+
disabled={startDisabled}
|
|
2104
|
+
onClick={this.handleSubmitForm}
|
|
2105
|
+
>
|
|
2106
|
+
<Typography sx={classes.textButtonStart}>
|
|
2107
|
+
{content.landing.button_start}
|
|
2108
|
+
</Typography>
|
|
2109
|
+
</Button>
|
|
2110
|
+
</Grid>
|
|
2111
|
+
<br></br>
|
|
2112
|
+
</>
|
|
2113
|
+
}
|
|
2114
|
+
{recalculate &&
|
|
2115
|
+
<Grid size={{ xs: 12}}>
|
|
2116
|
+
<Typography
|
|
2117
|
+
sx={classes.labelUpdateTC}
|
|
2118
|
+
>
|
|
2119
|
+
<Timer locale={locale} />
|
|
2120
|
+
</Typography>
|
|
2121
|
+
</Grid>
|
|
2122
|
+
}
|
|
2123
|
+
{this.state.hasError && (
|
|
2124
|
+
<Grid size={{ xs: 12}}>
|
|
2125
|
+
<Typography
|
|
2126
|
+
sx={{
|
|
2127
|
+
color: "red",
|
|
2128
|
+
textAlign: "center",
|
|
2129
|
+
maxWidth: "100%",
|
|
2130
|
+
paddingTop: "10px"
|
|
2131
|
+
}}
|
|
2132
|
+
>
|
|
2133
|
+
{content.error_general}
|
|
2134
|
+
</Typography>
|
|
2135
|
+
</Grid>
|
|
2136
|
+
)}
|
|
2137
|
+
<Grid size={{ xs: 12}} sx={{ marginTop: "45px" }}>
|
|
2138
|
+
<Divider></Divider>
|
|
2139
|
+
</Grid>
|
|
2140
|
+
<Grid size={{ xs: 12}} container
|
|
2141
|
+
direction="row"
|
|
2142
|
+
justifyContent="center"
|
|
2143
|
+
alignItems="center"
|
|
2144
|
+
sx={{ paddingBottom: "10px" }}>
|
|
2145
|
+
<Typography
|
|
2146
|
+
variant="subtitle1"
|
|
2147
|
+
>
|
|
2148
|
+
<span style={{ fontSize: "10px", textAlign: "center" }}>Powered by </span>
|
|
2149
|
+
<span style={{ fontWeight: "bold", textAlign: "center", fontSize: "12px", }}>Orquezta</span>
|
|
2150
|
+
</Typography>
|
|
2151
|
+
</Grid>
|
|
2152
|
+
</Grid>
|
|
2153
|
+
</Paper>
|
|
2154
|
+
</Fragment>
|
|
2155
2155
|
);
|
|
2156
2156
|
}
|
|
2157
2157
|
}
|