tg-core-components 6.2.0-alpha.0 → 6.2.0-crypto.1
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 +90 -42
- 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 +90 -42
- 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
|
@@ -4,13 +4,25 @@ import React from 'react';
|
|
|
4
4
|
import { FormattedNumber } from 'react-intl';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* For crypto we want more decimals.
|
|
9
|
+
*/
|
|
10
|
+
var fractionDigits = {
|
|
11
|
+
BTC: { min: 5, max: 5 },
|
|
12
|
+
LTC: { min: 5, max: 5 },
|
|
13
|
+
XBC: { min: 5, max: 5 },
|
|
14
|
+
ETH: { min: 5, max: 5 },
|
|
15
|
+
BCH: { min: 5, max: 5 },
|
|
16
|
+
XRP: { min: 3, max: 3 }
|
|
17
|
+
};
|
|
18
|
+
|
|
7
19
|
/**
|
|
8
20
|
* FormattedNumber component to display currency
|
|
9
21
|
*/
|
|
10
22
|
var Money = function Money(props) {
|
|
11
23
|
return React.createElement(FormattedNumber, _extends({
|
|
12
|
-
minimumFractionDigits: props.decimals ? 2 : 0,
|
|
13
|
-
maximumFractionDigits: props.decimals ? 2 : 0
|
|
24
|
+
minimumFractionDigits: props.decimals ? fractionDigits[props.currency] && fractionDigits[props.currency].min || 2 : 0,
|
|
25
|
+
maximumFractionDigits: props.decimals ? fractionDigits[props.currency] && fractionDigits[props.currency].max || 2 : 0
|
|
14
26
|
}, props, {
|
|
15
27
|
style: 'currency'
|
|
16
28
|
}));
|
|
@@ -34,4 +46,14 @@ Money.defaultProps = {
|
|
|
34
46
|
decimals: true
|
|
35
47
|
};
|
|
36
48
|
|
|
49
|
+
export var format = function format(currency) {
|
|
50
|
+
var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en-US';
|
|
51
|
+
return new Intl.NumberFormat(locale, {
|
|
52
|
+
style: 'currency',
|
|
53
|
+
currency: currency,
|
|
54
|
+
minimumFractionDigits: fractionDigits[currency] ? fractionDigits[currency].min : null,
|
|
55
|
+
maximumFractionDigits: fractionDigits[currency] ? fractionDigits[currency].max : null
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
|
|
37
59
|
export default Money;
|
package/es/index.js
CHANGED
|
@@ -51,9 +51,8 @@ import ResponsibleGamingAccordionSignUp from './widgets/ResponsibleGamingAccordi
|
|
|
51
51
|
import ResponsibleGamingSingleSignUp from './widgets/ResponsibleGamingSingleSignUp';
|
|
52
52
|
import ResponsibleGamingWidget from './widgets/ResponsibleGamingWidget';
|
|
53
53
|
import VerifyAccordionWidget from './widgets/VerifyAccordionWidget';
|
|
54
|
-
import BonusOffers from './widgets/BonusOffers';
|
|
55
54
|
|
|
56
55
|
// misc
|
|
57
56
|
import countryEmojiFlags from './misc/countryEmojiFlags';
|
|
58
57
|
|
|
59
|
-
export {
|
|
58
|
+
export { AcceptUpdatedTaC, Alert, Button, ButtonLoader, Checklist, Icon, Image, Input, InternalMessagesInbox, Loader, Money, Notification, Radio, Select, Single, Textarea, Uploader, AccordionWidget, AccountDetail, ActivateWidget, Balance, Bonus, Deposit, Withdraw, SignUp, ChangeUsername, ChangePassword, ResetPassword, RequestResetPassword, SignIn, Pagination, Settings, TableWidget, Verify, Subscriptions, CasinoHistoryTable, PaymentHistoryTable, SportsbookHistoryTable, DepositWidgetAccordion, WithdrawWidgetAccordion, ResponsibleGamingAccordion, ResponsibleGamingAccordionSignUp, ResponsibleGamingSingleSignUp, ResponsibleGamingWidget, List, VerifyAccordionWidget, Translate, Picture, countryEmojiFlags, Skeleton, AutocompleteInput };
|
|
@@ -8,55 +8,51 @@ var MILISECONDS = {
|
|
|
8
8
|
IN_A_YEAR: 31536000000
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
export var selectUnit = function selectUnit(
|
|
12
|
-
var isFuture = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
13
|
-
|
|
11
|
+
export var selectUnit = function selectUnit(from) {
|
|
14
12
|
var now = Date.now();
|
|
15
|
-
var ms =
|
|
16
|
-
|
|
17
|
-
var operatorCalc = isFuture ? 1 : -1;
|
|
13
|
+
var ms = now - from;
|
|
18
14
|
|
|
19
15
|
switch (true) {
|
|
20
16
|
case MILISECONDS.IN_A_SECOND < ms && ms < MILISECONDS.IN_A_MINUTE:
|
|
21
17
|
return {
|
|
22
|
-
value:
|
|
18
|
+
value: -1 * Math.floor(ms / MILISECONDS.IN_A_SECOND),
|
|
23
19
|
unit: 'second',
|
|
24
20
|
updateIntervalInSeconds: 1
|
|
25
21
|
};
|
|
26
22
|
|
|
27
23
|
case MILISECONDS.IN_A_MINUTE < ms && ms < MILISECONDS.IN_AN_HOUR:
|
|
28
24
|
return {
|
|
29
|
-
value:
|
|
25
|
+
value: -1 * Math.floor(ms / MILISECONDS.IN_A_MINUTE),
|
|
30
26
|
unit: 'minute'
|
|
31
27
|
};
|
|
32
28
|
|
|
33
29
|
case MILISECONDS.IN_AN_HOUR < ms && ms < MILISECONDS.IN_A_DAY:
|
|
34
30
|
return {
|
|
35
|
-
value:
|
|
31
|
+
value: -1 * Math.floor(ms / MILISECONDS.IN_AN_HOUR),
|
|
36
32
|
unit: 'hour'
|
|
37
33
|
};
|
|
38
34
|
|
|
39
35
|
case MILISECONDS.IN_A_DAY < ms && ms < MILISECONDS.IN_A_WEEK:
|
|
40
36
|
return {
|
|
41
|
-
value:
|
|
37
|
+
value: -1 * Math.floor(ms / MILISECONDS.IN_A_DAY),
|
|
42
38
|
unit: 'day'
|
|
43
39
|
};
|
|
44
40
|
|
|
45
41
|
case MILISECONDS.IN_A_WEEK < ms && ms < MILISECONDS.IN_A_MONTH:
|
|
46
42
|
return {
|
|
47
|
-
value:
|
|
43
|
+
value: -1 * Math.floor(ms / MILISECONDS.IN_A_WEEK),
|
|
48
44
|
unit: 'week'
|
|
49
45
|
};
|
|
50
46
|
|
|
51
47
|
case MILISECONDS.IN_A_MONTH < ms && ms < MILISECONDS.IN_A_YEAR:
|
|
52
48
|
return {
|
|
53
|
-
value:
|
|
49
|
+
value: -1 * Math.floor(ms / MILISECONDS.IN_A_MONTH),
|
|
54
50
|
unit: 'month'
|
|
55
51
|
};
|
|
56
52
|
|
|
57
53
|
case MILISECONDS.IN_A_YEAR < ms:
|
|
58
54
|
return {
|
|
59
|
-
value:
|
|
55
|
+
value: -1 * Math.floor(ms / MILISECONDS.IN_A_YEAR),
|
|
60
56
|
unit: 'year'
|
|
61
57
|
};
|
|
62
58
|
|
|
@@ -9,7 +9,7 @@ var translate = function translate(_ref, intl) {
|
|
|
9
9
|
values = _ref.values,
|
|
10
10
|
rest = _objectWithoutProperties(_ref, ['id', 'values']);
|
|
11
11
|
|
|
12
|
-
var cacheId = id + (JSON.stringify(values) || '');
|
|
12
|
+
var cacheId = id + (typeof intl !== 'undefined' ? intl.locale : '') + (JSON.stringify(values) || '');
|
|
13
13
|
if (cache[cacheId]) return cache[cacheId];
|
|
14
14
|
|
|
15
15
|
var g = typeof window !== 'undefined' && window || typeof global !== 'undefined' && global || {};
|
|
@@ -9,6 +9,7 @@ export default {
|
|
|
9
9
|
AG: '🇦🇬',
|
|
10
10
|
AU: '🇦🇺',
|
|
11
11
|
AT: '🇦🇹',
|
|
12
|
+
AW: '🇦🇼',
|
|
12
13
|
AZ: '🇦🇿',
|
|
13
14
|
BI: '🇧🇮',
|
|
14
15
|
BE: '🇧🇪',
|
|
@@ -24,6 +25,7 @@ export default {
|
|
|
24
25
|
BO: '🇧🇴',
|
|
25
26
|
BR: '🇧🇷',
|
|
26
27
|
BB: '🇧🇧',
|
|
28
|
+
BM: '🇧🇲',
|
|
27
29
|
BN: '🇧🇳',
|
|
28
30
|
BT: '🇧🇹',
|
|
29
31
|
BW: '🇧🇼',
|
|
@@ -33,6 +35,7 @@ export default {
|
|
|
33
35
|
CL: '🇨🇱',
|
|
34
36
|
CN: '🇨🇳',
|
|
35
37
|
CI: '🇨🇮',
|
|
38
|
+
CK: '🇨🇰',
|
|
36
39
|
CM: '🇨🇲',
|
|
37
40
|
CD: '🇨🇩',
|
|
38
41
|
CG: '🇨🇬',
|
|
@@ -167,6 +170,7 @@ export default {
|
|
|
167
170
|
SZ: '🇸🇿',
|
|
168
171
|
SC: '🇸🇨',
|
|
169
172
|
SY: '🇸🇾',
|
|
173
|
+
TC: '🇹🇨',
|
|
170
174
|
TD: '🇹🇩',
|
|
171
175
|
TG: '🇹🇬',
|
|
172
176
|
TH: '🇹🇭',
|
|
@@ -178,6 +182,7 @@ export default {
|
|
|
178
182
|
TN: '🇹🇳',
|
|
179
183
|
TR: '🇹🇷',
|
|
180
184
|
TV: '🇹🇻',
|
|
185
|
+
TW: '🇹🇼',
|
|
181
186
|
TZ: '🇹🇿',
|
|
182
187
|
UG: '🇺🇬',
|
|
183
188
|
UA: '🇺🇦',
|
|
@@ -12,13 +12,10 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
|
|
|
12
12
|
|
|
13
13
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
14
14
|
|
|
15
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
|
-
|
|
17
15
|
import React, { Component, useState } from 'react';
|
|
18
16
|
import PropTypes from 'prop-types';
|
|
19
17
|
import AnimateHeight from 'react-animate-height';
|
|
20
18
|
import Icon from '../../components/Icon';
|
|
21
|
-
import cn from 'classnames';
|
|
22
19
|
|
|
23
20
|
var AccordionHeader = function AccordionHeader(_ref) {
|
|
24
21
|
var expanded = _ref.expanded,
|
|
@@ -86,14 +83,10 @@ var AccordionContent = function AccordionContent(_ref2) {
|
|
|
86
83
|
var AccordionItem = function AccordionItem(_ref3) {
|
|
87
84
|
var header = _ref3.header,
|
|
88
85
|
content = _ref3.content,
|
|
89
|
-
expanded = _ref3.expanded
|
|
90
|
-
customClass = _ref3.customClass;
|
|
86
|
+
expanded = _ref3.expanded;
|
|
91
87
|
return React.createElement(
|
|
92
88
|
'div',
|
|
93
|
-
{
|
|
94
|
-
className: cn('AccordionItem', _defineProperty({
|
|
95
|
-
'AccordionItem--expanded': expanded
|
|
96
|
-
}, 'AccordionItem--' + customClass, customClass)) },
|
|
89
|
+
{ className: 'AccordionItem' + (expanded ? ' AccordionItem--expanded' : '') },
|
|
97
90
|
header,
|
|
98
91
|
content
|
|
99
92
|
);
|
|
@@ -182,8 +175,7 @@ var Accordion = function (_Component) {
|
|
|
182
175
|
animationDuration: animationDuration,
|
|
183
176
|
contentCollapsedHeight: contentCollapsedHeight
|
|
184
177
|
}),
|
|
185
|
-
key: index
|
|
186
|
-
customClass: item.customClass
|
|
178
|
+
key: index
|
|
187
179
|
};
|
|
188
180
|
});
|
|
189
181
|
|
|
@@ -11,6 +11,32 @@ import Button from '../../components/Button';
|
|
|
11
11
|
import countryEmojiFlags from '../../misc/countryEmojiFlags';
|
|
12
12
|
import Icon from '../../components/Icon';
|
|
13
13
|
|
|
14
|
+
var genders = [{
|
|
15
|
+
label: function label(intl) {
|
|
16
|
+
return translate({
|
|
17
|
+
id: 'noun.male',
|
|
18
|
+
defaultMessage: 'Male'
|
|
19
|
+
}, intl);
|
|
20
|
+
},
|
|
21
|
+
value: 'Male'
|
|
22
|
+
}, {
|
|
23
|
+
label: function label(intl) {
|
|
24
|
+
return translate({
|
|
25
|
+
id: 'noun.female',
|
|
26
|
+
defaultMessage: 'Female'
|
|
27
|
+
}, intl);
|
|
28
|
+
},
|
|
29
|
+
value: 'Female'
|
|
30
|
+
}, {
|
|
31
|
+
label: function label(intl) {
|
|
32
|
+
return translate({
|
|
33
|
+
id: 'noun.other',
|
|
34
|
+
defaultMessage: 'Other'
|
|
35
|
+
}, intl);
|
|
36
|
+
},
|
|
37
|
+
value: 'Other'
|
|
38
|
+
}];
|
|
39
|
+
|
|
14
40
|
var AccountDetail = function AccountDetail(_ref) {
|
|
15
41
|
var data = _ref.data,
|
|
16
42
|
intl = _ref.intl,
|
|
@@ -18,7 +44,8 @@ var AccountDetail = function AccountDetail(_ref) {
|
|
|
18
44
|
onSubmit = _ref.onSubmit,
|
|
19
45
|
jurisdiction = _ref.jurisdiction,
|
|
20
46
|
countries = _ref.countries,
|
|
21
|
-
isLoading = _ref.isLoading
|
|
47
|
+
isLoading = _ref.isLoading,
|
|
48
|
+
isComplete = _ref.isComplete;
|
|
22
49
|
|
|
23
50
|
return React.createElement(
|
|
24
51
|
'form',
|
|
@@ -93,33 +120,24 @@ var AccountDetail = function AccountDetail(_ref) {
|
|
|
93
120
|
React.createElement(
|
|
94
121
|
Select,
|
|
95
122
|
{
|
|
96
|
-
disabled:
|
|
123
|
+
disabled: isComplete,
|
|
97
124
|
className: 'layout-item-6',
|
|
98
|
-
value:
|
|
99
|
-
return c.value === data.Country;
|
|
100
|
-
}) && countries.value.find(function (c) {
|
|
101
|
-
return c.value === data.Country;
|
|
102
|
-
}).value,
|
|
125
|
+
value: data.Country,
|
|
103
126
|
label: translate({
|
|
104
127
|
id: 'title.country',
|
|
105
128
|
defaultMessage: 'Country'
|
|
106
129
|
}, intl),
|
|
107
130
|
name: 'Country',
|
|
108
131
|
icon: React.createElement(Icon, { icon: 'flag' }) },
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return c.value === data.Country;
|
|
119
|
-
}) && countries.value.find(function (c) {
|
|
120
|
-
return c.value === data.Country;
|
|
121
|
-
}).label
|
|
122
|
-
)
|
|
132
|
+
countries.sort(function (a, b) {
|
|
133
|
+
return a.label.localeCompare(b.label);
|
|
134
|
+
}).map(function (c) {
|
|
135
|
+
return React.createElement(
|
|
136
|
+
Select.Option,
|
|
137
|
+
{ key: c.value, value: c.value },
|
|
138
|
+
c.label
|
|
139
|
+
);
|
|
140
|
+
})
|
|
123
141
|
),
|
|
124
142
|
React.createElement(Input, {
|
|
125
143
|
disabled: true,
|
|
@@ -132,15 +150,6 @@ var AccountDetail = function AccountDetail(_ref) {
|
|
|
132
150
|
name: 'BirthDate'
|
|
133
151
|
})
|
|
134
152
|
),
|
|
135
|
-
React.createElement(Input, {
|
|
136
|
-
disabled: true,
|
|
137
|
-
value: data.Email,
|
|
138
|
-
label: translate({
|
|
139
|
-
id: 'title.email',
|
|
140
|
-
defaultMessage: 'Email'
|
|
141
|
-
}, intl),
|
|
142
|
-
name: 'Email'
|
|
143
|
-
}),
|
|
144
153
|
React.createElement(Input, {
|
|
145
154
|
value: data.MobilePhoneNumber,
|
|
146
155
|
type: 'tel',
|
|
@@ -148,19 +157,53 @@ var AccountDetail = function AccountDetail(_ref) {
|
|
|
148
157
|
id: 'title.mobile_number',
|
|
149
158
|
defaultMessage: 'Mobile number'
|
|
150
159
|
}, intl),
|
|
151
|
-
callingCodes: countries ? countries.value.sort(function (a, b) {
|
|
152
|
-
return Number(a.callingCode) - Number(b.callingCode);
|
|
153
|
-
}).map(function (i) {
|
|
154
|
-
return {
|
|
155
|
-
value: '00' + i.callingCode,
|
|
156
|
-
label: '+' + i.callingCode + ' ' + (countryEmojiFlags[i.value] || '')
|
|
157
|
-
};
|
|
158
|
-
}) : [],
|
|
159
160
|
name: 'MobilePhoneNumber',
|
|
160
161
|
autoComplete: 'off',
|
|
161
162
|
status: errors.MobilePhoneNumber && 'failure' || 'idle',
|
|
162
163
|
statusText: errors.MobilePhoneNumber && translate({ id: errors.MobilePhoneNumber }, intl)
|
|
163
164
|
}),
|
|
165
|
+
React.createElement(
|
|
166
|
+
'div',
|
|
167
|
+
{ className: 'layout-item' },
|
|
168
|
+
React.createElement(Input, {
|
|
169
|
+
className: 'layout-item-6',
|
|
170
|
+
disabled: true,
|
|
171
|
+
value: data.Email,
|
|
172
|
+
label: translate({
|
|
173
|
+
id: 'title.email',
|
|
174
|
+
defaultMessage: 'Email'
|
|
175
|
+
}, intl),
|
|
176
|
+
name: 'Email'
|
|
177
|
+
}),
|
|
178
|
+
React.createElement(
|
|
179
|
+
Select,
|
|
180
|
+
{
|
|
181
|
+
className: 'layout-item-6',
|
|
182
|
+
value: data.Gender,
|
|
183
|
+
label: translate({
|
|
184
|
+
id: 'title.gender',
|
|
185
|
+
defaultMessage: 'Gender'
|
|
186
|
+
}, intl),
|
|
187
|
+
name: 'Gender',
|
|
188
|
+
status: errors.Gender && 'failure' || 'idle',
|
|
189
|
+
statusText: errors.Gender && translate({ id: errors.Gender }, intl) },
|
|
190
|
+
React.createElement(
|
|
191
|
+
Select.Option,
|
|
192
|
+
{ value: '', disabled: true },
|
|
193
|
+
translate({
|
|
194
|
+
id: 'label.select-gender',
|
|
195
|
+
defaultMessage: 'Select gender'
|
|
196
|
+
}, intl)
|
|
197
|
+
),
|
|
198
|
+
genders.map(function (gender) {
|
|
199
|
+
return React.createElement(
|
|
200
|
+
Select.Option,
|
|
201
|
+
{ value: gender.value },
|
|
202
|
+
gender.label(intl)
|
|
203
|
+
);
|
|
204
|
+
})
|
|
205
|
+
)
|
|
206
|
+
),
|
|
164
207
|
!['sga', 'dga'].includes(jurisdiction) && React.createElement(
|
|
165
208
|
Fragment,
|
|
166
209
|
null,
|
|
@@ -175,7 +218,7 @@ var AccountDetail = function AccountDetail(_ref) {
|
|
|
175
218
|
name: 'Password',
|
|
176
219
|
status: errors.Password && 'failure' || 'idle',
|
|
177
220
|
statusText: errors.Password && translate({ id: errors.Password }, intl),
|
|
178
|
-
|
|
221
|
+
autocomplete: 'new-password'
|
|
179
222
|
})
|
|
180
223
|
),
|
|
181
224
|
React.createElement(
|
|
@@ -206,7 +249,9 @@ AccountDetail.propTypes = {
|
|
|
206
249
|
/** Array of validation errors where the error display depends on which invalid rule it breaks */
|
|
207
250
|
error: PropTypes.array,
|
|
208
251
|
/** The submission function firing when submitting the form */
|
|
209
|
-
onSubmit: PropTypes.func
|
|
252
|
+
onSubmit: PropTypes.func,
|
|
253
|
+
/** If the user profile is complete or not */
|
|
254
|
+
isComplete: PropTypes.bool
|
|
210
255
|
};
|
|
211
256
|
|
|
212
257
|
AccountDetail.defaultProps = {
|
|
@@ -216,7 +261,8 @@ AccountDetail.defaultProps = {
|
|
|
216
261
|
value: '',
|
|
217
262
|
name: '',
|
|
218
263
|
error: [],
|
|
219
|
-
onSubmit: Function
|
|
264
|
+
onSubmit: Function,
|
|
265
|
+
isComplete: false
|
|
220
266
|
};
|
|
221
267
|
|
|
222
268
|
var rules = {
|
|
@@ -224,7 +270,9 @@ var rules = {
|
|
|
224
270
|
Address1: [[require, 'error.empty.address']],
|
|
225
271
|
Zip: [[require, 'error.empty.zip_code']],
|
|
226
272
|
City: [[require, 'error.empty.city']],
|
|
227
|
-
Password: [[require, 'error.empty.password']]
|
|
273
|
+
Password: [[require, 'error.empty.password']],
|
|
274
|
+
Country: [[require, 'error.empty.country']],
|
|
275
|
+
Gender: [[require, 'error.empty.gender']]
|
|
228
276
|
};
|
|
229
277
|
|
|
230
278
|
export default compose(WithValidation(rules), injectIntl)(AccountDetail);
|
|
@@ -54,7 +54,7 @@ var ActivationCode = function ActivationCode(_ref) {
|
|
|
54
54
|
}, [autoFocus, code]);
|
|
55
55
|
|
|
56
56
|
useEffect(function () {
|
|
57
|
-
|
|
57
|
+
inputRef.current.value = code;
|
|
58
58
|
}, [code]);
|
|
59
59
|
|
|
60
60
|
var setCaretPosition = function setCaretPosition(from, to) {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
|
|
2
2
|
|
|
3
|
-
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
|
4
|
-
|
|
5
3
|
import React, { useState } from 'react';
|
|
6
4
|
import { FormattedNumber, FormattedDate } from 'react-intl';
|
|
7
5
|
import AccordionWidget from '../AccordionWidget';
|
|
@@ -9,7 +7,9 @@ import Button from '../../components/Button';
|
|
|
9
7
|
import BonusCode from './BonusCode';
|
|
10
8
|
import { List } from 'tg-core-components';
|
|
11
9
|
import Translate from '../../components/Translate';
|
|
10
|
+
import Money from '../../components/Money';
|
|
12
11
|
import { getBonusState } from './states';
|
|
12
|
+
import { getBonusType } from './types';
|
|
13
13
|
import marked from 'marked';
|
|
14
14
|
|
|
15
15
|
var ALEACC_BONUS_CLAIM_STATE = ['Initiated', 'PreClaimed'];
|
|
@@ -129,10 +129,7 @@ var BonusWidget = function BonusWidget(_ref3) {
|
|
|
129
129
|
var bonuses = _ref3.bonuses,
|
|
130
130
|
handleBonusCodeSubmit = _ref3.handleBonusCodeSubmit,
|
|
131
131
|
onClaimBonus = _ref3.onClaimBonus,
|
|
132
|
-
onRejectBonus = _ref3.onRejectBonus
|
|
133
|
-
_ref3$exclude = _ref3.exclude,
|
|
134
|
-
exclude = _ref3$exclude === undefined ? [] : _ref3$exclude,
|
|
135
|
-
disableBonusCodeForm = _ref3.disableBonusCodeForm;
|
|
132
|
+
onRejectBonus = _ref3.onRejectBonus;
|
|
136
133
|
|
|
137
134
|
var bonusList = { active: null, available: null, finished: null };
|
|
138
135
|
|
|
@@ -162,10 +159,11 @@ var BonusWidget = function BonusWidget(_ref3) {
|
|
|
162
159
|
var info = [[React.createElement(
|
|
163
160
|
'div',
|
|
164
161
|
null,
|
|
165
|
-
React.createElement(
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
162
|
+
React.createElement(
|
|
163
|
+
'span',
|
|
164
|
+
null,
|
|
165
|
+
item.Name || item.Description
|
|
166
|
+
)
|
|
169
167
|
), React.createElement(
|
|
170
168
|
'div',
|
|
171
169
|
null,
|
|
@@ -173,15 +171,8 @@ var BonusWidget = function BonusWidget(_ref3) {
|
|
|
173
171
|
)], [React.createElement(
|
|
174
172
|
'div',
|
|
175
173
|
{ className: 'amount' },
|
|
176
|
-
React.createElement(FormattedNumber, {
|
|
177
|
-
|
|
178
|
-
style: item.Type.toLowerCase() == 'freespins' ? 'decimal' : 'currency',
|
|
179
|
-
currency: item.Currency
|
|
180
|
-
})
|
|
181
|
-
), React.createElement(Translate, {
|
|
182
|
-
id: 'label.type.bonus.' + item.Type.toLowerCase(),
|
|
183
|
-
defaultMessage: item.Type.toLowerCase()
|
|
184
|
-
})]];
|
|
174
|
+
item.Type.toLowerCase() == 'freespins' ? React.createElement(FormattedNumber, { value: item.Amount, style: 'decimal' }) : React.createElement(Money, { value: item.Amount, currency: item.Currency })
|
|
175
|
+
), getBonusType(item.Type)]];
|
|
185
176
|
|
|
186
177
|
// Add bonus actions to not expired Fasttrack bonuses
|
|
187
178
|
if (item.Provider === 'fasttrack' && item.State !== 'Expired') info.push(React.createElement(BonusActionFT, { bonus: item, onClaimBonus: onClaimBonus }));
|
|
@@ -267,25 +258,19 @@ var BonusWidget = function BonusWidget(_ref3) {
|
|
|
267
258
|
|
|
268
259
|
var menu = {
|
|
269
260
|
identifier: 'account-history',
|
|
270
|
-
items: [
|
|
261
|
+
items: [{
|
|
271
262
|
name: React.createElement(Translate, { id: 'label.active', defaultMessage: 'Activate' }),
|
|
272
263
|
content: React.createElement(List, { data: bonusList['active'], noData: 'list.no_data.active' })
|
|
273
|
-
}
|
|
264
|
+
}, {
|
|
274
265
|
name: React.createElement(Translate, { id: 'label.available', defaultMessage: 'Available' }),
|
|
275
|
-
content: React.createElement(List, {
|
|
276
|
-
|
|
277
|
-
noData: 'list.no_data.available'
|
|
278
|
-
})
|
|
279
|
-
}] : []), _toConsumableArray(!exclude.includes('finished') ? [{
|
|
266
|
+
content: React.createElement(List, { data: bonusList['available'], noData: 'list.no_data.available' })
|
|
267
|
+
}, {
|
|
280
268
|
name: React.createElement(Translate, { id: 'label.finished', defaultMessage: 'Finished' }),
|
|
281
|
-
content: React.createElement(List, {
|
|
282
|
-
|
|
283
|
-
noData: 'list.no_data.finished'
|
|
284
|
-
})
|
|
285
|
-
}] : []), _toConsumableArray(disableBonusCodeForm && {
|
|
269
|
+
content: React.createElement(List, { data: bonusList['finished'], noData: 'list.no_data.finished' })
|
|
270
|
+
}, {
|
|
286
271
|
name: React.createElement(Translate, { id: 'label.bonus_code', defaultMessage: 'Bonus code' }),
|
|
287
272
|
content: React.createElement(BonusCode, { handleSubmit: handleBonusCodeSubmit })
|
|
288
|
-
}
|
|
273
|
+
}]
|
|
289
274
|
};
|
|
290
275
|
|
|
291
276
|
var items = menu.items.map(function (item, i) {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Translate from '../../components/Translate';
|
|
3
|
+
|
|
4
|
+
export var getBonusType = function getBonusType(type) {
|
|
5
|
+
var translations = {
|
|
6
|
+
Monetary: React.createElement(Translate, { id: 'label.type.bonus.monetary', defaultMessage: 'Monetary' }),
|
|
7
|
+
Freespins: React.createElement(Translate, { id: 'label.type.bonus.freespins', defaultMessage: 'Freespins' }),
|
|
8
|
+
FreespinsMonetary: React.createElement(Translate, {
|
|
9
|
+
id: 'label.type.bonus.freespinsMonetary',
|
|
10
|
+
defaultMessage: 'Freespins Monetary'
|
|
11
|
+
}),
|
|
12
|
+
FreeBetsMonetary: React.createElement(Translate, {
|
|
13
|
+
id: 'label.type.bonus.freeBetsMonetary',
|
|
14
|
+
defaultMessage: 'Free Bets Monetary'
|
|
15
|
+
})
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return translations[type] || React.createElement(
|
|
19
|
+
'span',
|
|
20
|
+
null,
|
|
21
|
+
type
|
|
22
|
+
);
|
|
23
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
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; };
|
|
2
|
+
|
|
1
3
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
2
4
|
|
|
3
5
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -40,9 +42,11 @@ var InjectedIframeHTML = function (_Component) {
|
|
|
40
42
|
value: function render() {
|
|
41
43
|
var _this2 = this;
|
|
42
44
|
|
|
43
|
-
var
|
|
45
|
+
var _props = this.props,
|
|
46
|
+
data = _props.data,
|
|
47
|
+
iframeProps = _props.iframeProps;
|
|
44
48
|
|
|
45
|
-
return React.createElement('iframe', {
|
|
49
|
+
return React.createElement('iframe', _extends({
|
|
46
50
|
ref: function ref(node) {
|
|
47
51
|
return _this2._iframe = node;
|
|
48
52
|
},
|
|
@@ -50,7 +54,7 @@ var InjectedIframeHTML = function (_Component) {
|
|
|
50
54
|
width: '100%',
|
|
51
55
|
height: data.redirectOutput.height,
|
|
52
56
|
onLoad: this.handleLoad
|
|
53
|
-
});
|
|
57
|
+
}, iframeProps));
|
|
54
58
|
}
|
|
55
59
|
}]);
|
|
56
60
|
|
|
@@ -94,6 +94,7 @@ var PaymentForm = function (_Component) {
|
|
|
94
94
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref3 = PaymentForm.__proto__ || Object.getPrototypeOf(PaymentForm)).call.apply(_ref3, [this].concat(args))), _this), _this.onMessage = function (message) {
|
|
95
95
|
var operatingSystem = _this.props.operatingSystem;
|
|
96
96
|
|
|
97
|
+
console.log({ message: message });
|
|
97
98
|
var data = JSON.parse(message.data);
|
|
98
99
|
|
|
99
100
|
if (data.method === 'OPEN_APP') {
|
|
@@ -124,7 +125,8 @@ var PaymentForm = function (_Component) {
|
|
|
124
125
|
onClose = _props.onClose,
|
|
125
126
|
onSuccess = _props.onSuccess,
|
|
126
127
|
redirect = _props.redirect,
|
|
127
|
-
details = _props.details
|
|
128
|
+
details = _props.details,
|
|
129
|
+
iframeProps = _props.iframeProps;
|
|
128
130
|
|
|
129
131
|
|
|
130
132
|
if (!data.success) {
|
|
@@ -161,19 +163,19 @@ var PaymentForm = function (_Component) {
|
|
|
161
163
|
target: redirect ? '_top' : frameId
|
|
162
164
|
}, data.redirectOutput));
|
|
163
165
|
} else if (data.redirectOutput.container == 'iframe' && data.redirectOutput.method == 'POST' && data.redirectOutput.html != null) {
|
|
164
|
-
return React.createElement(InjectedIframeHTML, { data: data });
|
|
166
|
+
return React.createElement(InjectedIframeHTML, { data: data, iframeProps: iframeProps });
|
|
165
167
|
} else if (data.redirectOutput.container == 'iframe' && data.redirectOutput.method == 'GET' && data.redirectOutput.html != null) {
|
|
166
|
-
return React.createElement(InjectedIframeHTML, { data: data });
|
|
168
|
+
return React.createElement(InjectedIframeHTML, { data: data, iframeProps: iframeProps });
|
|
167
169
|
} else if (data.redirectOutput.container == 'iframe' && data.redirectOutput.method == 'GET' && redirect) {
|
|
168
170
|
window.location.href = data.redirectOutput.url;
|
|
169
171
|
return null;
|
|
170
172
|
} else if (data.redirectOutput.container == 'iframe' && data.redirectOutput.method == 'GET') {
|
|
171
|
-
return React.createElement('iframe', {
|
|
173
|
+
return React.createElement('iframe', _extends({
|
|
172
174
|
src: data.redirectOutput.url,
|
|
173
175
|
width: data.redirectOutput.width,
|
|
174
176
|
height: data.redirectOutput.height,
|
|
175
177
|
frameBorder: '0'
|
|
176
|
-
});
|
|
178
|
+
}, iframeProps));
|
|
177
179
|
} else if (data.redirectOutput.container == 'window' && data.redirectOutput.method == 'POST') {
|
|
178
180
|
return React.createElement(DynamicForm, data.redirectOutput);
|
|
179
181
|
} else if (data.redirectOutput.container == 'window' && data.redirectOutput.method == 'GET') {
|