tg-core-components 6.1.2 → 6.1.8

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.
@@ -0,0 +1,64 @@
1
+ var MILISECONDS = {
2
+ IN_A_SECOND: 1000,
3
+ IN_A_MINUTE: 60000,
4
+ IN_AN_HOUR: 3600000,
5
+ IN_A_DAY: 86400000,
6
+ IN_A_WEEK: 604800000,
7
+ IN_A_MONTH: 2628000000,
8
+ IN_A_YEAR: 31536000000
9
+ };
10
+
11
+ export var selectUnit = function selectUnit(from) {
12
+ var now = Date.now();
13
+ var ms = now - from;
14
+
15
+ switch (true) {
16
+ case MILISECONDS.IN_A_SECOND < ms && ms < MILISECONDS.IN_A_MINUTE:
17
+ return {
18
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_SECOND),
19
+ unit: 'second',
20
+ updateIntervalInSeconds: 1
21
+ };
22
+
23
+ case MILISECONDS.IN_A_MINUTE < ms && ms < MILISECONDS.IN_AN_HOUR:
24
+ return {
25
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_MINUTE),
26
+ unit: 'minute'
27
+ };
28
+
29
+ case MILISECONDS.IN_AN_HOUR < ms && ms < MILISECONDS.IN_A_DAY:
30
+ return {
31
+ value: -1 * Math.floor(ms / MILISECONDS.IN_AN_HOUR),
32
+ unit: 'hour'
33
+ };
34
+
35
+ case MILISECONDS.IN_A_DAY < ms && ms < MILISECONDS.IN_A_WEEK:
36
+ return {
37
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_DAY),
38
+ unit: 'day'
39
+ };
40
+
41
+ case MILISECONDS.IN_A_WEEK < ms && ms < MILISECONDS.IN_A_MONTH:
42
+ return {
43
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_WEEK),
44
+ unit: 'week'
45
+ };
46
+
47
+ case MILISECONDS.IN_A_MONTH < ms && ms < MILISECONDS.IN_A_YEAR:
48
+ return {
49
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_MONTH),
50
+ unit: 'month'
51
+ };
52
+
53
+ case MILISECONDS.IN_A_YEAR < ms:
54
+ return {
55
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_YEAR),
56
+ unit: 'year'
57
+ };
58
+
59
+ default:
60
+ return {
61
+ value: 0
62
+ };
63
+ }
64
+ };
@@ -133,7 +133,11 @@ var PaymentForm = function (_Component) {
133
133
 
134
134
  if (data.redirectOutput == null) {
135
135
  if (onSuccess) {
136
- onSuccess();
136
+ onSuccess({
137
+ amount: data.amount,
138
+ currency: data.currency,
139
+ tx: Number(data.transactionId)
140
+ });
137
141
  return null;
138
142
  }
139
143
 
@@ -542,12 +542,12 @@ var BankIntl = function BankIntl(_ref9) {
542
542
  { className: 'payment-account-info' },
543
543
  React.createElement(Input, {
544
544
  required: true,
545
- name: 'accountNumber',
546
- value: account.accountId ? account.maskedAccount.replace(/\d*-/g, '') : values['accountNumber'],
547
- onChange: function onChange(e, accountNumber) {
548
- return change('accountNumber', accountNumber);
545
+ name: 'iban',
546
+ value: account.accountId ? account.maskedAccount.replace(/\d*-/g, '') : values['iban'],
547
+ onChange: function onChange(e, iban) {
548
+ return change('iban', iban);
549
549
  },
550
- label: translate({ id: 'cashier.details.accountNumber' }, intl),
550
+ label: translate({ id: 'cashier.details.iban' }, intl),
551
551
  disabled: account.accountId
552
552
  }),
553
553
  React.createElement(Input, {
@@ -757,6 +757,69 @@ var EzeeWallet = function EzeeWallet(_ref14) {
757
757
  );
758
758
  };
759
759
 
760
+ var Paramount = function Paramount(_ref15) {
761
+ var account = _ref15.account,
762
+ intl = _ref15.intl,
763
+ values = _ref15.values,
764
+ change = _ref15.change,
765
+ detail = _ref15.detail;
766
+
767
+ var methodDetails = {
768
+ securityQuestions: getByPath(detail, 'config.securityQuestions', [])
769
+ };
770
+
771
+ return React.createElement(
772
+ 'div',
773
+ { className: 'payment-account-info' },
774
+ methodDetails.securityQuestions.length > 0 && React.createElement(
775
+ Select,
776
+ {
777
+ required: true,
778
+ disabled: account.accountId,
779
+ name: 'securityQuestion',
780
+ value: values['securityQuestion'],
781
+ onChange: function onChange(_, securityQuestion) {
782
+ return change('securityQuestion', securityQuestion);
783
+ },
784
+ label: translate({
785
+ id: 'cashier.details.securityQuestion',
786
+ defaultMessage: 'Security question'
787
+ }, intl) },
788
+ !values['securityQuestion'] && React.createElement(
789
+ Select.Option,
790
+ { value: '', selected: true, disabled: true },
791
+ translate({
792
+ id: 'cashier.details.select-securityQuestion',
793
+ defaultMessage: 'Select security question'
794
+ }, intl)
795
+ ),
796
+ methodDetails.securityQuestions.map(function (securityQuestion) {
797
+ return React.createElement(
798
+ Select.Option,
799
+ { value: securityQuestion.value },
800
+ translate({
801
+ id: securityQuestion.id,
802
+ defaultMessage: securityQuestion.value
803
+ }, intl)
804
+ );
805
+ })
806
+ ),
807
+ React.createElement(Input, {
808
+ required: true,
809
+ type: 'password',
810
+ name: 'securityAnswer',
811
+ value: values['securityAnswer'],
812
+ onChange: function onChange(_, securityAnswer) {
813
+ return change('securityAnswer', securityAnswer);
814
+ },
815
+ label: translate({
816
+ id: 'cashier.details.securityAnswer',
817
+ defaultMessage: 'Security answer'
818
+ }, intl)
819
+ })
820
+ );
821
+ };
822
+
760
823
  export var SkrillDeposit = {
761
824
  component: injectIntl(Email),
762
825
  parser: Parser.parseEmail
@@ -918,6 +981,11 @@ export var EzeeWalletWithdrawal = {
918
981
  parser: identity
919
982
  };
920
983
 
984
+ export var ParamountWithdrawal = {
985
+ component: injectIntl(Paramount),
986
+ parser: Parser.parseParamount
987
+ };
988
+
921
989
  export var MiFinityEWalletWithdrawal = {
922
990
  component: injectIntl(Mifinity),
923
991
  parser: identity
@@ -43,4 +43,10 @@ export var parseMifinity = function parseMifinity(account) {
43
43
  return {
44
44
  account: account.maskedAccount || account.account
45
45
  };
46
+ };
47
+
48
+ export var parseParamount = function parseParamount(account) {
49
+ return {
50
+ securityQuestion: account.maskedAccount || account.account
51
+ };
46
52
  };
@@ -17,71 +17,7 @@ import { SkeletonLine } from '../../components/Skeleton';
17
17
  import getByPath from 'lodash/get';
18
18
  import Translate from '../../components/Translate';
19
19
  import { getMessage } from './message';
20
-
21
- var MILISECONDS = {
22
- IN_A_SECOND: 1000,
23
- IN_A_MINUTE: 60000,
24
- IN_AN_HOUR: 3600000,
25
- IN_A_DAY: 86400000,
26
- IN_A_WEEK: 604800000,
27
- IN_A_MONTH: 2628000000,
28
- IN_A_YEAR: 31536000000
29
- };
30
-
31
- var selectUnit = function selectUnit(from) {
32
- var now = Date.now();
33
- var ms = now - from;
34
-
35
- switch (true) {
36
- case MILISECONDS.IN_A_SECOND < ms && ms < MILISECONDS.IN_A_MINUTE:
37
- return {
38
- value: -1 * Math.floor(ms / MILISECONDS.IN_A_SECOND),
39
- unit: 'second',
40
- updateIntervalInSeconds: 1
41
- };
42
-
43
- case MILISECONDS.IN_A_MINUTE < ms && ms < MILISECONDS.IN_AN_HOUR:
44
- return {
45
- value: -1 * Math.floor(ms / MILISECONDS.IN_A_MINUTE),
46
- unit: 'minute'
47
- };
48
-
49
- case MILISECONDS.IN_AN_HOUR < ms && ms < MILISECONDS.IN_A_DAY:
50
- return {
51
- value: -1 * Math.floor(ms / MILISECONDS.IN_AN_HOUR),
52
- unit: 'hour'
53
- };
54
-
55
- case MILISECONDS.IN_A_DAY < ms && ms < MILISECONDS.IN_A_WEEK:
56
- return {
57
- value: -1 * Math.floor(ms / MILISECONDS.IN_A_DAY),
58
- unit: 'day'
59
- };
60
-
61
- case MILISECONDS.IN_A_WEEK < ms && ms < MILISECONDS.IN_A_MONTH:
62
- return {
63
- value: -1 * Math.floor(ms / MILISECONDS.IN_A_WEEK),
64
- unit: 'week'
65
- };
66
-
67
- case MILISECONDS.IN_A_MONTH < ms && ms < MILISECONDS.IN_A_YEAR:
68
- return {
69
- value: -1 * Math.floor(ms / MILISECONDS.IN_A_MONTH),
70
- unit: 'month'
71
- };
72
-
73
- case MILISECONDS.IN_A_YEAR < ms:
74
- return {
75
- value: -1 * Math.floor(ms / MILISECONDS.IN_A_YEAR),
76
- unit: 'year'
77
- };
78
-
79
- default:
80
- return {
81
- value: 0
82
- };
83
- }
84
- };
20
+ import { selectUnit } from '../../lib/utils/selectUnit';
85
21
 
86
22
  var HistoryWidgetList = function (_React$Component) {
87
23
  _inherits(HistoryWidgetList, _React$Component);
@@ -19,10 +19,10 @@ import { FormattedRelativeTime } from 'react-intl';
19
19
  import getByPath from 'lodash/get';
20
20
  import PropTypes from 'prop-types';
21
21
  import Translate from '../../components/Translate';
22
- import { selectUnit } from '@formatjs/intl-utils';
23
22
  import { getKycType } from '../Verify/types';
24
23
  import { getKycReason } from '../Verify/reasons';
25
24
  import { getKycStatus } from '../Verify/status';
25
+ import { selectUnit } from '../../lib/utils/selectUnit';
26
26
 
27
27
  var UploadForm = function UploadForm(_ref) {
28
28
  var type = _ref.type,
@@ -0,0 +1,69 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var MILISECONDS = {
7
+ IN_A_SECOND: 1000,
8
+ IN_A_MINUTE: 60000,
9
+ IN_AN_HOUR: 3600000,
10
+ IN_A_DAY: 86400000,
11
+ IN_A_WEEK: 604800000,
12
+ IN_A_MONTH: 2628000000,
13
+ IN_A_YEAR: 31536000000
14
+ };
15
+
16
+ var selectUnit = exports.selectUnit = function selectUnit(from) {
17
+ var now = Date.now();
18
+ var ms = now - from;
19
+
20
+ switch (true) {
21
+ case MILISECONDS.IN_A_SECOND < ms && ms < MILISECONDS.IN_A_MINUTE:
22
+ return {
23
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_SECOND),
24
+ unit: 'second',
25
+ updateIntervalInSeconds: 1
26
+ };
27
+
28
+ case MILISECONDS.IN_A_MINUTE < ms && ms < MILISECONDS.IN_AN_HOUR:
29
+ return {
30
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_MINUTE),
31
+ unit: 'minute'
32
+ };
33
+
34
+ case MILISECONDS.IN_AN_HOUR < ms && ms < MILISECONDS.IN_A_DAY:
35
+ return {
36
+ value: -1 * Math.floor(ms / MILISECONDS.IN_AN_HOUR),
37
+ unit: 'hour'
38
+ };
39
+
40
+ case MILISECONDS.IN_A_DAY < ms && ms < MILISECONDS.IN_A_WEEK:
41
+ return {
42
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_DAY),
43
+ unit: 'day'
44
+ };
45
+
46
+ case MILISECONDS.IN_A_WEEK < ms && ms < MILISECONDS.IN_A_MONTH:
47
+ return {
48
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_WEEK),
49
+ unit: 'week'
50
+ };
51
+
52
+ case MILISECONDS.IN_A_MONTH < ms && ms < MILISECONDS.IN_A_YEAR:
53
+ return {
54
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_MONTH),
55
+ unit: 'month'
56
+ };
57
+
58
+ case MILISECONDS.IN_A_YEAR < ms:
59
+ return {
60
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_YEAR),
61
+ unit: 'year'
62
+ };
63
+
64
+ default:
65
+ return {
66
+ value: 0
67
+ };
68
+ }
69
+ };
@@ -165,7 +165,11 @@ var PaymentForm = function (_Component) {
165
165
 
166
166
  if (data.redirectOutput == null) {
167
167
  if (onSuccess) {
168
- onSuccess();
168
+ onSuccess({
169
+ amount: data.amount,
170
+ currency: data.currency,
171
+ tx: Number(data.transactionId)
172
+ });
169
173
  return null;
170
174
  }
171
175
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.InteracWithdrawal = exports.PaysafecardWithdrawal = exports.InstadebitWithdrawal = exports.IDebitWithdrawal = exports.IdealWithdrawal = exports.EProPaymentWallWithdrawal = exports.EcoPayzWithdrawal = exports.TrustlyWithdrawal = exports.BankWithdrawal = exports.ZimplerWithdrawal = exports.MiFinityEWalletWithdrawal = exports.EzeeWalletWithdrawal = exports.AstroPayBankWithdrawal = exports.MuchBetterWithdrawal = exports.NetellerWithdrawal = exports.VenusPointWithdrawal = exports.CreditcardWithdrawal = exports.SkrillWithdrawal = exports.BankIBANWithdrawal = exports.BankLocalWithdrawal = exports.JetonWithdrawal = exports.CryptoCurrencyWithdrawal = exports.BestPayWithdrawal = exports.BankIntlWithdrawal = exports.MiFinityEWalletDeposit = exports.BankIntlDeposit = exports.BestPayDeposit = exports.FunangaDeposit = exports.PaysafecardDeposit = exports.InstadebitDeposit = exports.IDebitDeposit = exports.IdealDeposit = exports.EProPaymentWallDeposit = exports.EcoPayzDeposit = exports.TrustlyDeposit = exports.BankDeposit = exports.ZimplerDeposit = exports.EzeeWalletDeposit = exports.CryptoCurrencyDeposit = exports.AstroPayBankDeposit = exports.MobilePayDeposit = exports.PProDeposit = exports.MuchBetterDeposit = exports.SiruDeposit = exports.VenusPointDeposit = exports.NetellerDeposit = exports.CreditcardDeposit = exports.SkrillDeposit = undefined;
6
+ exports.InteracWithdrawal = exports.PaysafecardWithdrawal = exports.InstadebitWithdrawal = exports.IDebitWithdrawal = exports.IdealWithdrawal = exports.EProPaymentWallWithdrawal = exports.EcoPayzWithdrawal = exports.TrustlyWithdrawal = exports.BankWithdrawal = exports.ZimplerWithdrawal = exports.MiFinityEWalletWithdrawal = exports.ParamountWithdrawal = exports.EzeeWalletWithdrawal = exports.AstroPayBankWithdrawal = exports.MuchBetterWithdrawal = exports.NetellerWithdrawal = exports.VenusPointWithdrawal = exports.CreditcardWithdrawal = exports.SkrillWithdrawal = exports.BankIBANWithdrawal = exports.BankLocalWithdrawal = exports.JetonWithdrawal = exports.CryptoCurrencyWithdrawal = exports.BestPayWithdrawal = exports.BankIntlWithdrawal = exports.MiFinityEWalletDeposit = exports.BankIntlDeposit = exports.BestPayDeposit = exports.FunangaDeposit = exports.PaysafecardDeposit = exports.InstadebitDeposit = exports.IDebitDeposit = exports.IdealDeposit = exports.EProPaymentWallDeposit = exports.EcoPayzDeposit = exports.TrustlyDeposit = exports.BankDeposit = exports.ZimplerDeposit = exports.EzeeWalletDeposit = exports.CryptoCurrencyDeposit = exports.AstroPayBankDeposit = exports.MobilePayDeposit = exports.PProDeposit = exports.MuchBetterDeposit = exports.SiruDeposit = exports.VenusPointDeposit = exports.NetellerDeposit = exports.CreditcardDeposit = exports.SkrillDeposit = undefined;
7
7
 
8
8
  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"); } }; }();
9
9
 
@@ -585,12 +585,12 @@ var BankIntl = function BankIntl(_ref9) {
585
585
  { className: 'payment-account-info' },
586
586
  _react2.default.createElement(_Input2.default, {
587
587
  required: true,
588
- name: 'accountNumber',
589
- value: account.accountId ? account.maskedAccount.replace(/\d*-/g, '') : values['accountNumber'],
590
- onChange: function onChange(e, accountNumber) {
591
- return change('accountNumber', accountNumber);
588
+ name: 'iban',
589
+ value: account.accountId ? account.maskedAccount.replace(/\d*-/g, '') : values['iban'],
590
+ onChange: function onChange(e, iban) {
591
+ return change('iban', iban);
592
592
  },
593
- label: (0, _translate2.default)({ id: 'cashier.details.accountNumber' }, intl),
593
+ label: (0, _translate2.default)({ id: 'cashier.details.iban' }, intl),
594
594
  disabled: account.accountId
595
595
  }),
596
596
  _react2.default.createElement(_Input2.default, {
@@ -800,6 +800,69 @@ var EzeeWallet = function EzeeWallet(_ref14) {
800
800
  );
801
801
  };
802
802
 
803
+ var Paramount = function Paramount(_ref15) {
804
+ var account = _ref15.account,
805
+ intl = _ref15.intl,
806
+ values = _ref15.values,
807
+ change = _ref15.change,
808
+ detail = _ref15.detail;
809
+
810
+ var methodDetails = {
811
+ securityQuestions: (0, _get2.default)(detail, 'config.securityQuestions', [])
812
+ };
813
+
814
+ return _react2.default.createElement(
815
+ 'div',
816
+ { className: 'payment-account-info' },
817
+ methodDetails.securityQuestions.length > 0 && _react2.default.createElement(
818
+ _Select2.default,
819
+ {
820
+ required: true,
821
+ disabled: account.accountId,
822
+ name: 'securityQuestion',
823
+ value: values['securityQuestion'],
824
+ onChange: function onChange(_, securityQuestion) {
825
+ return change('securityQuestion', securityQuestion);
826
+ },
827
+ label: (0, _translate2.default)({
828
+ id: 'cashier.details.securityQuestion',
829
+ defaultMessage: 'Security question'
830
+ }, intl) },
831
+ !values['securityQuestion'] && _react2.default.createElement(
832
+ _Select2.default.Option,
833
+ { value: '', selected: true, disabled: true },
834
+ (0, _translate2.default)({
835
+ id: 'cashier.details.select-securityQuestion',
836
+ defaultMessage: 'Select security question'
837
+ }, intl)
838
+ ),
839
+ methodDetails.securityQuestions.map(function (securityQuestion) {
840
+ return _react2.default.createElement(
841
+ _Select2.default.Option,
842
+ { value: securityQuestion.value },
843
+ (0, _translate2.default)({
844
+ id: securityQuestion.id,
845
+ defaultMessage: securityQuestion.value
846
+ }, intl)
847
+ );
848
+ })
849
+ ),
850
+ _react2.default.createElement(_Input2.default, {
851
+ required: true,
852
+ type: 'password',
853
+ name: 'securityAnswer',
854
+ value: values['securityAnswer'],
855
+ onChange: function onChange(_, securityAnswer) {
856
+ return change('securityAnswer', securityAnswer);
857
+ },
858
+ label: (0, _translate2.default)({
859
+ id: 'cashier.details.securityAnswer',
860
+ defaultMessage: 'Security answer'
861
+ }, intl)
862
+ })
863
+ );
864
+ };
865
+
803
866
  var SkrillDeposit = exports.SkrillDeposit = {
804
867
  component: (0, _reactIntl.injectIntl)(Email),
805
868
  parser: Parser.parseEmail
@@ -961,6 +1024,11 @@ var EzeeWalletWithdrawal = exports.EzeeWalletWithdrawal = {
961
1024
  parser: _identity2.default
962
1025
  };
963
1026
 
1027
+ var ParamountWithdrawal = exports.ParamountWithdrawal = {
1028
+ component: (0, _reactIntl.injectIntl)(Paramount),
1029
+ parser: Parser.parseParamount
1030
+ };
1031
+
964
1032
  var MiFinityEWalletWithdrawal = exports.MiFinityEWalletWithdrawal = {
965
1033
  component: (0, _reactIntl.injectIntl)(Mifinity),
966
1034
  parser: _identity2.default
@@ -48,4 +48,10 @@ var parseMifinity = exports.parseMifinity = function parseMifinity(account) {
48
48
  return {
49
49
  account: account.maskedAccount || account.account
50
50
  };
51
+ };
52
+
53
+ var parseParamount = exports.parseParamount = function parseParamount(account) {
54
+ return {
55
+ securityQuestion: account.maskedAccount || account.account
56
+ };
51
57
  };
@@ -44,6 +44,8 @@ var _Translate2 = _interopRequireDefault(_Translate);
44
44
 
45
45
  var _message = require('./message');
46
46
 
47
+ var _selectUnit = require('../../lib/utils/selectUnit');
48
+
47
49
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
48
50
 
49
51
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -52,71 +54,6 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
52
54
 
53
55
  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; }
54
56
 
55
- var MILISECONDS = {
56
- IN_A_SECOND: 1000,
57
- IN_A_MINUTE: 60000,
58
- IN_AN_HOUR: 3600000,
59
- IN_A_DAY: 86400000,
60
- IN_A_WEEK: 604800000,
61
- IN_A_MONTH: 2628000000,
62
- IN_A_YEAR: 31536000000
63
- };
64
-
65
- var selectUnit = function selectUnit(from) {
66
- var now = Date.now();
67
- var ms = now - from;
68
-
69
- switch (true) {
70
- case MILISECONDS.IN_A_SECOND < ms && ms < MILISECONDS.IN_A_MINUTE:
71
- return {
72
- value: -1 * Math.floor(ms / MILISECONDS.IN_A_SECOND),
73
- unit: 'second',
74
- updateIntervalInSeconds: 1
75
- };
76
-
77
- case MILISECONDS.IN_A_MINUTE < ms && ms < MILISECONDS.IN_AN_HOUR:
78
- return {
79
- value: -1 * Math.floor(ms / MILISECONDS.IN_A_MINUTE),
80
- unit: 'minute'
81
- };
82
-
83
- case MILISECONDS.IN_AN_HOUR < ms && ms < MILISECONDS.IN_A_DAY:
84
- return {
85
- value: -1 * Math.floor(ms / MILISECONDS.IN_AN_HOUR),
86
- unit: 'hour'
87
- };
88
-
89
- case MILISECONDS.IN_A_DAY < ms && ms < MILISECONDS.IN_A_WEEK:
90
- return {
91
- value: -1 * Math.floor(ms / MILISECONDS.IN_A_DAY),
92
- unit: 'day'
93
- };
94
-
95
- case MILISECONDS.IN_A_WEEK < ms && ms < MILISECONDS.IN_A_MONTH:
96
- return {
97
- value: -1 * Math.floor(ms / MILISECONDS.IN_A_WEEK),
98
- unit: 'week'
99
- };
100
-
101
- case MILISECONDS.IN_A_MONTH < ms && ms < MILISECONDS.IN_A_YEAR:
102
- return {
103
- value: -1 * Math.floor(ms / MILISECONDS.IN_A_MONTH),
104
- unit: 'month'
105
- };
106
-
107
- case MILISECONDS.IN_A_YEAR < ms:
108
- return {
109
- value: -1 * Math.floor(ms / MILISECONDS.IN_A_YEAR),
110
- unit: 'year'
111
- };
112
-
113
- default:
114
- return {
115
- value: 0
116
- };
117
- }
118
- };
119
-
120
57
  var HistoryWidgetList = function (_React$Component) {
121
58
  _inherits(HistoryWidgetList, _React$Component);
122
59
 
@@ -155,7 +92,7 @@ var HistoryWidgetList = function (_React$Component) {
155
92
  'div',
156
93
  null,
157
94
  (0, _message.getMessage)((0, _get2.default)(item, 'Transactions[0].Status'))
158
- )], [_react2.default.createElement(_Money2.default, { value: item.Win - item.Bet, currency: currency }), _react2.default.createElement(_reactIntl.FormattedRelativeTime, selectUnit(new Date(item.StartTime + '+00:00')))]];
95
+ )], [_react2.default.createElement(_Money2.default, { value: item.Win - item.Bet, currency: currency }), _react2.default.createElement(_reactIntl.FormattedRelativeTime, (0, _selectUnit.selectUnit)(new Date(item.StartTime + '+00:00')))]];
159
96
  } else if (product === 'sportsbook') {
160
97
  var selection = item.Transactions[0].Description;
161
98
  var odds = item.Transactions[0].Odds;
@@ -171,7 +108,7 @@ var HistoryWidgetList = function (_React$Component) {
171
108
  'div',
172
109
  null,
173
110
  (0, _message.getMessage)(item.Settled ? 'settled' : 'pendling')
174
- )], [_react2.default.createElement(_Money2.default, { value: item.TotalWin - item.TotalWager, currency: currency }), _react2.default.createElement(_reactIntl.FormattedRelativeTime, selectUnit(new Date(item.Created + '+00:00')))]];
111
+ )], [_react2.default.createElement(_Money2.default, { value: item.TotalWin - item.TotalWager, currency: currency }), _react2.default.createElement(_reactIntl.FormattedRelativeTime, (0, _selectUnit.selectUnit)(new Date(item.Created + '+00:00')))]];
175
112
  } else if (product === 'bingo') {
176
113
  return [[_react2.default.createElement(_Translate2.default, {
177
114
  tag: 'div'
@@ -184,7 +121,7 @@ var HistoryWidgetList = function (_React$Component) {
184
121
  )], [_react2.default.createElement(_Money2.default, {
185
122
  value: (0, _get2.default)(item, 'Transactions[0].Amount'),
186
123
  currency: currency
187
- }), _react2.default.createElement(_reactIntl.FormattedRelativeTime, selectUnit(new Date(item.Created + '+00:00')))]];
124
+ }), _react2.default.createElement(_reactIntl.FormattedRelativeTime, (0, _selectUnit.selectUnit)(new Date(item.Created + '+00:00')))]];
188
125
  } else if (product === 'fantasy') {
189
126
  return [[_react2.default.createElement(
190
127
  'div',
@@ -199,7 +136,7 @@ var HistoryWidgetList = function (_React$Component) {
199
136
  )], [_react2.default.createElement(_Money2.default, {
200
137
  value: item.Win - (item.Bet + item.Rake),
201
138
  currency: currency
202
- }), _react2.default.createElement(_reactIntl.FormattedRelativeTime, selectUnit(new Date(item.Created + '+00:00')))]];
139
+ }), _react2.default.createElement(_reactIntl.FormattedRelativeTime, (0, _selectUnit.selectUnit)(new Date(item.Created + '+00:00')))]];
203
140
  }
