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
|
@@ -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,127 +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(
|
|
28
|
-
'div',
|
|
29
|
-
{
|
|
30
|
-
className: 'Details__banner',
|
|
31
|
-
style: {
|
|
32
|
-
backgroundImage: 'url(' + getByPath(content, 'image.file.url', defaultImage) + ')'
|
|
33
|
-
} },
|
|
34
|
-
React.createElement(
|
|
35
|
-
'div',
|
|
36
|
-
{ className: 'Details__banner__back', onClick: onBack },
|
|
37
|
-
React.createElement(Icon, { icon: 'chevron-left' }),
|
|
38
|
-
React.createElement(Translate, { id: 'action.back', defaultMessage: 'Back' })
|
|
39
|
-
)
|
|
40
|
-
),
|
|
41
|
-
React.createElement(
|
|
42
|
-
'div',
|
|
43
|
-
{ className: 'Details__content' },
|
|
44
|
-
alert && React.createElement(Notice, {
|
|
45
|
-
level: alert.level,
|
|
46
|
-
icon: alert.level === 'success' ? React.createElement(Icon, { icon: 'check' }) : React.createElement(Icon, { icon: 'stop-circle' }),
|
|
47
|
-
header: React.createElement(Translate, { id: 'label.bonus-offers.' + alert.type })
|
|
48
|
-
}),
|
|
49
|
-
React.createElement(
|
|
50
|
-
'div',
|
|
51
|
-
{ className: 'Details__content__name' },
|
|
52
|
-
getByPath(content, 'name') || bonus.Name
|
|
53
|
-
),
|
|
54
|
-
React.createElement(
|
|
55
|
-
'div',
|
|
56
|
-
{ className: 'Details__content__summary' },
|
|
57
|
-
getByPath(content, 'summary') || bonus.Description
|
|
58
|
-
),
|
|
59
|
-
React.createElement(Actions, {
|
|
60
|
-
bonus: bonus,
|
|
61
|
-
onClaim: onClaim,
|
|
62
|
-
onReject: onReject,
|
|
63
|
-
onTriggerByPromoCode: onTriggerByPromoCode,
|
|
64
|
-
status: status,
|
|
65
|
-
promotionCode: getByPath(content, 'promotionCode'),
|
|
66
|
-
onSuccess: function onSuccess() {
|
|
67
|
-
return selectBonus(null);
|
|
68
|
-
}
|
|
69
|
-
}),
|
|
70
|
-
React.createElement(
|
|
71
|
-
'div',
|
|
72
|
-
{ className: 'Details__content__statistics' },
|
|
73
|
-
React.createElement(
|
|
74
|
-
'ul',
|
|
75
|
-
null,
|
|
76
|
-
wageringProgress && React.createElement(
|
|
77
|
-
'li',
|
|
78
|
-
null,
|
|
79
|
-
status === 'available' ? React.createElement(Translate, {
|
|
80
|
-
id: 'label.bonus-offers.prewager',
|
|
81
|
-
defaultMessage: 'Progress'
|
|
82
|
-
}) : React.createElement(Translate, {
|
|
83
|
-
id: 'label.bonus-offers.wager',
|
|
84
|
-
defaultMessage: 'Progress'
|
|
85
|
-
}),
|
|
86
|
-
React.createElement(
|
|
87
|
-
'span',
|
|
88
|
-
null,
|
|
89
|
-
wageringProgress,
|
|
90
|
-
'%'
|
|
91
|
-
)
|
|
92
|
-
),
|
|
93
|
-
React.createElement(
|
|
94
|
-
'li',
|
|
95
|
-
null,
|
|
96
|
-
React.createElement(Translate, { id: 'label.expires.bonus', defaultMessage: 'Expires' }),
|
|
97
|
-
React.createElement(FormattedRelativeTime, selectUnit(new Date(bonus.Expires + '+00:00'), true))
|
|
98
|
-
),
|
|
99
|
-
bonus.Amount > 0 && React.createElement(
|
|
100
|
-
'li',
|
|
101
|
-
null,
|
|
102
|
-
React.createElement(Translate, { id: 'label.amount', defaultMessage: 'Amount' }),
|
|
103
|
-
React.createElement(FormattedNumber, {
|
|
104
|
-
value: bonus.Amount,
|
|
105
|
-
style: bonus.Type === 'Freespins' ? 'decimal' : 'currency',
|
|
106
|
-
currency: bonus.Currency
|
|
107
|
-
})
|
|
108
|
-
)
|
|
109
|
-
)
|
|
110
|
-
),
|
|
111
|
-
React.createElement('div', {
|
|
112
|
-
className: 'Details__content__description',
|
|
113
|
-
dangerouslySetInnerHTML: {
|
|
114
|
-
__html: marked(getByPath(content, 'content') || '')
|
|
115
|
-
}
|
|
116
|
-
}),
|
|
117
|
-
React.createElement('div', {
|
|
118
|
-
className: 'Details__content__tac',
|
|
119
|
-
dangerouslySetInnerHTML: {
|
|
120
|
-
__html: marked(getByPath(content, 'termsAndConditions') || '')
|
|
121
|
-
}
|
|
122
|
-
})
|
|
123
|
-
)
|
|
124
|
-
);
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
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: 'h3'
|
|
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;
|
|
@@ -1,78 +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, useEffect } from 'react';
|
|
4
|
-
import Overview from './Overview';
|
|
5
|
-
import Details from './Details';
|
|
6
|
-
import { categorizeByState, getWageringProgress, getStatus } from '../../lib/utils/bonus';
|
|
7
|
-
|
|
8
|
-
var BonusOffers = function BonusOffers(_ref) {
|
|
9
|
-
var bonuses = _ref.bonuses,
|
|
10
|
-
content = _ref.content,
|
|
11
|
-
defaultImage = _ref.defaultImage,
|
|
12
|
-
onClaim = _ref.onClaim,
|
|
13
|
-
onCancel = _ref.onCancel,
|
|
14
|
-
onReject = _ref.onReject,
|
|
15
|
-
onPreClaim = _ref.onPreClaim,
|
|
16
|
-
onTriggerByPromoCode = _ref.onTriggerByPromoCode,
|
|
17
|
-
onOther = _ref.onOther,
|
|
18
|
-
getBonus = _ref.getBonus,
|
|
19
|
-
alerts = _ref.alerts,
|
|
20
|
-
removeAlert = _ref.removeAlert,
|
|
21
|
-
scrollToTop = _ref.scrollToTop;
|
|
22
|
-
|
|
23
|
-
var _useState = useState(null),
|
|
24
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
25
|
-
selectedBonus = _useState2[0],
|
|
26
|
-
_selectBonus = _useState2[1];
|
|
27
|
-
|
|
28
|
-
var mappedBonuses = categorizeByState(bonuses);
|
|
29
|
-
var alert = alerts && alerts.length > 0 ? alerts[0] : null;
|
|
30
|
-
|
|
31
|
-
useEffect(function () {
|
|
32
|
-
scrollToTop();
|
|
33
|
-
alert && removeAlert(alert.type);
|
|
34
|
-
}, [selectedBonus]);
|
|
35
|
-
|
|
36
|
-
useEffect(function () {
|
|
37
|
-
alert && scrollToTop();
|
|
38
|
-
}, [alert]);
|
|
39
|
-
|
|
40
|
-
return React.createElement(
|
|
41
|
-
'div',
|
|
42
|
-
{ className: 'BonusOffers' },
|
|
43
|
-
!selectedBonus && React.createElement(Overview, {
|
|
44
|
-
bonuses: mappedBonuses,
|
|
45
|
-
content: content,
|
|
46
|
-
defaultImage: defaultImage,
|
|
47
|
-
selectBonus: function selectBonus(bonus) {
|
|
48
|
-
return _selectBonus(bonus);
|
|
49
|
-
},
|
|
50
|
-
onPreClaim: onPreClaim,
|
|
51
|
-
alert: alert
|
|
52
|
-
}),
|
|
53
|
-
selectedBonus && React.createElement(Details, {
|
|
54
|
-
bonus: selectedBonus,
|
|
55
|
-
content: content.find(function (c) {
|
|
56
|
-
return c.identifier === selectedBonus.Identifier;
|
|
57
|
-
}) || {},
|
|
58
|
-
defaultImage: defaultImage,
|
|
59
|
-
wageringProgress: getWageringProgress(selectedBonus),
|
|
60
|
-
onBack: function onBack() {
|
|
61
|
-
return _selectBonus(null);
|
|
62
|
-
},
|
|
63
|
-
status: getStatus(selectedBonus),
|
|
64
|
-
onClaim: onClaim,
|
|
65
|
-
onReject: onReject,
|
|
66
|
-
onCancel: onCancel,
|
|
67
|
-
onTriggerByPromoCode: onTriggerByPromoCode,
|
|
68
|
-
onOther: onOther,
|
|
69
|
-
getBonus: getBonus,
|
|
70
|
-
selectBonus: function selectBonus(bonus) {
|
|
71
|
-
return _selectBonus(bonus);
|
|
72
|
-
},
|
|
73
|
-
alert: alert
|
|
74
|
-
})
|
|
75
|
-
);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export default BonusOffers;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _react = require('react');
|
|
8
|
-
|
|
9
|
-
var _react2 = _interopRequireDefault(_react);
|
|
10
|
-
|
|
11
|
-
var _Icon = require('../Icon');
|
|
12
|
-
|
|
13
|
-
var _Icon2 = _interopRequireDefault(_Icon);
|
|
14
|
-
|
|
15
|
-
var _classnames = require('classnames');
|
|
16
|
-
|
|
17
|
-
var _classnames2 = _interopRequireDefault(_classnames);
|
|
18
|
-
|
|
19
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
-
|
|
21
|
-
var Message = function Message(_ref) {
|
|
22
|
-
var closeButton = _ref.closeButton,
|
|
23
|
-
count = _ref.count,
|
|
24
|
-
onClick = _ref.onClick,
|
|
25
|
-
onClose = _ref.onClose,
|
|
26
|
-
content = _ref.content,
|
|
27
|
-
className = _ref.className,
|
|
28
|
-
icon = _ref.icon;
|
|
29
|
-
|
|
30
|
-
return _react2.default.createElement(
|
|
31
|
-
'div',
|
|
32
|
-
{ className: (0, _classnames2.default)('Message', className), onClick: onClick },
|
|
33
|
-
closeButton && _react2.default.createElement(
|
|
34
|
-
'span',
|
|
35
|
-
{ className: 'close', onClick: onClose },
|
|
36
|
-
_react2.default.createElement(_Icon2.default, { icon: 'times' })
|
|
37
|
-
),
|
|
38
|
-
icon && _react2.default.createElement(
|
|
39
|
-
'div',
|
|
40
|
-
{ className: 'icon' },
|
|
41
|
-
_react2.default.createElement(_Icon2.default, { icon: '' + icon })
|
|
42
|
-
),
|
|
43
|
-
_react2.default.createElement(
|
|
44
|
-
'div',
|
|
45
|
-
{ className: 'content' },
|
|
46
|
-
content
|
|
47
|
-
),
|
|
48
|
-
count && _react2.default.createElement(
|
|
49
|
-
'div',
|
|
50
|
-
{ className: 'count' },
|
|
51
|
-
count
|
|
52
|
-
),
|
|
53
|
-
_react2.default.createElement(_Icon2.default, { icon: 'chevron-right' })
|
|
54
|
-
);
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
exports.default = Message;
|