tg-core-components 6.2.0-alpha.0 → 6.2.0-crypto.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/es/components/Money/index.js +24 -2
- package/es/components/Picture/index.js +1 -1
- package/es/index.js +1 -2
- package/es/lib/utils/selectUnit.js +9 -13
- package/es/lib/utils/translate.js +1 -1
- package/es/misc/countryEmojiFlags.js +5 -0
- package/es/widgets/AccordionWidget/index.js +3 -11
- package/es/widgets/AccountDetail/index.js +0 -8
- package/es/widgets/ActivateWidget/index.js +1 -1
- package/es/widgets/BonusWidget/index.js +17 -32
- package/es/widgets/BonusWidget/types.js +23 -0
- package/es/widgets/Cashier/Deposit/PaymentForm/InjectedIframeHTML.js +7 -3
- package/es/widgets/Cashier/Deposit/PaymentForm/index.js +7 -5
- package/es/widgets/Cashier/Payment/PaymentAccountForms/index.js +41 -10
- package/es/widgets/Cashier/Payment/PaymentAccountParser.js +6 -0
- package/es/widgets/CashierAccordion/Deposit/DepositWidget/index.js +4 -1
- package/es/widgets/CashierAccordion/Payment/PaymentAccountForms/index.js +109 -71
- package/es/widgets/CashierAccordion/Payment/PaymentAccountParser.js +6 -0
- package/es/widgets/CashierAccordion/Withdraw/WithdrawWidget/index.js +5 -3
- package/es/widgets/HistoryWidget/index.js +19 -19
- package/es/widgets/ResponsibleGamingWidget/Timespan.js +5 -3
- package/lib/components/Money/index.js +25 -2
- package/lib/components/Picture/index.js +1 -1
- package/lib/index.js +6 -9
- package/lib/lib/utils/selectUnit.js +9 -13
- package/lib/lib/utils/translate.js +1 -1
- package/lib/misc/countryEmojiFlags.js +5 -0
- package/lib/widgets/AccordionWidget/index.js +3 -14
- package/lib/widgets/AccountDetail/index.js +0 -8
- package/lib/widgets/ActivateWidget/index.js +1 -1
- package/lib/widgets/BonusWidget/index.js +21 -32
- package/lib/widgets/BonusWidget/types.js +37 -0
- package/lib/widgets/Cashier/Deposit/PaymentForm/InjectedIframeHTML.js +7 -3
- package/lib/widgets/Cashier/Deposit/PaymentForm/index.js +7 -5
- package/lib/widgets/Cashier/Payment/PaymentAccountForms/index.js +42 -11
- package/lib/widgets/Cashier/Payment/PaymentAccountParser.js +6 -0
- package/lib/widgets/CashierAccordion/Deposit/DepositWidget/index.js +4 -1
- package/lib/widgets/CashierAccordion/Payment/PaymentAccountForms/index.js +110 -72
- package/lib/widgets/CashierAccordion/Payment/PaymentAccountParser.js +6 -0
- package/lib/widgets/CashierAccordion/Withdraw/WithdrawWidget/index.js +5 -3
- package/lib/widgets/HistoryWidget/index.js +19 -19
- package/lib/widgets/ResponsibleGamingWidget/Timespan.js +5 -3
- package/package.json +2 -2
- package/es/components/Message/index.js +0 -41
- package/es/lib/utils/bonus.js +0 -47
- package/es/widgets/BonusOffers/Actions.js +0 -167
- package/es/widgets/BonusOffers/BonusCode.js +0 -62
- package/es/widgets/BonusOffers/Details.js +0 -127
- package/es/widgets/BonusOffers/Finished.js +0 -18
- package/es/widgets/BonusOffers/List.js +0 -83
- package/es/widgets/BonusOffers/Overview.js +0 -51
- package/es/widgets/BonusOffers/index.js +0 -78
- package/lib/components/Message/index.js +0 -57
- package/lib/lib/utils/bonus.js +0 -52
- package/lib/widgets/BonusOffers/Actions.js +0 -182
- package/lib/widgets/BonusOffers/BonusCode.js +0 -85
- package/lib/widgets/BonusOffers/Details.js +0 -157
- package/lib/widgets/BonusOffers/Finished.js +0 -31
- package/lib/widgets/BonusOffers/List.js +0 -104
- package/lib/widgets/BonusOffers/Overview.js +0 -77
- package/lib/widgets/BonusOffers/index.js +0 -95
|
@@ -186,6 +186,34 @@ var VenusPoint = function VenusPoint(_ref3) {
|
|
|
186
186
|
);
|
|
187
187
|
};
|
|
188
188
|
|
|
189
|
+
var Vega = function Vega(_ref4) {
|
|
190
|
+
var account = _ref4.account,
|
|
191
|
+
intl = _ref4.intl,
|
|
192
|
+
change = _ref4.change;
|
|
193
|
+
|
|
194
|
+
return React.createElement(
|
|
195
|
+
'div',
|
|
196
|
+
null,
|
|
197
|
+
React.createElement(Input, {
|
|
198
|
+
disabled: account.accountId,
|
|
199
|
+
name: 'username',
|
|
200
|
+
onChange: function onChange(e, username) {
|
|
201
|
+
return change('username', username);
|
|
202
|
+
},
|
|
203
|
+
value: account.maskedAccount,
|
|
204
|
+
label: translate({ id: 'cashier.details.username' }, intl)
|
|
205
|
+
}),
|
|
206
|
+
React.createElement(Input, {
|
|
207
|
+
type: 'password',
|
|
208
|
+
name: 'password',
|
|
209
|
+
onChange: function onChange(e, password) {
|
|
210
|
+
return change('password', password);
|
|
211
|
+
},
|
|
212
|
+
label: translate({ id: 'cashier.details.password' }, intl)
|
|
213
|
+
})
|
|
214
|
+
);
|
|
215
|
+
};
|
|
216
|
+
|
|
189
217
|
var PPro = function PPro() {
|
|
190
218
|
return React.createElement(
|
|
191
219
|
'div',
|
|
@@ -194,11 +222,11 @@ var PPro = function PPro() {
|
|
|
194
222
|
);
|
|
195
223
|
};
|
|
196
224
|
|
|
197
|
-
var PhoneNumber = function PhoneNumber(
|
|
198
|
-
var account =
|
|
199
|
-
intl =
|
|
200
|
-
change =
|
|
201
|
-
values =
|
|
225
|
+
var PhoneNumber = function PhoneNumber(_ref5) {
|
|
226
|
+
var account = _ref5.account,
|
|
227
|
+
intl = _ref5.intl,
|
|
228
|
+
change = _ref5.change,
|
|
229
|
+
values = _ref5.values;
|
|
202
230
|
|
|
203
231
|
return React.createElement(
|
|
204
232
|
'div',
|
|
@@ -216,11 +244,11 @@ var PhoneNumber = function PhoneNumber(_ref4) {
|
|
|
216
244
|
);
|
|
217
245
|
};
|
|
218
246
|
|
|
219
|
-
var Email = function Email(
|
|
220
|
-
var account =
|
|
221
|
-
intl =
|
|
222
|
-
change =
|
|
223
|
-
values =
|
|
247
|
+
var Email = function Email(_ref6) {
|
|
248
|
+
var account = _ref6.account,
|
|
249
|
+
intl = _ref6.intl,
|
|
250
|
+
change = _ref6.change,
|
|
251
|
+
values = _ref6.values;
|
|
224
252
|
|
|
225
253
|
return React.createElement(
|
|
226
254
|
'div',
|
|
@@ -238,10 +266,10 @@ var Email = function Email(_ref5) {
|
|
|
238
266
|
);
|
|
239
267
|
};
|
|
240
268
|
|
|
241
|
-
var Banklocal = function Banklocal(
|
|
242
|
-
var account =
|
|
243
|
-
intl =
|
|
244
|
-
change =
|
|
269
|
+
var Banklocal = function Banklocal(_ref7) {
|
|
270
|
+
var account = _ref7.account,
|
|
271
|
+
intl = _ref7.intl,
|
|
272
|
+
change = _ref7.change;
|
|
245
273
|
|
|
246
274
|
return React.createElement(
|
|
247
275
|
'div',
|
|
@@ -261,17 +289,17 @@ var Banklocal = function Banklocal(_ref6) {
|
|
|
261
289
|
return change('accountNumber', accountNumber);
|
|
262
290
|
},
|
|
263
291
|
name: 'accountNumber',
|
|
264
|
-
label: translate({ id: 'cashier.details.
|
|
292
|
+
label: translate({ id: 'cashier.details.iban' }, intl),
|
|
265
293
|
disabled: account.accountId
|
|
266
294
|
})
|
|
267
295
|
);
|
|
268
296
|
};
|
|
269
297
|
|
|
270
|
-
var BankIBAN = function BankIBAN(
|
|
271
|
-
var account =
|
|
272
|
-
intl =
|
|
273
|
-
change =
|
|
274
|
-
values =
|
|
298
|
+
var BankIBAN = function BankIBAN(_ref8) {
|
|
299
|
+
var account = _ref8.account,
|
|
300
|
+
intl = _ref8.intl,
|
|
301
|
+
change = _ref8.change,
|
|
302
|
+
values = _ref8.values;
|
|
275
303
|
|
|
276
304
|
return React.createElement(
|
|
277
305
|
'div',
|
|
@@ -317,15 +345,15 @@ var BankIBAN = function BankIBAN(_ref7) {
|
|
|
317
345
|
);
|
|
318
346
|
};
|
|
319
347
|
|
|
320
|
-
var AstroPayBank = function AstroPayBank(
|
|
321
|
-
var account =
|
|
322
|
-
intl =
|
|
323
|
-
country =
|
|
324
|
-
method =
|
|
325
|
-
detail =
|
|
326
|
-
change =
|
|
327
|
-
values =
|
|
328
|
-
config =
|
|
348
|
+
var AstroPayBank = function AstroPayBank(_ref9) {
|
|
349
|
+
var account = _ref9.account,
|
|
350
|
+
intl = _ref9.intl,
|
|
351
|
+
country = _ref9.country,
|
|
352
|
+
method = _ref9.method,
|
|
353
|
+
detail = _ref9.detail,
|
|
354
|
+
change = _ref9.change,
|
|
355
|
+
values = _ref9.values,
|
|
356
|
+
config = _ref9.config;
|
|
329
357
|
|
|
330
358
|
var _useState = useState([]),
|
|
331
359
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -530,22 +558,22 @@ var AstroPayBank = function AstroPayBank(_ref8) {
|
|
|
530
558
|
);
|
|
531
559
|
};
|
|
532
560
|
|
|
533
|
-
var BankIntl = function BankIntl(
|
|
534
|
-
var account =
|
|
535
|
-
intl =
|
|
536
|
-
values =
|
|
537
|
-
change =
|
|
538
|
-
country =
|
|
561
|
+
var BankIntl = function BankIntl(_ref10) {
|
|
562
|
+
var account = _ref10.account,
|
|
563
|
+
intl = _ref10.intl,
|
|
564
|
+
values = _ref10.values,
|
|
565
|
+
change = _ref10.change,
|
|
566
|
+
country = _ref10.country;
|
|
539
567
|
|
|
540
568
|
return React.createElement(
|
|
541
569
|
'div',
|
|
542
570
|
{ className: 'payment-account-info' },
|
|
543
571
|
React.createElement(Input, {
|
|
544
572
|
required: true,
|
|
545
|
-
name: '
|
|
546
|
-
value: account.accountId ? account.maskedAccount.replace(/\d*-/g, '') : values['
|
|
547
|
-
onChange: function onChange(e,
|
|
548
|
-
return change('
|
|
573
|
+
name: 'accountNumber',
|
|
574
|
+
value: account.accountId ? account.maskedAccount.replace(/\d*-/g, '') : values['accountNumber'],
|
|
575
|
+
onChange: function onChange(e, accountNumber) {
|
|
576
|
+
return change('accountNumber', accountNumber);
|
|
549
577
|
},
|
|
550
578
|
label: translate({ id: 'cashier.details.iban' }, intl),
|
|
551
579
|
disabled: account.accountId
|
|
@@ -587,12 +615,12 @@ var BankIntl = function BankIntl(_ref9) {
|
|
|
587
615
|
);
|
|
588
616
|
};
|
|
589
617
|
|
|
590
|
-
var CryptoCurrency = function CryptoCurrency(
|
|
591
|
-
var intl =
|
|
592
|
-
detail =
|
|
593
|
-
method =
|
|
594
|
-
values =
|
|
595
|
-
change =
|
|
618
|
+
var CryptoCurrency = function CryptoCurrency(_ref11) {
|
|
619
|
+
var intl = _ref11.intl,
|
|
620
|
+
detail = _ref11.detail,
|
|
621
|
+
method = _ref11.method,
|
|
622
|
+
values = _ref11.values,
|
|
623
|
+
change = _ref11.change;
|
|
596
624
|
|
|
597
625
|
var methodDetails = {
|
|
598
626
|
cryptoCurrencies: getByPath(detail, 'config.cryptoCurrencies', [])
|
|
@@ -645,11 +673,11 @@ var CryptoCurrency = function CryptoCurrency(_ref10) {
|
|
|
645
673
|
);
|
|
646
674
|
};
|
|
647
675
|
|
|
648
|
-
var Jeton = function Jeton(
|
|
649
|
-
var account =
|
|
650
|
-
intl =
|
|
651
|
-
values =
|
|
652
|
-
change =
|
|
676
|
+
var Jeton = function Jeton(_ref12) {
|
|
677
|
+
var account = _ref12.account,
|
|
678
|
+
intl = _ref12.intl,
|
|
679
|
+
values = _ref12.values,
|
|
680
|
+
change = _ref12.change;
|
|
653
681
|
|
|
654
682
|
return React.createElement(
|
|
655
683
|
'div',
|
|
@@ -667,11 +695,11 @@ var Jeton = function Jeton(_ref11) {
|
|
|
667
695
|
);
|
|
668
696
|
};
|
|
669
697
|
|
|
670
|
-
var BestPay = function BestPay(
|
|
671
|
-
var account =
|
|
672
|
-
intl =
|
|
673
|
-
values =
|
|
674
|
-
change =
|
|
698
|
+
var BestPay = function BestPay(_ref13) {
|
|
699
|
+
var account = _ref13.account,
|
|
700
|
+
intl = _ref13.intl,
|
|
701
|
+
values = _ref13.values,
|
|
702
|
+
change = _ref13.change;
|
|
675
703
|
|
|
676
704
|
return React.createElement(
|
|
677
705
|
'div',
|
|
@@ -698,11 +726,11 @@ var BestPay = function BestPay(_ref12) {
|
|
|
698
726
|
);
|
|
699
727
|
};
|
|
700
728
|
|
|
701
|
-
var Mifinity = function Mifinity(
|
|
702
|
-
var account =
|
|
703
|
-
intl =
|
|
704
|
-
change =
|
|
705
|
-
values =
|
|
729
|
+
var Mifinity = function Mifinity(_ref14) {
|
|
730
|
+
var account = _ref14.account,
|
|
731
|
+
intl = _ref14.intl,
|
|
732
|
+
change = _ref14.change,
|
|
733
|
+
values = _ref14.values;
|
|
706
734
|
|
|
707
735
|
return React.createElement(
|
|
708
736
|
'div',
|
|
@@ -720,11 +748,11 @@ var Mifinity = function Mifinity(_ref13) {
|
|
|
720
748
|
);
|
|
721
749
|
};
|
|
722
750
|
|
|
723
|
-
var EzeeWallet = function EzeeWallet(
|
|
724
|
-
var account =
|
|
725
|
-
intl =
|
|
726
|
-
method =
|
|
727
|
-
change =
|
|
751
|
+
var EzeeWallet = function EzeeWallet(_ref15) {
|
|
752
|
+
var account = _ref15.account,
|
|
753
|
+
intl = _ref15.intl,
|
|
754
|
+
method = _ref15.method,
|
|
755
|
+
change = _ref15.change;
|
|
728
756
|
|
|
729
757
|
return React.createElement(
|
|
730
758
|
'div',
|
|
@@ -757,12 +785,12 @@ var EzeeWallet = function EzeeWallet(_ref14) {
|
|
|
757
785
|
);
|
|
758
786
|
};
|
|
759
787
|
|
|
760
|
-
var Paramount = function Paramount(
|
|
761
|
-
var account =
|
|
762
|
-
intl =
|
|
763
|
-
values =
|
|
764
|
-
change =
|
|
765
|
-
detail =
|
|
788
|
+
var Paramount = function Paramount(_ref16) {
|
|
789
|
+
var account = _ref16.account,
|
|
790
|
+
intl = _ref16.intl,
|
|
791
|
+
values = _ref16.values,
|
|
792
|
+
change = _ref16.change,
|
|
793
|
+
detail = _ref16.detail;
|
|
766
794
|
|
|
767
795
|
var methodDetails = {
|
|
768
796
|
securityQuestions: getByPath(detail, 'config.securityQuestions', [])
|
|
@@ -840,6 +868,11 @@ export var VenusPointDeposit = {
|
|
|
840
868
|
parser: Parser.parseVenusPoint
|
|
841
869
|
};
|
|
842
870
|
|
|
871
|
+
export var VegaDeposit = {
|
|
872
|
+
component: injectMethod('deposit', injectIntl(Vega)),
|
|
873
|
+
parser: Parser.parseVega
|
|
874
|
+
};
|
|
875
|
+
|
|
843
876
|
export var SiruDeposit = {
|
|
844
877
|
component: injectIntl(PhoneNumber),
|
|
845
878
|
parser: Parser.parsePhoneNumber
|
|
@@ -947,6 +980,11 @@ export var VenusPointWithdrawal = {
|
|
|
947
980
|
parser: Parser.parseVenusPoint
|
|
948
981
|
};
|
|
949
982
|
|
|
983
|
+
export var VegaWithdrawal = {
|
|
984
|
+
component: injectMethod('withdraw', injectIntl(Vega)),
|
|
985
|
+
parser: Parser.parseVega
|
|
986
|
+
};
|
|
987
|
+
|
|
950
988
|
export var NetellerWithdrawal = {
|
|
951
989
|
component: injectMethod({ method: 'withdraw' }, injectIntl(Neteller)),
|
|
952
990
|
parser: Parser.parseNeteller
|
|
@@ -39,6 +39,12 @@ export var parseVenusPoint = function parseVenusPoint(account) {
|
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
+
export var parseVega = function parseVega(account) {
|
|
43
|
+
return {
|
|
44
|
+
account: account.maskedAccount || account.account
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
42
48
|
export var parseMifinity = function parseMifinity(account) {
|
|
43
49
|
return {
|
|
44
50
|
account: account.maskedAccount || account.account
|
|
@@ -141,11 +141,13 @@ var WithdrawWidget = function (_PureComponent) {
|
|
|
141
141
|
if (amount === undefined) {
|
|
142
142
|
return errors;
|
|
143
143
|
}
|
|
144
|
-
|
|
145
|
-
if (Number(amount) < parseFloat(selectedMethod.limit.min)) {
|
|
144
|
+
if (amount && Number(amount) < parseFloat(selectedMethod.limit.min)) {
|
|
146
145
|
errors.amount.push(React.createElement(Translate, {
|
|
147
146
|
id: 'error.cashier.amount-below-method-limit',
|
|
148
|
-
defaultMessage: 'Amount is too low.'
|
|
147
|
+
defaultMessage: 'Amount is too low. Min amount: {min}',
|
|
148
|
+
values: {
|
|
149
|
+
min: parseFloat(selectedMethod.limit.min)
|
|
150
|
+
}
|
|
149
151
|
}));
|
|
150
152
|
return errors;
|
|
151
153
|
}
|
|
@@ -45,7 +45,7 @@ var HistoryWidgetList = function (_React$Component) {
|
|
|
45
45
|
minute: '2-digit',
|
|
46
46
|
second: '2-digit'
|
|
47
47
|
});
|
|
48
|
-
}, _this.createListInfo = function (item, product,
|
|
48
|
+
}, _this.createListInfo = function (item, product, isLoading) {
|
|
49
49
|
if (isLoading) return [[React.createElement(SkeletonLine, { bold: true }), React.createElement(SkeletonLine, null)], [React.createElement(SkeletonLine, { bold: true }), React.createElement(SkeletonLine, null)]];
|
|
50
50
|
|
|
51
51
|
if (product === 'casino') {
|
|
@@ -57,7 +57,7 @@ var HistoryWidgetList = function (_React$Component) {
|
|
|
57
57
|
'div',
|
|
58
58
|
null,
|
|
59
59
|
getMessage(getByPath(item, 'Transactions[0].Status'))
|
|
60
|
-
)], [React.createElement(Money, { value: item.Win - item.Bet, currency:
|
|
60
|
+
)], [React.createElement(Money, { value: item.Win - item.Bet, currency: item.Currency }), React.createElement(FormattedRelativeTime, selectUnit(new Date(item.StartTime + '+00:00')))]];
|
|
61
61
|
} else if (product === 'sportsbook') {
|
|
62
62
|
var selection = item.Transactions[0].Description;
|
|
63
63
|
var odds = item.Transactions[0].Odds;
|
|
@@ -73,7 +73,10 @@ var HistoryWidgetList = function (_React$Component) {
|
|
|
73
73
|
'div',
|
|
74
74
|
null,
|
|
75
75
|
getMessage(item.Settled ? 'settled' : 'pendling')
|
|
76
|
-
)], [React.createElement(Money, {
|
|
76
|
+
)], [React.createElement(Money, {
|
|
77
|
+
value: item.TotalWin - item.TotalWager,
|
|
78
|
+
currency: item.Currency
|
|
79
|
+
}), React.createElement(FormattedRelativeTime, selectUnit(new Date(item.Created + '+00:00')))]];
|
|
77
80
|
} else if (product === 'bingo') {
|
|
78
81
|
return [[React.createElement(Translate, {
|
|
79
82
|
tag: 'div'
|
|
@@ -85,7 +88,7 @@ var HistoryWidgetList = function (_React$Component) {
|
|
|
85
88
|
getMessage(getByPath(item, 'Transactions[0].TransactionType'))
|
|
86
89
|
)], [React.createElement(Money, {
|
|
87
90
|
value: getByPath(item, 'Transactions[0].Amount'),
|
|
88
|
-
currency:
|
|
91
|
+
currency: item.Currency
|
|
89
92
|
}), React.createElement(FormattedRelativeTime, selectUnit(new Date(item.Created + '+00:00')))]];
|
|
90
93
|
} else if (product === 'fantasy') {
|
|
91
94
|
return [[React.createElement(
|
|
@@ -100,7 +103,7 @@ var HistoryWidgetList = function (_React$Component) {
|
|
|
100
103
|
getMessage(item.Status === 'Default' ? 'initiated' : item.Status === 'Canceled' ? 'canceled' : 'completed')
|
|
101
104
|
)], [React.createElement(Money, {
|
|
102
105
|
value: item.Win - (item.Bet + item.Rake),
|
|
103
|
-
currency:
|
|
106
|
+
currency: item.Currency
|
|
104
107
|
}), React.createElement(FormattedRelativeTime, selectUnit(new Date(item.Created + '+00:00')))]];
|
|
105
108
|
}
|
|
106
109
|
|
|
@@ -114,9 +117,9 @@ var HistoryWidgetList = function (_React$Component) {
|
|
|
114
117
|
getMessage(item.Status)
|
|
115
118
|
)], [React.createElement(Money, {
|
|
116
119
|
value: item.TransactionType === 'Withdraw' ? -item.Amount : item.Amount,
|
|
117
|
-
currency:
|
|
120
|
+
currency: item.Currency
|
|
118
121
|
}), React.createElement(FormattedRelativeTime, selectUnit(new Date(item.Started + '+00:00')))]];
|
|
119
|
-
}, _this.createListDetail = function (item, product
|
|
122
|
+
}, _this.createListDetail = function (item, product) {
|
|
120
123
|
if (product === 'casino') {
|
|
121
124
|
return [[React.createElement(
|
|
122
125
|
'div',
|
|
@@ -128,14 +131,14 @@ var HistoryWidgetList = function (_React$Component) {
|
|
|
128
131
|
id: 'label.history.bet',
|
|
129
132
|
defaultMessage: 'Bet: {value}',
|
|
130
133
|
values: {
|
|
131
|
-
value: React.createElement(Money, { value: item.Bet, currency:
|
|
134
|
+
value: React.createElement(Money, { value: item.Bet, currency: item.Currency })
|
|
132
135
|
}
|
|
133
136
|
}), React.createElement(Translate, {
|
|
134
137
|
tag: 'div',
|
|
135
138
|
id: 'label.history.win',
|
|
136
139
|
defaultMessage: 'Win: {value}',
|
|
137
140
|
values: {
|
|
138
|
-
value: React.createElement(Money, { value: item.Win, currency:
|
|
141
|
+
value: React.createElement(Money, { value: item.Win, currency: item.Currency })
|
|
139
142
|
}
|
|
140
143
|
})]];
|
|
141
144
|
} else if (product === 'sportsbook') {
|
|
@@ -164,14 +167,14 @@ var HistoryWidgetList = function (_React$Component) {
|
|
|
164
167
|
id: 'label.history.bet',
|
|
165
168
|
defaultMessage: 'Bet: {value}',
|
|
166
169
|
values: {
|
|
167
|
-
value: React.createElement(Money, { value: item.TotalWager, currency:
|
|
170
|
+
value: React.createElement(Money, { value: item.TotalWager, currency: item.Currency })
|
|
168
171
|
}
|
|
169
172
|
}), React.createElement(Translate, {
|
|
170
173
|
tag: 'div',
|
|
171
174
|
id: 'label.history.win',
|
|
172
175
|
defaultMessage: 'Win: {value}',
|
|
173
176
|
values: {
|
|
174
|
-
value: React.createElement(Money, { value: item.TotalWin, currency:
|
|
177
|
+
value: React.createElement(Money, { value: item.TotalWin, currency: item.Currency })
|
|
175
178
|
}
|
|
176
179
|
})]];
|
|
177
180
|
} else if (product === 'bingo') {
|
|
@@ -204,14 +207,14 @@ var HistoryWidgetList = function (_React$Component) {
|
|
|
204
207
|
id: 'label.history.bet',
|
|
205
208
|
defaultMessage: 'Bet: {value}',
|
|
206
209
|
values: {
|
|
207
|
-
value: React.createElement(Money, { value: item.Bet + item.Rake, currency:
|
|
210
|
+
value: React.createElement(Money, { value: item.Bet + item.Rake, currency: item.Currency })
|
|
208
211
|
}
|
|
209
212
|
}), React.createElement(Translate, {
|
|
210
213
|
tag: 'div',
|
|
211
214
|
id: 'label.history.win',
|
|
212
215
|
defaultMessage: 'Win: {value}',
|
|
213
216
|
values: {
|
|
214
|
-
value: React.createElement(Money, { value: item.Win, currency:
|
|
217
|
+
value: React.createElement(Money, { value: item.Win, currency: item.Currency })
|
|
215
218
|
}
|
|
216
219
|
})]];
|
|
217
220
|
}
|
|
@@ -273,8 +276,7 @@ var HistoryWidgetList = function (_React$Component) {
|
|
|
273
276
|
var _props = this.props,
|
|
274
277
|
items = _props.items,
|
|
275
278
|
product = _props.product,
|
|
276
|
-
limit = _props.limit
|
|
277
|
-
currency = _props.currency;
|
|
279
|
+
limit = _props.limit;
|
|
278
280
|
var page = this.state.page;
|
|
279
281
|
|
|
280
282
|
|
|
@@ -283,8 +285,8 @@ var HistoryWidgetList = function (_React$Component) {
|
|
|
283
285
|
var listItems = pageItems.map(function (item) {
|
|
284
286
|
return {
|
|
285
287
|
id: item,
|
|
286
|
-
info: _this2.createListInfo(item, product,
|
|
287
|
-
detail: _this2.createListDetail(item, product,
|
|
288
|
+
info: _this2.createListInfo(item, product, items.isLoading),
|
|
289
|
+
detail: _this2.createListDetail(item, product, items.isLoading)
|
|
288
290
|
};
|
|
289
291
|
});
|
|
290
292
|
|
|
@@ -331,7 +333,6 @@ var HistoryWidget = function HistoryWidget(_ref2) {
|
|
|
331
333
|
var getTransactions = _ref2.getTransactions,
|
|
332
334
|
items = _ref2.items,
|
|
333
335
|
products = _ref2.products,
|
|
334
|
-
currency = _ref2.currency,
|
|
335
336
|
limit = _ref2.limit;
|
|
336
337
|
|
|
337
338
|
var accordionItems = products.map(function (product) {
|
|
@@ -339,7 +340,6 @@ var HistoryWidget = function HistoryWidget(_ref2) {
|
|
|
339
340
|
header: getMessage(product),
|
|
340
341
|
content: React.createElement(HistoryWidgetList, {
|
|
341
342
|
product: product,
|
|
342
|
-
currency: currency,
|
|
343
343
|
limit: limit,
|
|
344
344
|
getTransactions: getTransactions[product],
|
|
345
345
|
items: items[product]
|
|
@@ -251,7 +251,7 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
|
|
|
251
251
|
setValue = _useState2[1];
|
|
252
252
|
|
|
253
253
|
useEffect(function () {
|
|
254
|
-
if (newLimit
|
|
254
|
+
if (newLimit) {
|
|
255
255
|
setValue(newLimit.Amount);
|
|
256
256
|
}
|
|
257
257
|
}, [newLimit]);
|
|
@@ -282,7 +282,7 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
|
|
|
282
282
|
});
|
|
283
283
|
}
|
|
284
284
|
// If not blocked from removing limit or 'No limit' option is selected -> add 'No limit' option
|
|
285
|
-
if (!validationState['limit-remove-blocked'] || value === 0) {
|
|
285
|
+
if (!validationState['limit-remove-blocked'] || value === 0 || value === '') {
|
|
286
286
|
options.unshift({
|
|
287
287
|
value: 0,
|
|
288
288
|
label: messages.get('label.responsible-gaming.option.no-limit')
|
|
@@ -319,6 +319,8 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
|
|
|
319
319
|
}
|
|
320
320
|
};
|
|
321
321
|
|
|
322
|
+
var isIphone = typeof window !== 'undefined' && navigator.platform === 'iPhone';
|
|
323
|
+
|
|
322
324
|
return React.createElement(
|
|
323
325
|
Fragment,
|
|
324
326
|
null,
|
|
@@ -352,7 +354,7 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
|
|
|
352
354
|
setValue(parseInt(value));
|
|
353
355
|
if (value > 0) _onChange(value);
|
|
354
356
|
},
|
|
355
|
-
autoFocus:
|
|
357
|
+
autoFocus: !isIphone,
|
|
356
358
|
min: validationState['limit-remove-blocked'] ? '1' : '0',
|
|
357
359
|
max: validationState['limit-increase-blocked'] ? getByPath(currentLimit, 'Amount') : Infinity
|
|
358
360
|
}),
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.format = undefined;
|
|
6
7
|
|
|
7
8
|
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
8
9
|
|
|
@@ -18,13 +19,25 @@ var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
|
18
19
|
|
|
19
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
21
|
|
|
22
|
+
/**
|
|
23
|
+
* For crypto we want more decimals.
|
|
24
|
+
*/
|
|
25
|
+
var fractionDigits = {
|
|
26
|
+
BTC: { min: 5, max: 5 },
|
|
27
|
+
LTC: { min: 5, max: 5 },
|
|
28
|
+
XBC: { min: 5, max: 5 },
|
|
29
|
+
ETH: { min: 5, max: 5 },
|
|
30
|
+
BCH: { min: 5, max: 5 },
|
|
31
|
+
XRP: { min: 3, max: 3 }
|
|
32
|
+
};
|
|
33
|
+
|
|
21
34
|
/**
|
|
22
35
|
* FormattedNumber component to display currency
|
|
23
36
|
*/
|
|
24
37
|
var Money = function Money(props) {
|
|
25
38
|
return _react2.default.createElement(_reactIntl.FormattedNumber, _extends({
|
|
26
|
-
minimumFractionDigits: props.decimals ? 2 : 0,
|
|
27
|
-
maximumFractionDigits: props.decimals ? 2 : 0
|
|
39
|
+
minimumFractionDigits: props.decimals ? fractionDigits[props.currency] && fractionDigits[props.currency].min || 2 : 0,
|
|
40
|
+
maximumFractionDigits: props.decimals ? fractionDigits[props.currency] && fractionDigits[props.currency].max || 2 : 0
|
|
28
41
|
}, props, {
|
|
29
42
|
style: 'currency'
|
|
30
43
|
}));
|
|
@@ -48,4 +61,14 @@ Money.defaultProps = {
|
|
|
48
61
|
decimals: true
|
|
49
62
|
};
|
|
50
63
|
|
|
64
|
+
var format = exports.format = function format(currency) {
|
|
65
|
+
var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en-US';
|
|
66
|
+
return new Intl.NumberFormat(locale, {
|
|
67
|
+
style: 'currency',
|
|
68
|
+
currency: currency,
|
|
69
|
+
minimumFractionDigits: fractionDigits[currency] ? fractionDigits[currency].min : null,
|
|
70
|
+
maximumFractionDigits: fractionDigits[currency] ? fractionDigits[currency].max : null
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
|
|
51
74
|
exports.default = Money;
|
package/lib/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.AutocompleteInput = exports.Skeleton = exports.countryEmojiFlags = exports.Picture = exports.Translate = exports.VerifyAccordionWidget = exports.List = exports.ResponsibleGamingWidget = exports.ResponsibleGamingSingleSignUp = exports.ResponsibleGamingAccordionSignUp = exports.ResponsibleGamingAccordion = exports.WithdrawWidgetAccordion = exports.DepositWidgetAccordion = exports.SportsbookHistoryTable = exports.PaymentHistoryTable = exports.CasinoHistoryTable = exports.Subscriptions = exports.Verify = exports.TableWidget = exports.Settings = exports.Pagination = exports.SignIn = exports.RequestResetPassword = exports.ResetPassword = exports.ChangePassword = exports.ChangeUsername = exports.SignUp = exports.Withdraw = exports.Deposit = exports.Bonus = exports.Balance = exports.ActivateWidget = exports.AccountDetail = exports.AccordionWidget = exports.Uploader = exports.Textarea = exports.Single = exports.Select = exports.Radio = exports.Notification = exports.Money = exports.Loader = exports.InternalMessagesInbox = exports.Input = exports.Image = exports.Icon = exports.Checklist = exports.ButtonLoader = exports.Button = exports.Alert = exports.AcceptUpdatedTaC =
|
|
6
|
+
exports.AutocompleteInput = exports.Skeleton = exports.countryEmojiFlags = exports.Picture = exports.Translate = exports.VerifyAccordionWidget = exports.List = exports.ResponsibleGamingWidget = exports.ResponsibleGamingSingleSignUp = exports.ResponsibleGamingAccordionSignUp = exports.ResponsibleGamingAccordion = exports.WithdrawWidgetAccordion = exports.DepositWidgetAccordion = exports.SportsbookHistoryTable = exports.PaymentHistoryTable = exports.CasinoHistoryTable = exports.Subscriptions = exports.Verify = exports.TableWidget = exports.Settings = exports.Pagination = exports.SignIn = exports.RequestResetPassword = exports.ResetPassword = exports.ChangePassword = exports.ChangeUsername = exports.SignUp = exports.Withdraw = exports.Deposit = exports.Bonus = exports.Balance = exports.ActivateWidget = exports.AccountDetail = exports.AccordionWidget = exports.Uploader = exports.Textarea = exports.Single = exports.Select = exports.Radio = exports.Notification = exports.Money = exports.Loader = exports.InternalMessagesInbox = exports.Input = exports.Image = exports.Icon = exports.Checklist = exports.ButtonLoader = exports.Button = exports.Alert = exports.AcceptUpdatedTaC = undefined;
|
|
7
7
|
|
|
8
8
|
var _AcceptUpdatedTaC = require('./components/AcceptUpdatedTaC');
|
|
9
9
|
|
|
@@ -205,19 +205,12 @@ var _VerifyAccordionWidget = require('./widgets/VerifyAccordionWidget');
|
|
|
205
205
|
|
|
206
206
|
var _VerifyAccordionWidget2 = _interopRequireDefault(_VerifyAccordionWidget);
|
|
207
207
|
|
|
208
|
-
var _BonusOffers = require('./widgets/BonusOffers');
|
|
209
|
-
|
|
210
|
-
var _BonusOffers2 = _interopRequireDefault(_BonusOffers);
|
|
211
|
-
|
|
212
208
|
var _countryEmojiFlags = require('./misc/countryEmojiFlags');
|
|
213
209
|
|
|
214
210
|
var _countryEmojiFlags2 = _interopRequireDefault(_countryEmojiFlags);
|
|
215
211
|
|
|
216
212
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
217
213
|
|
|
218
|
-
// widgets
|
|
219
|
-
// components
|
|
220
|
-
exports.BonusOffers = _BonusOffers2.default;
|
|
221
214
|
exports.AcceptUpdatedTaC = _AcceptUpdatedTaC2.default;
|
|
222
215
|
exports.Alert = _Alert2.default;
|
|
223
216
|
exports.Button = _Button2.default;
|
|
@@ -270,4 +263,8 @@ exports.countryEmojiFlags = _countryEmojiFlags2.default;
|
|
|
270
263
|
exports.Skeleton = _Skeleton2.default;
|
|
271
264
|
exports.AutocompleteInput = _AutocompleteInput2.default;
|
|
272
265
|
|
|
273
|
-
// misc
|
|
266
|
+
// misc
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
// widgets
|
|
270
|
+
// components
|
|
@@ -13,55 +13,51 @@ var MILISECONDS = {
|
|
|
13
13
|
IN_A_YEAR: 31536000000
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
var selectUnit = exports.selectUnit = function selectUnit(
|
|
17
|
-
var isFuture = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
18
|
-
|
|
16
|
+
var selectUnit = exports.selectUnit = function selectUnit(from) {
|
|
19
17
|
var now = Date.now();
|
|
20
|
-
var ms =
|
|
21
|
-
|
|
22
|
-
var operatorCalc = isFuture ? 1 : -1;
|
|
18
|
+
var ms = now - from;
|
|
23
19
|
|
|
24
20
|
switch (true) {
|
|
25
21
|
case MILISECONDS.IN_A_SECOND < ms && ms < MILISECONDS.IN_A_MINUTE:
|
|
26
22
|
return {
|
|
27
|
-
value:
|
|
23
|
+
value: -1 * Math.floor(ms / MILISECONDS.IN_A_SECOND),
|
|
28
24
|
unit: 'second',
|
|
29
25
|
updateIntervalInSeconds: 1
|
|
30
26
|
};
|
|
31
27
|
|
|
32
28
|
case MILISECONDS.IN_A_MINUTE < ms && ms < MILISECONDS.IN_AN_HOUR:
|
|
33
29
|
return {
|
|
34
|
-
value:
|
|
30
|
+
value: -1 * Math.floor(ms / MILISECONDS.IN_A_MINUTE),
|
|
35
31
|
unit: 'minute'
|
|
36
32
|
};
|
|
37
33
|
|
|
38
34
|
case MILISECONDS.IN_AN_HOUR < ms && ms < MILISECONDS.IN_A_DAY:
|
|
39
35
|
return {
|
|
40
|
-
value:
|
|
36
|
+
value: -1 * Math.floor(ms / MILISECONDS.IN_AN_HOUR),
|
|
41
37
|
unit: 'hour'
|
|
42
38
|
};
|
|
43
39
|
|
|
44
40
|
case MILISECONDS.IN_A_DAY < ms && ms < MILISECONDS.IN_A_WEEK:
|
|
45
41
|
return {
|
|
46
|
-
value:
|
|
42
|
+
value: -1 * Math.floor(ms / MILISECONDS.IN_A_DAY),
|
|
47
43
|
unit: 'day'
|
|
48
44
|
};
|
|
49
45
|
|
|
50
46
|
case MILISECONDS.IN_A_WEEK < ms && ms < MILISECONDS.IN_A_MONTH:
|
|
51
47
|
return {
|
|
52
|
-
value:
|
|
48
|
+
value: -1 * Math.floor(ms / MILISECONDS.IN_A_WEEK),
|
|
53
49
|
unit: 'week'
|
|
54
50
|
};
|
|
55
51
|
|
|
56
52
|
case MILISECONDS.IN_A_MONTH < ms && ms < MILISECONDS.IN_A_YEAR:
|
|
57
53
|
return {
|
|
58
|
-
value:
|
|
54
|
+
value: -1 * Math.floor(ms / MILISECONDS.IN_A_MONTH),
|
|
59
55
|
unit: 'month'
|
|
60
56
|
};
|
|
61
57
|
|
|
62
58
|
case MILISECONDS.IN_A_YEAR < ms:
|
|
63
59
|
return {
|
|
64
|
-
value:
|
|
60
|
+
value: -1 * Math.floor(ms / MILISECONDS.IN_A_YEAR),
|
|
65
61
|
unit: 'year'
|
|
66
62
|
};
|
|
67
63
|
|