tg-core-components 6.2.1-alpha.0 → 6.3.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/WithValidation/rules/blacklistedCharacters.js +3 -0
- package/es/lib/WithValidation/rules/noSpecialCharacters.js +3 -0
- package/es/lib/WithValidation/rules/phone.js +2 -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 +100 -39
- 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 +6 -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/WithValidation/rules/blacklistedCharacters.js +9 -0
- package/lib/lib/WithValidation/rules/noSpecialCharacters.js +9 -0
- package/lib/lib/WithValidation/rules/phone.js +2 -2
- 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 +112 -39
- 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 +6 -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 -114
- 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 -144
- 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
|
@@ -282,7 +282,7 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
|
|
|
282
282
|
setValue = _useState2[1];
|
|
283
283
|
|
|
284
284
|
(0, _react.useEffect)(function () {
|
|
285
|
-
if (newLimit
|
|
285
|
+
if (newLimit) {
|
|
286
286
|
setValue(newLimit.Amount);
|
|
287
287
|
}
|
|
288
288
|
}, [newLimit]);
|
|
@@ -313,7 +313,7 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
|
|
|
313
313
|
});
|
|
314
314
|
}
|
|
315
315
|
// If not blocked from removing limit or 'No limit' option is selected -> add 'No limit' option
|
|
316
|
-
if (!validationState['limit-remove-blocked'] || value === 0) {
|
|
316
|
+
if (!validationState['limit-remove-blocked'] || value === 0 || value === '') {
|
|
317
317
|
options.unshift({
|
|
318
318
|
value: 0,
|
|
319
319
|
label: messages.get('label.responsible-gaming.option.no-limit')
|
|
@@ -350,6 +350,8 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
|
|
|
350
350
|
}
|
|
351
351
|
};
|
|
352
352
|
|
|
353
|
+
var isIphone = typeof window !== 'undefined' && navigator.platform === 'iPhone';
|
|
354
|
+
|
|
353
355
|
return _react2.default.createElement(
|
|
354
356
|
_react.Fragment,
|
|
355
357
|
null,
|
|
@@ -383,7 +385,7 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
|
|
|
383
385
|
setValue(parseInt(value));
|
|
384
386
|
if (value > 0) _onChange(value);
|
|
385
387
|
},
|
|
386
|
-
autoFocus:
|
|
388
|
+
autoFocus: !isIphone,
|
|
387
389
|
min: validationState['limit-remove-blocked'] ? '1' : '0',
|
|
388
390
|
max: validationState['limit-increase-blocked'] ? (0, _get2.default)(currentLimit, 'Amount') : Infinity
|
|
389
391
|
}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tg-core-components",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.0",
|
|
4
4
|
"description": "tg-core-components",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"webpack": "^3.0.0",
|
|
77
77
|
"webpack-blocks": "^1.0.0"
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "06f3cdf713c2b8973a68fab04e7c0a74c125d723"
|
|
80
80
|
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Icon from '../Icon';
|
|
3
|
-
import cn from 'classnames';
|
|
4
|
-
|
|
5
|
-
var Message = function Message(_ref) {
|
|
6
|
-
var closeButton = _ref.closeButton,
|
|
7
|
-
count = _ref.count,
|
|
8
|
-
onClick = _ref.onClick,
|
|
9
|
-
onClose = _ref.onClose,
|
|
10
|
-
content = _ref.content,
|
|
11
|
-
className = _ref.className,
|
|
12
|
-
icon = _ref.icon;
|
|
13
|
-
|
|
14
|
-
return React.createElement(
|
|
15
|
-
'div',
|
|
16
|
-
{ className: cn('Message', className), onClick: onClick },
|
|
17
|
-
closeButton && React.createElement(
|
|
18
|
-
'span',
|
|
19
|
-
{ className: 'close', onClick: onClose },
|
|
20
|
-
React.createElement(Icon, { icon: 'times' })
|
|
21
|
-
),
|
|
22
|
-
icon && React.createElement(
|
|
23
|
-
'div',
|
|
24
|
-
{ className: 'icon' },
|
|
25
|
-
React.createElement(Icon, { icon: '' + icon })
|
|
26
|
-
),
|
|
27
|
-
React.createElement(
|
|
28
|
-
'div',
|
|
29
|
-
{ className: 'content' },
|
|
30
|
-
content
|
|
31
|
-
),
|
|
32
|
-
count && React.createElement(
|
|
33
|
-
'div',
|
|
34
|
-
{ className: 'count' },
|
|
35
|
-
count
|
|
36
|
-
),
|
|
37
|
-
React.createElement(Icon, { icon: 'chevron-right' })
|
|
38
|
-
);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export default Message;
|
package/es/lib/utils/bonus.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
export var bonusMapping = {
|
|
2
|
-
InPlay: 'active',
|
|
3
|
-
Active: 'active',
|
|
4
|
-
Initiated: 'available',
|
|
5
|
-
PreClaimed: 'available',
|
|
6
|
-
PreWager: 'available',
|
|
7
|
-
Expired: 'finished',
|
|
8
|
-
Rejected: 'finished',
|
|
9
|
-
Finished: 'finished',
|
|
10
|
-
Canceled: 'finished',
|
|
11
|
-
FinishedNoGains: 'finished',
|
|
12
|
-
AdminCanceled: 'finished'
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export var categorizeByState = function categorizeByState(bonuses) {
|
|
16
|
-
return {
|
|
17
|
-
available: bonuses.filter(function (b) {
|
|
18
|
-
return bonusMapping[b.State] === 'available';
|
|
19
|
-
}),
|
|
20
|
-
active: bonuses.filter(function (b) {
|
|
21
|
-
return bonusMapping[b.State] === 'active';
|
|
22
|
-
}),
|
|
23
|
-
finished: bonuses.filter(function (b) {
|
|
24
|
-
return bonusMapping[b.State] === 'finished';
|
|
25
|
-
})
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export var getStatus = function getStatus(bonus) {
|
|
30
|
-
return bonusMapping[bonus.State];
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export var getWageringProgress = function getWageringProgress(bonus) {
|
|
34
|
-
var wageringRequirement = bonusMapping[bonus.State] === 'available' ? bonus.PreWageringRequirment : bonus.WageringRequirment;
|
|
35
|
-
|
|
36
|
-
var wageringRequirementRemaining = bonusMapping[bonus.State] === 'available' ? bonus.PreWageringRequirmentRemaining : bonus.WageringRequirmentRemaining;
|
|
37
|
-
|
|
38
|
-
return Boolean(wageringRequirement) ? (100 - wageringRequirementRemaining / wageringRequirement * 100).toFixed(2) : null;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export var getNumberOfAvailableBonuses = function getNumberOfAvailableBonuses(bonuses) {
|
|
42
|
-
if (!Array.isArray(bonuses) || bonuses.length < 1) return 0;
|
|
43
|
-
|
|
44
|
-
return bonuses.filter(function (b) {
|
|
45
|
-
return bonusMapping[b.State] === 'available';
|
|
46
|
-
}).length;
|
|
47
|
-
};
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
var _this = this;
|
|
2
|
-
|
|
3
|
-
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; };
|
|
4
|
-
|
|
5
|
-
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"); } }; }();
|
|
6
|
-
|
|
7
|
-
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); } }
|
|
8
|
-
|
|
9
|
-
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
|
|
10
|
-
|
|
11
|
-
import React, { useState } from 'react';
|
|
12
|
-
import Button from '../../components/Button';
|
|
13
|
-
import { FormattedMessage } from 'react-intl';
|
|
14
|
-
import cn from 'classnames';
|
|
15
|
-
|
|
16
|
-
var Actions = function Actions(_ref) {
|
|
17
|
-
var bonus = _ref.bonus,
|
|
18
|
-
onClaim = _ref.onClaim,
|
|
19
|
-
onCancel = _ref.onCancel,
|
|
20
|
-
onReject = _ref.onReject,
|
|
21
|
-
onTriggerByPromoCode = _ref.onTriggerByPromoCode,
|
|
22
|
-
status = _ref.status,
|
|
23
|
-
promotionCode = _ref.promotionCode,
|
|
24
|
-
onOther = _ref.onOther,
|
|
25
|
-
onSuccess = _ref.onSuccess;
|
|
26
|
-
|
|
27
|
-
var _useState = useState([{
|
|
28
|
-
conditions: status === 'active' || bonus.State === 'PreWager',
|
|
29
|
-
onClick: onOther,
|
|
30
|
-
isLoading: false,
|
|
31
|
-
disabled: false,
|
|
32
|
-
type: 'primary',
|
|
33
|
-
translation: 'action.other-bonus',
|
|
34
|
-
name: 'other',
|
|
35
|
-
args: [bonus, promotionCode]
|
|
36
|
-
}, {
|
|
37
|
-
conditions: bonus.State === 'Initiated',
|
|
38
|
-
onClick: onClaim,
|
|
39
|
-
isLoading: false,
|
|
40
|
-
disabled: false,
|
|
41
|
-
type: 'primary',
|
|
42
|
-
translation: 'action.claim',
|
|
43
|
-
name: 'claim',
|
|
44
|
-
args: [bonus]
|
|
45
|
-
}, {
|
|
46
|
-
conditions: status === 'available' && bonus.State !== 'Initiated' && bonus.State !== 'PreWager' && promotionCode,
|
|
47
|
-
onClick: onTriggerByPromoCode,
|
|
48
|
-
isLoading: false,
|
|
49
|
-
isDisabled: false,
|
|
50
|
-
type: 'primary',
|
|
51
|
-
translation: 'action.claim',
|
|
52
|
-
name: 'trigger',
|
|
53
|
-
args: [promotionCode]
|
|
54
|
-
}, {
|
|
55
|
-
conditions: bonus.State === 'Initiated',
|
|
56
|
-
onClick: onReject,
|
|
57
|
-
isLoading: false,
|
|
58
|
-
disabled: false,
|
|
59
|
-
type: 'tertiary',
|
|
60
|
-
translation: 'action.reject',
|
|
61
|
-
name: 'reject',
|
|
62
|
-
args: [bonus]
|
|
63
|
-
}, {
|
|
64
|
-
conditions: status === 'active',
|
|
65
|
-
onClick: onCancel,
|
|
66
|
-
isLoading: false,
|
|
67
|
-
disabled: false,
|
|
68
|
-
type: 'tertiary',
|
|
69
|
-
translation: 'action.cancel',
|
|
70
|
-
name: 'cancel',
|
|
71
|
-
args: [bonus.Id]
|
|
72
|
-
}]),
|
|
73
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
74
|
-
buttons = _useState2[0],
|
|
75
|
-
setButtons = _useState2[1];
|
|
76
|
-
|
|
77
|
-
var actionWrapper = function () {
|
|
78
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(action, name) {
|
|
79
|
-
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
80
|
-
args[_key - 2] = arguments[_key];
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
var res;
|
|
84
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
85
|
-
while (1) {
|
|
86
|
-
switch (_context.prev = _context.next) {
|
|
87
|
-
case 0:
|
|
88
|
-
setButtons([].concat(_toConsumableArray(buttons.map(function (b) {
|
|
89
|
-
if (b.name === name) {
|
|
90
|
-
return _extends({}, b, {
|
|
91
|
-
isLoading: true,
|
|
92
|
-
disabled: true
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return b;
|
|
97
|
-
}))));
|
|
98
|
-
|
|
99
|
-
_context.next = 3;
|
|
100
|
-
return action.apply(undefined, _toConsumableArray(args));
|
|
101
|
-
|
|
102
|
-
case 3:
|
|
103
|
-
res = _context.sent;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
if (res && res.payload && res.payload.isNetworkException || res && res.payload && res.payload === 0) {
|
|
107
|
-
setButtons([].concat(_toConsumableArray(buttons.map(function (b) {
|
|
108
|
-
if (b.name === name) {
|
|
109
|
-
return _extends({}, b, {
|
|
110
|
-
isLoading: false,
|
|
111
|
-
disabled: false
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return b;
|
|
116
|
-
}))));
|
|
117
|
-
} else {
|
|
118
|
-
onSuccess();
|
|
119
|
-
|
|
120
|
-
setButtons([].concat(_toConsumableArray(buttons.map(function (b) {
|
|
121
|
-
if (b.name === name) {
|
|
122
|
-
return _extends({}, b, {
|
|
123
|
-
isLoading: false,
|
|
124
|
-
disabled: true
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return b;
|
|
129
|
-
}))));
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
case 5:
|
|
133
|
-
case 'end':
|
|
134
|
-
return _context.stop();
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}, _callee, _this);
|
|
138
|
-
}));
|
|
139
|
-
|
|
140
|
-
return function actionWrapper(_x, _x2) {
|
|
141
|
-
return _ref2.apply(this, arguments);
|
|
142
|
-
};
|
|
143
|
-
}();
|
|
144
|
-
|
|
145
|
-
return React.createElement(
|
|
146
|
-
'div',
|
|
147
|
-
{ className: 'Actions' },
|
|
148
|
-
buttons && buttons.filter(function (b) {
|
|
149
|
-
return b.conditions;
|
|
150
|
-
}).map(function (b) {
|
|
151
|
-
return React.createElement(
|
|
152
|
-
Button,
|
|
153
|
-
{
|
|
154
|
-
key: b.name,
|
|
155
|
-
isLoading: b.isLoading,
|
|
156
|
-
disabled: b.disabled,
|
|
157
|
-
className: cn('button small', b.type),
|
|
158
|
-
onClick: function onClick() {
|
|
159
|
-
return actionWrapper.apply(undefined, [b.onClick, b.name].concat(_toConsumableArray(b.args)));
|
|
160
|
-
} },
|
|
161
|
-
React.createElement(FormattedMessage, { id: b.translation })
|
|
162
|
-
);
|
|
163
|
-
})
|
|
164
|
-
);
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
export default Actions;
|
|
@@ -1,62 +0,0 @@
|
|
|
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';
|
|
4
|
-
import { FormattedMessage, injectIntl } from 'react-intl';
|
|
5
|
-
import cn from 'classnames';
|
|
6
|
-
import Input from '../../components/Input';
|
|
7
|
-
import Button from '../../components/Button';
|
|
8
|
-
import Icon from '../../components/Icon';
|
|
9
|
-
|
|
10
|
-
var BonusCode = function BonusCode(_ref) {
|
|
11
|
-
var _onSubmit = _ref.onSubmit,
|
|
12
|
-
intl = _ref.intl;
|
|
13
|
-
|
|
14
|
-
var _useState = useState(''),
|
|
15
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
16
|
-
bonusCode = _useState2[0],
|
|
17
|
-
setBonusCode = _useState2[1];
|
|
18
|
-
|
|
19
|
-
var _useState3 = useState(false),
|
|
20
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
21
|
-
showInput = _useState4[0],
|
|
22
|
-
setShowInput = _useState4[1];
|
|
23
|
-
|
|
24
|
-
return React.createElement(
|
|
25
|
-
'div',
|
|
26
|
-
{ className: cn('BonusCode', { 'BonusCode--active': showInput }) },
|
|
27
|
-
React.createElement(
|
|
28
|
-
'span',
|
|
29
|
-
{ onClick: function onClick() {
|
|
30
|
-
return setShowInput(!showInput);
|
|
31
|
-
} },
|
|
32
|
-
React.createElement(FormattedMessage, {
|
|
33
|
-
id: 'message.have_bonus_code',
|
|
34
|
-
defaultMessage: 'Do you have a bonus code?'
|
|
35
|
-
})
|
|
36
|
-
),
|
|
37
|
-
showInput && React.createElement(
|
|
38
|
-
'form',
|
|
39
|
-
{
|
|
40
|
-
onSubmit: function onSubmit(e) {
|
|
41
|
-
e.preventDefault();
|
|
42
|
-
_onSubmit(bonusCode);
|
|
43
|
-
} },
|
|
44
|
-
React.createElement(Input, {
|
|
45
|
-
onChange: function onChange(e) {
|
|
46
|
-
return setBonusCode(e.target.value);
|
|
47
|
-
},
|
|
48
|
-
placeholder: intl.formatMessage({ id: 'cashier.bonus_code' })
|
|
49
|
-
}),
|
|
50
|
-
React.createElement(
|
|
51
|
-
Button,
|
|
52
|
-
{
|
|
53
|
-
className: 'button secondary',
|
|
54
|
-
type: 'submit',
|
|
55
|
-
disabled: bonusCode.trim() === '' },
|
|
56
|
-
React.createElement(Icon, { icon: 'chevron-right' })
|
|
57
|
-
)
|
|
58
|
-
)
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export default injectIntl(BonusCode);
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import marked from 'marked';
|
|
3
|
-
import Icon from '../../components/Icon';
|
|
4
|
-
import Notice from '../CashierAccordion/Payment/Notice';
|
|
5
|
-
import getByPath from 'lodash/get';
|
|
6
|
-
import Actions from './Actions';
|
|
7
|
-
import { selectUnit } from '../../lib/utils/selectUnit';
|
|
8
|
-
import { FormattedRelativeTime, FormattedNumber } from 'react-intl';
|
|
9
|
-
import Translate from '../../components/Translate';
|
|
10
|
-
|
|
11
|
-
var Details = function Details(_ref) {
|
|
12
|
-
var bonus = _ref.bonus,
|
|
13
|
-
content = _ref.content,
|
|
14
|
-
defaultImage = _ref.defaultImage,
|
|
15
|
-
status = _ref.status,
|
|
16
|
-
wageringProgress = _ref.wageringProgress,
|
|
17
|
-
onBack = _ref.onBack,
|
|
18
|
-
onClaim = _ref.onClaim,
|
|
19
|
-
onReject = _ref.onReject,
|
|
20
|
-
onTriggerByPromoCode = _ref.onTriggerByPromoCode,
|
|
21
|
-
selectBonus = _ref.selectBonus,
|
|
22
|
-
alert = _ref.alert;
|
|
23
|
-
|
|
24
|
-
return React.createElement(
|
|
25
|
-
'div',
|
|
26
|
-
{ className: 'Details' },
|
|
27
|
-
React.createElement('div', { className: 'Details__back', onClick: onBack }),
|
|
28
|
-
React.createElement(
|
|
29
|
-
'div',
|
|
30
|
-
{ className: 'Details__content' },
|
|
31
|
-
alert && React.createElement(Notice, {
|
|
32
|
-
level: alert.level,
|
|
33
|
-
icon: alert.level === 'success' ? React.createElement(Icon, { icon: 'check' }) : React.createElement(Icon, { icon: 'stop-circle' }),
|
|
34
|
-
header: React.createElement(Translate, { id: 'label.bonus-offers.' + alert.type })
|
|
35
|
-
}),
|
|
36
|
-
React.createElement(
|
|
37
|
-
'div',
|
|
38
|
-
{ className: 'Details__content__name' },
|
|
39
|
-
getByPath(content, 'name') || bonus.Name
|
|
40
|
-
),
|
|
41
|
-
React.createElement(
|
|
42
|
-
'div',
|
|
43
|
-
{ className: 'Details__content__summary' },
|
|
44
|
-
getByPath(content, 'summary') || bonus.Description
|
|
45
|
-
),
|
|
46
|
-
React.createElement(Actions, {
|
|
47
|
-
bonus: bonus,
|
|
48
|
-
onClaim: onClaim,
|
|
49
|
-
onReject: onReject,
|
|
50
|
-
onTriggerByPromoCode: onTriggerByPromoCode,
|
|
51
|
-
status: status,
|
|
52
|
-
promotionCode: getByPath(content, 'promotionCode'),
|
|
53
|
-
onSuccess: function onSuccess() {
|
|
54
|
-
return selectBonus(null);
|
|
55
|
-
}
|
|
56
|
-
}),
|
|
57
|
-
React.createElement(
|
|
58
|
-
'div',
|
|
59
|
-
{ className: 'Details__content__statistics' },
|
|
60
|
-
React.createElement(
|
|
61
|
-
'ul',
|
|
62
|
-
null,
|
|
63
|
-
wageringProgress && React.createElement(
|
|
64
|
-
'li',
|
|
65
|
-
null,
|
|
66
|
-
status === 'available' ? React.createElement(Translate, {
|
|
67
|
-
id: 'label.bonus-offers.prewager',
|
|
68
|
-
defaultMessage: 'Progress'
|
|
69
|
-
}) : React.createElement(Translate, {
|
|
70
|
-
id: 'label.bonus-offers.wager',
|
|
71
|
-
defaultMessage: 'Progress'
|
|
72
|
-
}),
|
|
73
|
-
React.createElement(
|
|
74
|
-
'span',
|
|
75
|
-
null,
|
|
76
|
-
wageringProgress,
|
|
77
|
-
'%'
|
|
78
|
-
)
|
|
79
|
-
),
|
|
80
|
-
React.createElement(
|
|
81
|
-
'li',
|
|
82
|
-
null,
|
|
83
|
-
React.createElement(Translate, { id: 'label.expires.bonus', defaultMessage: 'Expires' }),
|
|
84
|
-
React.createElement(FormattedRelativeTime, selectUnit(new Date(bonus.Expires + '+00:00'), true))
|
|
85
|
-
),
|
|
86
|
-
bonus.Amount > 0 && React.createElement(
|
|
87
|
-
'li',
|
|
88
|
-
null,
|
|
89
|
-
React.createElement(Translate, { id: 'label.amount', defaultMessage: 'Amount' }),
|
|
90
|
-
React.createElement(FormattedNumber, {
|
|
91
|
-
value: bonus.Amount,
|
|
92
|
-
style: bonus.Type === 'Freespins' ? 'decimal' : 'currency',
|
|
93
|
-
currency: bonus.Currency
|
|
94
|
-
})
|
|
95
|
-
)
|
|
96
|
-
)
|
|
97
|
-
),
|
|
98
|
-
React.createElement('div', {
|
|
99
|
-
className: 'Details__content__description',
|
|
100
|
-
dangerouslySetInnerHTML: {
|
|
101
|
-
__html: marked(getByPath(content, 'content') || '')
|
|
102
|
-
}
|
|
103
|
-
}),
|
|
104
|
-
React.createElement('div', {
|
|
105
|
-
className: 'Details__content__tac',
|
|
106
|
-
dangerouslySetInnerHTML: {
|
|
107
|
-
__html: marked(getByPath(content, 'termsAndConditions') || '')
|
|
108
|
-
}
|
|
109
|
-
})
|
|
110
|
-
)
|
|
111
|
-
);
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
export default Details;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import BonusWidget from '../BonusWidget';
|
|
3
|
-
|
|
4
|
-
var Finished = function Finished(_ref) {
|
|
5
|
-
var bonuses = _ref.bonuses;
|
|
6
|
-
|
|
7
|
-
return React.createElement(
|
|
8
|
-
'div',
|
|
9
|
-
{ className: 'Finished' },
|
|
10
|
-
React.createElement(BonusWidget, {
|
|
11
|
-
bonuses: bonuses,
|
|
12
|
-
exclude: ['available', 'active'],
|
|
13
|
-
disableBonusCodeForm: true
|
|
14
|
-
})
|
|
15
|
-
);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default Finished;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import marked from 'marked';
|
|
3
|
-
import getByPath from 'lodash/get';
|
|
4
|
-
import { FormattedMessage } from 'react-intl';
|
|
5
|
-
import AccordionWidget from '../AccordionWidget';
|
|
6
|
-
import { getStatus } from '../../lib/utils/bonus';
|
|
7
|
-
|
|
8
|
-
var Item = function Item(_ref) {
|
|
9
|
-
var bonus = _ref.bonus,
|
|
10
|
-
content = _ref.content,
|
|
11
|
-
status = _ref.status,
|
|
12
|
-
defaultImage = _ref.defaultImage;
|
|
13
|
-
return React.createElement(
|
|
14
|
-
'div',
|
|
15
|
-
{ className: 'List__Item' },
|
|
16
|
-
React.createElement(
|
|
17
|
-
'div',
|
|
18
|
-
{
|
|
19
|
-
className: 'List__Item__image',
|
|
20
|
-
style: {
|
|
21
|
-
backgroundImage: 'url(' + getByPath(content, 'image.file.url', defaultImage) + ')'
|
|
22
|
-
} },
|
|
23
|
-
status === 'active' && React.createElement(
|
|
24
|
-
'span',
|
|
25
|
-
{ className: 'List__Item__image__badge' },
|
|
26
|
-
React.createElement(FormattedMessage, { id: 'label.' + bonus.State.toLowerCase() })
|
|
27
|
-
)
|
|
28
|
-
),
|
|
29
|
-
React.createElement(
|
|
30
|
-
'div',
|
|
31
|
-
{ className: 'List__Item__content' },
|
|
32
|
-
React.createElement(
|
|
33
|
-
'div',
|
|
34
|
-
{ className: 'List__Item__content__name' },
|
|
35
|
-
getByPath(content, 'name') || bonus.Name
|
|
36
|
-
),
|
|
37
|
-
React.createElement(
|
|
38
|
-
'div',
|
|
39
|
-
{ className: 'List__Item__content__summary' },
|
|
40
|
-
getByPath(content, 'summary') || bonus.Description
|
|
41
|
-
),
|
|
42
|
-
React.createElement('div', {
|
|
43
|
-
className: 'List__Item__content__disclaimer',
|
|
44
|
-
dangerouslySetInnerHTML: {
|
|
45
|
-
__html: marked(getByPath(content, 'disclaimer') || '')
|
|
46
|
-
}
|
|
47
|
-
})
|
|
48
|
-
)
|
|
49
|
-
);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
var List = function List(_ref2) {
|
|
53
|
-
var bonuses = _ref2.bonuses,
|
|
54
|
-
content = _ref2.content,
|
|
55
|
-
defaultImage = _ref2.defaultImage,
|
|
56
|
-
selectBonus = _ref2.selectBonus;
|
|
57
|
-
|
|
58
|
-
return React.createElement(
|
|
59
|
-
'div',
|
|
60
|
-
{ className: 'List' },
|
|
61
|
-
React.createElement(AccordionWidget, {
|
|
62
|
-
onClickHeader: function onClickHeader(e, key, item) {
|
|
63
|
-
return selectBonus(item.item);
|
|
64
|
-
},
|
|
65
|
-
items: bonuses.map(function (b, i) {
|
|
66
|
-
return {
|
|
67
|
-
customClass: getStatus(b),
|
|
68
|
-
item: b,
|
|
69
|
-
header: React.createElement(Item, {
|
|
70
|
-
bonus: b,
|
|
71
|
-
status: getStatus(b),
|
|
72
|
-
content: content.find(function (c) {
|
|
73
|
-
return c.identifier === b.Identifier;
|
|
74
|
-
}),
|
|
75
|
-
defaultImage: defaultImage
|
|
76
|
-
})
|
|
77
|
-
};
|
|
78
|
-
})
|
|
79
|
-
})
|
|
80
|
-
);
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export default List;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
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); } }
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { FormattedMessage } from 'react-intl';
|
|
5
|
-
import Icon from '../../components/Icon';
|
|
6
|
-
import Notice from '../CashierAccordion/Payment/Notice';
|
|
7
|
-
import List from './List.js';
|
|
8
|
-
import BonusCode from './BonusCode.js';
|
|
9
|
-
import Finished from './Finished';
|
|
10
|
-
|
|
11
|
-
var Overview = function Overview(_ref) {
|
|
12
|
-
var bonuses = _ref.bonuses,
|
|
13
|
-
content = _ref.content,
|
|
14
|
-
defaultImage = _ref.defaultImage,
|
|
15
|
-
selectBonus = _ref.selectBonus,
|
|
16
|
-
onPreClaim = _ref.onPreClaim,
|
|
17
|
-
alert = _ref.alert;
|
|
18
|
-
|
|
19
|
-
var availableBonuses = [].concat(_toConsumableArray(bonuses.active), _toConsumableArray(bonuses.available));
|
|
20
|
-
var finishedBonuses = bonuses.finished;
|
|
21
|
-
|
|
22
|
-
return React.createElement(
|
|
23
|
-
'div',
|
|
24
|
-
{ className: 'Overview' },
|
|
25
|
-
alert && React.createElement(Notice, {
|
|
26
|
-
level: alert.level,
|
|
27
|
-
icon: alert.level === 'success' ? React.createElement(Icon, { icon: 'check' }) : React.createElement(Icon, { icon: 'stop-circle' }),
|
|
28
|
-
header: React.createElement(FormattedMessage, { id: 'label.bonus-offers.' + alert.type })
|
|
29
|
-
}),
|
|
30
|
-
React.createElement(FormattedMessage, {
|
|
31
|
-
id: 'label.bonus-offers.overview-title',
|
|
32
|
-
defaultMessage: 'My Offers',
|
|
33
|
-
tagName: 'h2'
|
|
34
|
-
}),
|
|
35
|
-
availableBonuses.length === 0 && React.createElement(FormattedMessage, {
|
|
36
|
-
id: 'label.bonus-offers.overview-no-offers',
|
|
37
|
-
defaultMessage: 'No bonus offers available...',
|
|
38
|
-
tagName: 'p'
|
|
39
|
-
}),
|
|
40
|
-
availableBonuses.length > 0 && React.createElement(List, {
|
|
41
|
-
bonuses: availableBonuses,
|
|
42
|
-
content: content,
|
|
43
|
-
defaultImage: defaultImage,
|
|
44
|
-
selectBonus: selectBonus
|
|
45
|
-
}),
|
|
46
|
-
React.createElement(BonusCode, { onSubmit: onPreClaim }),
|
|
47
|
-
finishedBonuses.length > 0 && React.createElement(Finished, { bonuses: finishedBonuses })
|
|
48
|
-
);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export default Overview;
|