204
141
 
205
142
  return [[_react2.default.createElement(
@@ -213,7 +150,7 @@ var HistoryWidgetList = function (_React$Component) {
213
150
  )], [_react2.default.createElement(_Money2.default, {
214
151
  value: item.TransactionType === 'Withdraw' ? -item.Amount : item.Amount,
215
152
  currency: currency
216
- }), _react2.default.createElement(_reactIntl.FormattedRelativeTime, selectUnit(new Date(item.Started + '+00:00')))]];
153
+ }), _react2.default.createElement(_reactIntl.FormattedRelativeTime, (0, _selectUnit.selectUnit)(new Date(item.Started + '+00:00')))]];
217
154
  }, _this.createListDetail = function (item, product, currency) {
218
155
  if (product === 'casino') {
219
156
  return [[_react2.default.createElement(
@@ -44,14 +44,14 @@ var _Translate = require('../../components/Translate');
44
44
 
45
45
  var _Translate2 = _interopRequireDefault(_Translate);
46
46
 
47
- var _intlUtils = require('@formatjs/intl-utils');
48
-
49
47
  var _types = require('../Verify/types');
50
48
 
51
49
  var _reasons = require('../Verify/reasons');
52
50
 
53
51
  var _status = require('../Verify/status');
54
52
 
53
+ var _selectUnit = require('../../lib/utils/selectUnit');
54
+
55
55
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
56
56
 
57
57
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -119,7 +119,7 @@ var KYCList = function KYCList(_ref2) {
119
119
  'div',
120
120
  { className: 'bold' },
121
121
  (0, _types.getKycType)(item.Type)
122
- ), (0, _status.getKycStatus)(item.Status)], [_react2.default.createElement('div', { className: 'space' }), _react2.default.createElement(_reactIntl.FormattedRelativeTime, (0, _intlUtils.selectUnit)(new Date(item.Added + '+00:00')))]],
122
+ ), (0, _status.getKycStatus)(item.Status)], [_react2.default.createElement('div', { className: 'space' }), _react2.default.createElement(_reactIntl.FormattedRelativeTime, (0, _selectUnit.selectUnit)(new Date(item.Added + '+00:00')))]],
123
123
  detail: [[_react2.default.createElement(_Translate2.default, { id: 'label.comment', defaultMessage: 'Comment' }), _react2.default.createElement(_Translate2.default, { id: 'label.reasons', defaultMessage: 'Reasons' })], [item.Comment ? _react2.default.createElement(
124
124
  'span',
125
125
  null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tg-core-components",
3
- "version": "6.1.2",
3
+ "version": "6.1.8",
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": "e01bb3d78b9d6f1330b58b32be9a0a3a87b98c42"
79
+ "gitHead": "39a88084372f631fad6d21cc00ecfd9a2328acc7"
80
80
  }