tg-core-components 5.2.1-history-time-label.0 → 5.3.0-master.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/AcceptUpdatedTaC/index.js +8 -3
- package/es/components/Checkbox/index.js +93 -0
- package/es/components/Deposit/CardInput/index.js +1 -3
- package/es/components/Input/index.js +222 -22
- package/es/components/InputWrapper/index.js +69 -0
- package/es/components/Notification.js +4 -4
- package/es/components/Select/index.js +202 -64
- package/es/components/Select/test.js +111 -0
- package/es/index.js +2 -1
- package/es/lib/utils/translate.js +1 -8
- package/es/widgets/AccountDetail/index.js +53 -77
- package/es/widgets/ActivateWidget/index.js +59 -293
- package/es/widgets/BonusWidget/BonusCode.js +24 -17
- package/es/widgets/BonusWidget/index.js +83 -45
- package/es/widgets/Cashier/Deposit/PaymentForm/NewTab.js +28 -0
- package/es/widgets/Cashier/Deposit/PaymentForm/index.js +6 -2
- package/es/widgets/CashierAccordion/Deposit/BonusCodeInput/index.js +9 -6
- package/es/widgets/CashierAccordion/Deposit/DepositWidget/index.js +19 -29
- package/es/widgets/CashierAccordion/Payment/PaymentAccountForms/index.js +163 -347
- package/es/widgets/CashierAccordion/Payment/PaymentAccountParser.js +0 -6
- package/es/widgets/CashierAccordion/Withdraw/WithdrawWidget/index.js +8 -22
- package/es/widgets/ChangePassword/index.js +53 -40
- package/es/widgets/HistoryWidget/index.js +69 -51
- package/es/widgets/HistoryWidget/message.js +17 -20
- package/es/widgets/RequestResetPassword/index.js +15 -14
- package/es/widgets/ResetPassword/index.js +22 -18
- package/es/widgets/ResponsibleGamingAccordion/LimitStatus/index.js +5 -2
- package/es/widgets/ResponsibleGamingAccordion/PeriodItemContent/index.js +1 -2
- package/es/widgets/ResponsibleGamingSingleSignUp/AmountItem/index.js +1 -2
- package/es/widgets/ResponsibleGamingWidget/Timespan.js +14 -24
- package/es/widgets/ResponsibleGamingWidget/helpers.js +2 -2
- package/es/widgets/ResponsibleGamingWidget/validate.js +1 -1
- package/es/widgets/Settings/index.js +2 -2
- package/es/widgets/SignIn/SignInForm.js +4 -6
- package/es/widgets/SignIn/index.js +21 -21
- package/es/widgets/SignUp/ContactInfoStep.js +5 -6
- package/es/widgets/SportsbookSettings/index.js +10 -24
- package/es/widgets/Subscriptions/index.js +3 -5
- package/lib/components/AcceptUpdatedTaC/index.js +11 -3
- package/lib/components/Checkbox/index.js +106 -0
- package/lib/components/Deposit/CardInput/index.js +1 -3
- package/lib/components/Input/index.js +223 -26
- package/lib/components/InputWrapper/index.js +85 -0
- package/lib/components/Notification.js +3 -3
- package/lib/components/Select/index.js +209 -63
- package/lib/components/Select/test.js +121 -0
- package/lib/index.js +9 -4
- package/lib/lib/utils/translate.js +1 -8
- package/lib/widgets/AccountDetail/index.js +53 -86
- package/lib/widgets/ActivateWidget/index.js +58 -305
- package/lib/widgets/BonusWidget/BonusCode.js +24 -20
- package/lib/widgets/BonusWidget/index.js +85 -44
- package/lib/widgets/Cashier/Deposit/PaymentForm/NewTab.js +44 -0
- package/lib/widgets/Cashier/Deposit/PaymentForm/index.js +9 -2
- package/lib/widgets/CashierAccordion/Deposit/BonusCodeInput/index.js +13 -7
- package/lib/widgets/CashierAccordion/Deposit/DepositWidget/index.js +22 -32
- package/lib/widgets/CashierAccordion/Payment/PaymentAccountForms/index.js +195 -378
- package/lib/widgets/CashierAccordion/Payment/PaymentAccountParser.js +0 -6
- package/lib/widgets/CashierAccordion/Withdraw/WithdrawWidget/index.js +10 -24
- package/lib/widgets/ChangePassword/index.js +53 -43
- package/lib/widgets/HistoryWidget/index.js +69 -51
- package/lib/widgets/HistoryWidget/message.js +17 -20
- package/lib/widgets/RequestResetPassword/index.js +15 -17
- package/lib/widgets/ResetPassword/index.js +25 -21
- package/lib/widgets/ResponsibleGamingAccordion/LimitStatus/index.js +5 -2
- package/lib/widgets/ResponsibleGamingAccordion/PeriodItemContent/index.js +1 -2
- package/lib/widgets/ResponsibleGamingSingleSignUp/AmountItem/index.js +1 -2
- package/lib/widgets/ResponsibleGamingWidget/Timespan.js +14 -24
- package/lib/widgets/ResponsibleGamingWidget/helpers.js +2 -2
- package/lib/widgets/ResponsibleGamingWidget/validate.js +1 -1
- package/lib/widgets/Settings/index.js +6 -6
- package/lib/widgets/SignIn/SignInForm.js +7 -6
- package/lib/widgets/SignIn/index.js +25 -25
- package/lib/widgets/SignUp/ContactInfoStep.js +8 -6
- package/lib/widgets/SportsbookSettings/index.js +10 -24
- package/lib/widgets/Subscriptions/index.js +3 -11
- package/package.json +8 -3
- package/es/components/Input/BirthdateInput.js +0 -171
- package/es/components/Input/Checkbox.js +0 -51
- package/es/components/Input/Input.js +0 -73
- package/es/components/Input/PasswordInput.js +0 -84
- package/es/components/Input/PhoneNumberInput.js +0 -110
- package/es/components/Input/input.test.js +0 -80
- package/es/components/Input/old-input.test.js +0 -100
- package/es/components/common.js +0 -339
- package/lib/components/Input/BirthdateInput.js +0 -192
- package/lib/components/Input/Checkbox.js +0 -65
- package/lib/components/Input/Input.js +0 -87
- package/lib/components/Input/PasswordInput.js +0 -101
- package/lib/components/Input/PhoneNumberInput.js +0 -127
- package/lib/components/Input/input.test.js +0 -89
- package/lib/components/Input/old-input.test.js +0 -107
- package/lib/components/common.js +0 -359
|
@@ -8,7 +8,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
8
8
|
|
|
9
9
|
import React, { PureComponent } from 'react';
|
|
10
10
|
import Input from 'tg-core-components/lib/components/Input';
|
|
11
|
-
import Button from 'tg-core-components/lib/components/Button';
|
|
12
11
|
import compose from 'recompose/compose';
|
|
13
12
|
import { injectIntl } from 'react-intl';
|
|
14
13
|
import WithValidation from 'tg-core-components/lib/lib/WithValidation';
|
|
@@ -54,23 +53,31 @@ var BonusCodeForm = function BonusCodeForm(_ref3) {
|
|
|
54
53
|
return React.createElement(
|
|
55
54
|
'form',
|
|
56
55
|
{ className: 'form', onSubmit: onSubmit },
|
|
57
|
-
React.createElement(Input, {
|
|
58
|
-
label: translate({
|
|
59
|
-
id: 'label.bonus_code',
|
|
60
|
-
defaultMessage: 'Bonus code'
|
|
61
|
-
}, intl),
|
|
62
|
-
type: 'text',
|
|
63
|
-
name: 'bonusCode',
|
|
64
|
-
status: errors.bonusCode && 'failure' || 'idle',
|
|
65
|
-
statusText: errors.bonusCode && translate({ id: errors.bonusCode }, intl)
|
|
66
|
-
}),
|
|
67
56
|
React.createElement(
|
|
68
|
-
|
|
69
|
-
{ className: '
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
57
|
+
'div',
|
|
58
|
+
{ className: 'bonus-code-form' },
|
|
59
|
+
React.createElement(Input, {
|
|
60
|
+
className: 'layout-item',
|
|
61
|
+
title: translate({
|
|
62
|
+
id: 'label.bonus_code',
|
|
63
|
+
defaultMessage: 'Bonus code'
|
|
64
|
+
}, intl),
|
|
65
|
+
type: 'text',
|
|
66
|
+
name: 'bonusCode',
|
|
67
|
+
error: errors.bonusCode && translate({ id: errors.bonusCode }, intl)
|
|
68
|
+
}),
|
|
69
|
+
React.createElement(
|
|
70
|
+
'div',
|
|
71
|
+
{ className: 'layout-item' },
|
|
72
|
+
React.createElement(
|
|
73
|
+
'button',
|
|
74
|
+
{ className: 'button primary wide', type: 'submit' },
|
|
75
|
+
translate({
|
|
76
|
+
id: 'label.activate',
|
|
77
|
+
defaultMessage: 'Activate'
|
|
78
|
+
}, intl)
|
|
79
|
+
)
|
|
80
|
+
)
|
|
74
81
|
)
|
|
75
82
|
);
|
|
76
83
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
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
|
+
|
|
3
|
+
import React, { useState } from 'react';
|
|
2
4
|
import { FormattedNumber, FormattedDate } from 'react-intl';
|
|
3
5
|
import AccordionWidget from '../AccordionWidget';
|
|
4
6
|
import Button from '../../components/Button';
|
|
@@ -6,12 +8,64 @@ import BonusCode from './BonusCode';
|
|
|
6
8
|
import { List } from 'tg-core-components';
|
|
7
9
|
import Translate from '../../components/Translate';
|
|
8
10
|
import { getBonusState } from './states';
|
|
11
|
+
import marked from 'marked';
|
|
12
|
+
|
|
13
|
+
var ALEACC_BONUS_CLAIM_STATE = ['Initiated', 'PreClaimed'];
|
|
14
|
+
var ALEACC_BONUS_REJECT_STATE = ['Initiated', 'PreClaimed', 'Pending', 'PreWager'];
|
|
15
|
+
var ALEACC_BONUS_ACTION_STATE = [].concat(ALEACC_BONUS_CLAIM_STATE, ALEACC_BONUS_REJECT_STATE);
|
|
9
16
|
|
|
10
17
|
var BonusAction = function BonusAction(_ref) {
|
|
11
18
|
var bonus = _ref.bonus,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
onClaimBonus = _ref.onClaimBonus,
|
|
20
|
+
onRejectBonus = _ref.onRejectBonus;
|
|
21
|
+
|
|
22
|
+
var _useState = useState(false),
|
|
23
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
24
|
+
isLoadingClaim = _useState2[0],
|
|
25
|
+
setIsLoadingClaim = _useState2[1];
|
|
26
|
+
|
|
27
|
+
var _useState3 = useState(false),
|
|
28
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
29
|
+
isLoadingReject = _useState4[0],
|
|
30
|
+
setIsLoadingReject = _useState4[1];
|
|
31
|
+
|
|
32
|
+
var claimBonus = function claimBonus(e) {
|
|
33
|
+
onClaimBonus(bonus, function (isLoading) {
|
|
34
|
+
return setIsLoadingClaim(isLoading);
|
|
35
|
+
}, e);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
var rejectBonus = function rejectBonus(e) {
|
|
39
|
+
onRejectBonus(bonus, function (isLoading) {
|
|
40
|
+
return setIsLoadingReject(isLoading);
|
|
41
|
+
}, e);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return React.createElement(
|
|
45
|
+
'div',
|
|
46
|
+
{ className: 'actions' },
|
|
47
|
+
ALEACC_BONUS_CLAIM_STATE.includes(bonus.State) && React.createElement(
|
|
48
|
+
Button,
|
|
49
|
+
{
|
|
50
|
+
className: 'button primary small',
|
|
51
|
+
onClick: claimBonus,
|
|
52
|
+
isLoading: isLoadingClaim },
|
|
53
|
+
React.createElement(Translate, { id: 'action.bonus.claim', defaultMessage: 'Claim' })
|
|
54
|
+
),
|
|
55
|
+
ALEACC_BONUS_REJECT_STATE.includes(bonus.State) && React.createElement(
|
|
56
|
+
Button,
|
|
57
|
+
{
|
|
58
|
+
className: 'button secondary small',
|
|
59
|
+
onClick: rejectBonus,
|
|
60
|
+
isLoading: isLoadingReject },
|
|
61
|
+
React.createElement(Translate, { id: 'action.bonus.reject', defaultMessage: 'Reject' })
|
|
62
|
+
)
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
var BonusActionFT = function BonusActionFT(_ref2) {
|
|
67
|
+
var bonus = _ref2.bonus,
|
|
68
|
+
onClaimBonus = _ref2.onClaimBonus;
|
|
15
69
|
|
|
16
70
|
// Atm it's only fasttrack that supports actions.
|
|
17
71
|
if (bonus.Provider !== 'fasttrack') return null;
|
|
@@ -19,9 +73,6 @@ var BonusAction = function BonusAction(_ref) {
|
|
|
19
73
|
// Expired bonuses has no actions
|
|
20
74
|
if (bonus.State === 'Expired') return null;
|
|
21
75
|
|
|
22
|
-
var gameUrl = '/casino';
|
|
23
|
-
if (device === 'Desktop' && bonus.DesktopGameUrl && bonus.DesktopGameUrl.trim()) gameUrl = bonus.DesktopGameUrl.trim();else if (device !== 'Desktop' && bonus.MobileGameUrl && bonus.MobileGameUrl.trim()) gameUrl = bonus.MobileGameUrl.trim();
|
|
24
|
-
|
|
25
76
|
// FTType 1 - Pending Bonus
|
|
26
77
|
// Claim bonus and redirect to game of present.
|
|
27
78
|
if (bonus.FTType === 1) {
|
|
@@ -29,10 +80,8 @@ var BonusAction = function BonusAction(_ref) {
|
|
|
29
80
|
return React.createElement(
|
|
30
81
|
Button,
|
|
31
82
|
{
|
|
32
|
-
onClick: function onClick() {
|
|
33
|
-
|
|
34
|
-
redirect(gameUrl);
|
|
35
|
-
});
|
|
83
|
+
onClick: function onClick(e) {
|
|
84
|
+
return onClaimBonus(bonus, null, e);
|
|
36
85
|
},
|
|
37
86
|
className: 'button primary action wide ' + (bonus.IsLocked && 'locked') },
|
|
38
87
|
React.createElement(Translate, { id: 'action.bonus.type1', defaultMessage: 'Action type1' })
|
|
@@ -45,14 +94,8 @@ var BonusAction = function BonusAction(_ref) {
|
|
|
45
94
|
return React.createElement(
|
|
46
95
|
Button,
|
|
47
96
|
{
|
|
48
|
-
onClick: function onClick() {
|
|
49
|
-
return
|
|
50
|
-
pathname: '/dashboard/deposit',
|
|
51
|
-
search: gameUrl ? '?ref_url=' + encodeURIComponent(gameUrl) : '',
|
|
52
|
-
state: {
|
|
53
|
-
bonusCode: bonus.PromoCode
|
|
54
|
-
}
|
|
55
|
-
});
|
|
97
|
+
onClick: function onClick(e) {
|
|
98
|
+
return onClaimBonus(bonus, null, e);
|
|
56
99
|
},
|
|
57
100
|
className: 'button primary action wide ' + (bonus.IsLocked && 'locked') },
|
|
58
101
|
React.createElement(Translate, { id: 'action.bonus.type2', defaultMessage: 'Action type2' })
|
|
@@ -65,20 +108,8 @@ var BonusAction = function BonusAction(_ref) {
|
|
|
65
108
|
return React.createElement(
|
|
66
109
|
Button,
|
|
67
110
|
{
|
|
68
|
-
onClick: function onClick() {
|
|
69
|
-
|
|
70
|
-
claimBonus(bonus.Id).then(function () {
|
|
71
|
-
redirect(gameUrl);
|
|
72
|
-
});
|
|
73
|
-
} else {
|
|
74
|
-
redirect({
|
|
75
|
-
pathname: '/dashboard/deposit',
|
|
76
|
-
search: '?ref_url=/dashboard/bonus',
|
|
77
|
-
state: {
|
|
78
|
-
bonusCode: bonus.PromoCode
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
}
|
|
111
|
+
onClick: function onClick(e) {
|
|
112
|
+
return onClaimBonus(bonus, null, e);
|
|
82
113
|
},
|
|
83
114
|
className: 'button primary action wide ' + (bonus.IsLocked && 'locked') },
|
|
84
115
|
!!bonus.IsLocked && React.createElement(Translate, {
|
|
@@ -92,12 +123,11 @@ var BonusAction = function BonusAction(_ref) {
|
|
|
92
123
|
return null;
|
|
93
124
|
};
|
|
94
125
|
|
|
95
|
-
var BonusWidget = function BonusWidget(
|
|
96
|
-
var bonuses =
|
|
97
|
-
handleBonusCodeSubmit =
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
redirect = _ref2.redirect;
|
|
126
|
+
var BonusWidget = function BonusWidget(_ref3) {
|
|
127
|
+
var bonuses = _ref3.bonuses,
|
|
128
|
+
handleBonusCodeSubmit = _ref3.handleBonusCodeSubmit,
|
|
129
|
+
onClaimBonus = _ref3.onClaimBonus,
|
|
130
|
+
onRejectBonus = _ref3.onRejectBonus;
|
|
101
131
|
|
|
102
132
|
var bonusList = { active: null, available: null, finished: null };
|
|
103
133
|
|
|
@@ -149,12 +179,13 @@ var BonusWidget = function BonusWidget(_ref2) {
|
|
|
149
179
|
})]];
|
|
150
180
|
|
|
151
181
|
// Add bonus actions to not expired Fasttrack bonuses
|
|
152
|
-
if (item.Provider === 'fasttrack' && item.State !== 'Expired') info.push(React.createElement(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
182
|
+
if (item.Provider === 'fasttrack' && item.State !== 'Expired') info.push(React.createElement(BonusActionFT, { bonus: item, onClaimBonus: onClaimBonus }));
|
|
183
|
+
// Add bonus actions to post claim bonuses from Aleacc
|
|
184
|
+
else if (item.Provider !== 'fasttrack' && ALEACC_BONUS_ACTION_STATE.includes(item.State)) info.push(React.createElement(BonusAction, {
|
|
185
|
+
bonus: item,
|
|
186
|
+
onClaimBonus: onClaimBonus,
|
|
187
|
+
onRejectBonus: onRejectBonus
|
|
188
|
+
}));
|
|
158
189
|
|
|
159
190
|
var detail = [[React.createElement(
|
|
160
191
|
'span',
|
|
@@ -214,6 +245,13 @@ var BonusWidget = function BonusWidget(_ref2) {
|
|
|
214
245
|
})
|
|
215
246
|
)]];
|
|
216
247
|
|
|
248
|
+
info.push([React.createElement('div', {
|
|
249
|
+
className: 'disclaimer',
|
|
250
|
+
dangerouslySetInnerHTML: {
|
|
251
|
+
__html: item.content && item.content.disclaimer && marked(item.content.disclaimer || '') || item.promotion && item.promotion.shortDisclaimer
|
|
252
|
+
}
|
|
253
|
+
})]);
|
|
254
|
+
|
|
217
255
|
return {
|
|
218
256
|
id: item.Id,
|
|
219
257
|
info: info,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Button from '../../../../components/Button';
|
|
3
|
+
import Translate from '../../../../components/Translate';
|
|
4
|
+
|
|
5
|
+
var NewTab = function NewTab(_ref) {
|
|
6
|
+
var url = _ref.url;
|
|
7
|
+
|
|
8
|
+
return React.createElement(
|
|
9
|
+
'div',
|
|
10
|
+
{ className: 'NewTab' },
|
|
11
|
+
React.createElement(Translate, {
|
|
12
|
+
tagName: 'p',
|
|
13
|
+
id: 'label.new-tab',
|
|
14
|
+
defaultMessage: 'A new tab is required in order to proceed, please press the button to continue...'
|
|
15
|
+
}),
|
|
16
|
+
React.createElement(
|
|
17
|
+
Button,
|
|
18
|
+
{
|
|
19
|
+
className: 'primary',
|
|
20
|
+
onClick: function onClick() {
|
|
21
|
+
window.open(url, '_blank');
|
|
22
|
+
} },
|
|
23
|
+
React.createElement(Translate, { id: 'action.open-tab', defaultMessage: 'Open new tab' })
|
|
24
|
+
)
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default NewTab;
|
|
@@ -13,6 +13,7 @@ import FramedComponent from '../../hoc/FramedComponent';
|
|
|
13
13
|
import InjectedIframeHTML from './InjectedIframeHTML';
|
|
14
14
|
import DynamicForm from './DynamicForm';
|
|
15
15
|
import PaymentResult from './PaymentResult';
|
|
16
|
+
import NewTab from './NewTab';
|
|
16
17
|
import flatten from 'lodash/flatten';
|
|
17
18
|
import Translate from '../../../../components/Translate';
|
|
18
19
|
|
|
@@ -122,7 +123,8 @@ var PaymentForm = function (_Component) {
|
|
|
122
123
|
data = _props.data,
|
|
123
124
|
onClose = _props.onClose,
|
|
124
125
|
onSuccess = _props.onSuccess,
|
|
125
|
-
redirect = _props.redirect
|
|
126
|
+
redirect = _props.redirect,
|
|
127
|
+
details = _props.details;
|
|
126
128
|
|
|
127
129
|
|
|
128
130
|
if (!data.success) {
|
|
@@ -147,7 +149,9 @@ var PaymentForm = function (_Component) {
|
|
|
147
149
|
frameBorder: 0
|
|
148
150
|
};
|
|
149
151
|
|
|
150
|
-
if (
|
|
152
|
+
if (details && details.newTab) {
|
|
153
|
+
return React.createElement(NewTab, { url: data.redirectOutput.url });
|
|
154
|
+
} else if (data.redirectOutput.container == 'iframe' && data.redirectOutput.method == 'POST' && data.redirectOutput.html == null) {
|
|
151
155
|
return React.createElement(FormWithIframe, _extends({
|
|
152
156
|
frameProps: frameProps,
|
|
153
157
|
target: redirect ? '_top' : frameId
|
|
@@ -7,7 +7,8 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
|
|
|
7
7
|
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; }
|
|
8
8
|
|
|
9
9
|
import React, { Component } from 'react';
|
|
10
|
-
import
|
|
10
|
+
import TextInput from '../../../../components/Deposit/TextInput';
|
|
11
|
+
import Icon from '../../../../components/Icon';
|
|
11
12
|
import { injectIntl } from 'react-intl';
|
|
12
13
|
import translate from '../../../../lib/utils/translate';
|
|
13
14
|
|
|
@@ -49,14 +50,16 @@ var BonusCodeInput = function (_Component) {
|
|
|
49
50
|
return React.createElement(
|
|
50
51
|
'div',
|
|
51
52
|
{ className: 'bonus-code-input-wrapper' },
|
|
52
|
-
React.createElement(
|
|
53
|
+
React.createElement(TextInput, {
|
|
53
54
|
name: 'bonusCode',
|
|
54
|
-
value: bonusCode,
|
|
55
|
-
onChange: onChange,
|
|
56
55
|
autoFocus: true,
|
|
57
|
-
|
|
56
|
+
placeholder: translate({ id: 'cashier.bonus_code' }, intl),
|
|
58
57
|
disabled: disabled,
|
|
59
|
-
|
|
58
|
+
onChange: onChange
|
|
59
|
+
}),
|
|
60
|
+
status && React.createElement(Icon, {
|
|
61
|
+
icon: status === 'active' ? 'check' : '',
|
|
62
|
+
className: 'bonus-icon bonus-' + status
|
|
60
63
|
})
|
|
61
64
|
);
|
|
62
65
|
}
|
|
@@ -2,6 +2,8 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
|
|
|
2
2
|
|
|
3
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; }; }();
|
|
4
4
|
|
|
5
|
+
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); } }
|
|
6
|
+
|
|
5
7
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
8
|
|
|
7
9
|
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
@@ -20,7 +22,7 @@ import BonusCodeInput from '../BonusCodeInput';
|
|
|
20
22
|
import { matchProviderType, getPaymentForm } from '../../Payment';
|
|
21
23
|
import Icon from '../../../../components/Icon';
|
|
22
24
|
import marked from 'marked';
|
|
23
|
-
import Input from '../../../../components/
|
|
25
|
+
import Input from '../../../../components/Deposit/TextInput';
|
|
24
26
|
import PaymentAmountSelector from '../../Payment/PaymentAmountSelector';
|
|
25
27
|
import MethodMinMax from '../../Payment/MethodMinMax';
|
|
26
28
|
import DelayVisibility from '../../../../components/Deposit/DelayVisibility';
|
|
@@ -181,7 +183,11 @@ var DepositWidget = function (_Component) {
|
|
|
181
183
|
}).map(function (provider) {
|
|
182
184
|
return provider.providerType.toUpperCase();
|
|
183
185
|
});
|
|
184
|
-
var customAmountExclusions = [
|
|
186
|
+
var customAmountExclusions = [].concat(_toConsumableArray(payments.filter(function (provider) {
|
|
187
|
+
return provider.hideCustomAmount;
|
|
188
|
+
}).map(function (provider) {
|
|
189
|
+
return provider.providerType.toLowerCase();
|
|
190
|
+
})), ['reversewithdrawal']);
|
|
185
191
|
var minMaxExclusions = ['reversewithdrawal'];
|
|
186
192
|
|
|
187
193
|
var minDepositBonusAmount = this.getMinDepositBonusAmount();
|
|
@@ -192,8 +198,6 @@ var DepositWidget = function (_Component) {
|
|
|
192
198
|
return matchProviderType(payment, selectedMethod);
|
|
193
199
|
});
|
|
194
200
|
|
|
195
|
-
var hasCustomAmounts = selectedMethodDetail && selectedMethodDetail.customAmounts;
|
|
196
|
-
|
|
197
201
|
var selectedBonus = bonuses.find(function (b) {
|
|
198
202
|
return b.PromoCode === bonusCode;
|
|
199
203
|
});
|
|
@@ -290,7 +294,7 @@ var DepositWidget = function (_Component) {
|
|
|
290
294
|
onSelectMethod: _this2.onSelectMethod,
|
|
291
295
|
onDeleteAccount: _this2.onDeleteAccount,
|
|
292
296
|
methodContent: function methodContent(method) {
|
|
293
|
-
if (method.txType !== selectedMethod.txType
|
|
297
|
+
if (method.txType !== selectedMethod.txType) return null;
|
|
294
298
|
|
|
295
299
|
return React.createElement(
|
|
296
300
|
Fragment,
|
|
@@ -308,6 +312,7 @@ var DepositWidget = function (_Component) {
|
|
|
308
312
|
id: 'label.mobile_number_placeholder',
|
|
309
313
|
defaultMessage: 'eg. 0701234567'
|
|
310
314
|
}, intl),
|
|
315
|
+
isControlled: true,
|
|
311
316
|
value: _this2.state.swishNumber,
|
|
312
317
|
title: translate({
|
|
313
318
|
id: 'label.mobile_number'
|
|
@@ -336,30 +341,26 @@ var DepositWidget = function (_Component) {
|
|
|
336
341
|
return _this2.setState({ buttonLoading: buttonLoading });
|
|
337
342
|
}
|
|
338
343
|
}),
|
|
339
|
-
!customAmountExclusions.includes(selectedMethod.providerType.toLowerCase()) &&
|
|
344
|
+
!customAmountExclusions.includes(selectedMethod.providerType.toLowerCase()) && React.createElement(
|
|
340
345
|
'div',
|
|
341
346
|
{ className: 'custom-amount-and-submit' },
|
|
342
347
|
React.createElement(Input, {
|
|
343
|
-
required: true,
|
|
344
348
|
pattern: '[0-9]*',
|
|
345
349
|
className: 'custom-amount',
|
|
346
350
|
name: 'amount',
|
|
347
351
|
type: 'number',
|
|
348
352
|
step: '0.01',
|
|
349
|
-
|
|
353
|
+
placeholder: translate({
|
|
350
354
|
id: 'label.amount'
|
|
351
355
|
}, intl),
|
|
352
|
-
|
|
353
|
-
|
|
356
|
+
showErrorText: false,
|
|
357
|
+
showErrorIcon: errors && errors.amount && errors.amount.length > 0,
|
|
354
358
|
onChange: function onChange(e) {
|
|
355
359
|
return _this2.setState({
|
|
356
360
|
currentAmount: e.target.value
|
|
357
361
|
});
|
|
358
362
|
},
|
|
359
|
-
autoFocus: shouldAutoFocus
|
|
360
|
-
setRef: function setRef(ref) {
|
|
361
|
-
return _this2.amountInputRef = ref;
|
|
362
|
-
}
|
|
363
|
+
autoFocus: shouldAutoFocus
|
|
363
364
|
}),
|
|
364
365
|
React.createElement(
|
|
365
366
|
Button,
|
|
@@ -383,7 +384,7 @@ var DepositWidget = function (_Component) {
|
|
|
383
384
|
React.createElement(
|
|
384
385
|
'div',
|
|
385
386
|
{ className: 'bonus-limit' },
|
|
386
|
-
!minMaxExclusions.includes(selectedMethod.providerType.toLowerCase()) && !
|
|
387
|
+
!minMaxExclusions.includes(selectedMethod.providerType.toLowerCase()) && !customAmountExclusions.includes(selectedMethod.providerType.toLowerCase()) && selectedMethod && selectedMethod.limit && React.createElement(MethodMinMax, {
|
|
387
388
|
method: selectedMethod,
|
|
388
389
|
currency: currency,
|
|
389
390
|
minDepositBonusAmount: minDepositBonusAmount,
|
|
@@ -455,8 +456,7 @@ var DepositWidget = function (_Component) {
|
|
|
455
456
|
render: function render(_ref5) {
|
|
456
457
|
var handleSubmit = _ref5.handleSubmit,
|
|
457
458
|
values = _ref5.values,
|
|
458
|
-
change = _ref5.change
|
|
459
|
-
form = _ref5.form;
|
|
459
|
+
change = _ref5.change;
|
|
460
460
|
return React.createElement(
|
|
461
461
|
Fragment,
|
|
462
462
|
null,
|
|
@@ -481,10 +481,7 @@ var DepositWidget = function (_Component) {
|
|
|
481
481
|
React.createElement(
|
|
482
482
|
'div',
|
|
483
483
|
{ className: 'account-details' },
|
|
484
|
-
React.createElement(PaymentAccountForm,
|
|
485
|
-
change: form.change,
|
|
486
|
-
values: values
|
|
487
|
-
}))
|
|
484
|
+
React.createElement(PaymentAccountForm, paymentAccountFormProps)
|
|
488
485
|
),
|
|
489
486
|
React.createElement(
|
|
490
487
|
Button,
|
|
@@ -657,16 +654,9 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
657
654
|
currency = _props4.currency,
|
|
658
655
|
paymentStats = _props4.paymentStats,
|
|
659
656
|
remainingDepositLimit = _props4.remainingDepositLimit,
|
|
660
|
-
payments = _props4.payments
|
|
661
|
-
shouldAutoFocus = _props4.shouldAutoFocus;
|
|
657
|
+
payments = _props4.payments;
|
|
662
658
|
|
|
663
659
|
|
|
664
|
-
if (shouldAutoFocus) {
|
|
665
|
-
setTimeout(function () {
|
|
666
|
-
_this3.amountInputRef && _this3.amountInputRef.focus();
|
|
667
|
-
}, 1);
|
|
668
|
-
}
|
|
669
|
-
|
|
670
660
|
var selectedMethodDetail = payments.find(function (payment) {
|
|
671
661
|
return matchProviderType(payment, method);
|
|
672
662
|
});
|