tf-checkout-react 1.0.103 → 1.0.106

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.
Files changed (96) hide show
  1. package/dist/api/index.d.ts +3 -1
  2. package/dist/components/common/CustomField.d.ts +1 -1
  3. package/dist/components/common/DatePickerField.d.ts +14 -0
  4. package/dist/components/common/RedirectModal.d.ts +7 -0
  5. package/dist/components/countdown/index.d.ts +3 -1
  6. package/dist/components/orderDetailsContainer/ticketsTable.d.ts +2 -0
  7. package/dist/components/rsvpContainer/index.d.ts +7 -0
  8. package/dist/components/ticketResale/index.d.ts +5 -3
  9. package/dist/components/ticketsContainer/AccessCodeSection.d.ts +7 -0
  10. package/dist/components/ticketsContainer/PromoCodeSection.d.ts +5 -9
  11. package/dist/components/ticketsContainer/TicketsSection.d.ts +6 -3
  12. package/dist/components/ticketsContainer/index.d.ts +9 -2
  13. package/dist/components/timerWidget/index.d.ts +3 -3
  14. package/dist/images/cross.svg +44 -0
  15. package/dist/images/done.svg +3 -3
  16. package/dist/index.d.ts +2 -0
  17. package/dist/tf-checkout-react.cjs.development.js +639 -223
  18. package/dist/tf-checkout-react.cjs.development.js.map +1 -1
  19. package/dist/tf-checkout-react.cjs.production.min.js +1 -1
  20. package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
  21. package/dist/tf-checkout-react.esm.js +645 -231
  22. package/dist/tf-checkout-react.esm.js.map +1 -1
  23. package/dist/tf-checkout-styles.css +1 -1
  24. package/package.json +89 -89
  25. package/src/.DS_Store +0 -0
  26. package/src/.d.ts +2 -2
  27. package/src/api/index.ts +300 -278
  28. package/src/assets/images/cross.svg +44 -0
  29. package/src/assets/images/done.svg +3 -3
  30. package/src/components/.DS_Store +0 -0
  31. package/src/components/billing-info-container/index.tsx +811 -799
  32. package/src/components/billing-info-container/style.css +105 -105
  33. package/src/components/billing-info-container/utils.ts +225 -224
  34. package/src/components/common/CheckboxField.tsx +41 -41
  35. package/src/components/common/CustomField.tsx +87 -84
  36. package/src/components/common/DatePickerField.tsx +98 -0
  37. package/src/components/common/FormikPhoneNumberField.tsx +51 -51
  38. package/src/components/common/Loader.tsx +9 -9
  39. package/src/components/common/RadioField.tsx +35 -35
  40. package/src/components/common/RedirectModal.tsx +43 -0
  41. package/src/components/common/SelectField.tsx +80 -80
  42. package/src/components/common/SnackbarAlert.tsx +53 -53
  43. package/src/components/common/index.tsx +4 -4
  44. package/src/components/confirmModal/index.tsx +51 -51
  45. package/src/components/confirmModal/style.css +21 -21
  46. package/src/components/confirmationContainer/config.ts +72 -72
  47. package/src/components/confirmationContainer/index.tsx +197 -197
  48. package/src/components/confirmationContainer/social-buttons.tsx +94 -94
  49. package/src/components/confirmationContainer/style.css +202 -202
  50. package/src/components/countdown/index.tsx +98 -89
  51. package/src/components/countdown/style.css +9 -9
  52. package/src/components/index.ts +7 -7
  53. package/src/components/loginModal/index.tsx +209 -209
  54. package/src/components/loginModal/style.css +71 -71
  55. package/src/components/myTicketsContainer/index.tsx +196 -196
  56. package/src/components/myTicketsContainer/row.tsx +41 -41
  57. package/src/components/myTicketsContainer/style.css +39 -39
  58. package/src/components/myTicketsContainer/tableConfig.tsx +34 -34
  59. package/src/components/orderDetailsContainer/index.tsx +252 -249
  60. package/src/components/orderDetailsContainer/style.css +72 -72
  61. package/src/components/orderDetailsContainer/ticketsTable.tsx +130 -124
  62. package/src/components/paymentContainer/index.tsx +285 -284
  63. package/src/components/registerModal/index.tsx +190 -190
  64. package/src/components/rsvpContainer/index.tsx +126 -0
  65. package/src/components/stripePayment/index.tsx +254 -253
  66. package/src/components/stripePayment/style.css +59 -59
  67. package/src/components/ticketResale/index.tsx +74 -56
  68. package/src/components/ticketResaleModal/index.tsx +215 -210
  69. package/src/components/ticketResaleModal/style.css +28 -28
  70. package/src/components/ticketsContainer/AccessCodeSection.tsx +50 -0
  71. package/src/components/ticketsContainer/PromoCodeSection.tsx +88 -99
  72. package/src/components/ticketsContainer/ReferralLogic.tsx +31 -33
  73. package/src/components/ticketsContainer/TicketRow.tsx +83 -83
  74. package/src/components/ticketsContainer/TicketsSection.tsx +90 -81
  75. package/src/components/ticketsContainer/index.tsx +464 -430
  76. package/src/components/ticketsContainer/style.css +181 -181
  77. package/src/components/ticketsContainer/utils.ts +11 -11
  78. package/src/components/timerWidget/index.tsx +87 -70
  79. package/src/components/timerWidget/style.css +34 -26
  80. package/src/components/waitingList/index.tsx +178 -178
  81. package/src/components/waitingList/style.css +26 -26
  82. package/src/env.ts +20 -20
  83. package/src/index.ts +15 -13
  84. package/src/normalizers/index.ts +45 -45
  85. package/src/types/billing-info-data.ts +37 -37
  86. package/src/types/payment-field.ts +7 -7
  87. package/src/types/referral-promotion.ts +7 -7
  88. package/src/utils/createCheckoutDataBodyWithDefaultHolder.ts +59 -59
  89. package/src/utils/downloadPDF.tsx +30 -30
  90. package/src/utils/formikErrorFocus.ts +24 -24
  91. package/src/utils/getImage.ts +14 -14
  92. package/src/utils/getQueryVariable.ts +13 -13
  93. package/src/utils/index.ts +5 -5
  94. package/src/utils/setConfigs.ts +26 -26
  95. package/src/utils/showZero.tsx +10 -10
  96. package/src/validators/index.ts +20 -20
@@ -1,178 +1,178 @@
1
- import React, { useState } from 'react'
2
- import Button from '@mui/material/Button'
3
- import CircularProgress from '@mui/material/CircularProgress'
4
- import { Field, Form, Formik } from 'formik'
5
- import { CustomField } from '../common/index'
6
- import { addToWaitingList } from '../../api'
7
- import {
8
- combineValidators,
9
- requiredValidator,
10
- emailValidator,
11
- } from '../../validators'
12
- import { ErrorFocus } from '../../utils/formikErrorFocus'
13
-
14
- import './style.css'
15
-
16
- interface WaitingListProps {
17
- tickets: any;
18
- eventId: number;
19
- }
20
-
21
- interface WaitingListFields {
22
- ticketTypeId: string;
23
- quantity: string;
24
- firstName: string;
25
- lastName: string;
26
- email: string;
27
- }
28
-
29
- const generateQuantity = (n: number) => {
30
- const quantityList = []
31
- for (let i = 1; i <= n; i++) {
32
- quantityList.push({ label: i, value: i })
33
- }
34
- return quantityList
35
- }
36
-
37
- const WaitingList = ({ tickets = {}, eventId }: WaitingListProps) => {
38
- const isWindowDefined = typeof window !== 'undefined'
39
- const userData =
40
- isWindowDefined && window.localStorage.getItem('user_data')
41
- ? JSON.parse(window.localStorage.getItem('user_data') || '')
42
- : {}
43
-
44
- const [showSuccessMessage, setShowSuccessMessage] = useState(false)
45
- const [loading, setLoading] = useState(false)
46
- const ticketTypesList = Object.values(tickets).map((d: any) => ({
47
- label: d.displayName,
48
- value: d.id,
49
- }))
50
-
51
- const showTicketsField = Boolean(ticketTypesList.length)
52
-
53
- const handleSubmit = async (values: WaitingListFields) => {
54
- try {
55
- setLoading(true)
56
- const requestData = {
57
- data: {
58
- attributes: values,
59
- },
60
- }
61
- const { data } = await addToWaitingList(eventId, requestData)
62
-
63
- if (data.success) {
64
- setShowSuccessMessage(true)
65
- }
66
- } catch (error) {
67
- } finally {
68
- setLoading(false)
69
- }
70
- }
71
-
72
- return (
73
- <div className="waiting-list">
74
- {showSuccessMessage ? (
75
- <div className="success-message">
76
- <p className="added-success-message">You've been added to the waiting list!</p>
77
- <p>You'll be notified if tickets become available.</p>
78
- </div>
79
- ) : (
80
- <>
81
- <h2>WAITING LIST</h2>
82
- <Formik
83
- initialValues={{
84
- ticketTypeId: '',
85
- quantity: '',
86
- firstName: userData.first_name || '',
87
- lastName: userData.last_name || '',
88
- email: userData.email || '',
89
- }}
90
- onSubmit={handleSubmit}
91
- >
92
- <Form>
93
- <ErrorFocus />
94
- {showTicketsField && (
95
- <>
96
- <div className="field-item">
97
- <Field
98
- name="ticketTypeId"
99
- label="Type of Ticket"
100
- type="select"
101
- component={CustomField}
102
- selectOptions={[
103
- { label: 'Type of Ticket', value: '', disabled: true },
104
- ...ticketTypesList,
105
- ]}
106
- />
107
- </div>
108
- <div className="field-item">
109
- <Field
110
- name="quantity"
111
- label="Quantity Requested"
112
- type="select"
113
- component={CustomField}
114
- selectOptions={[
115
- {
116
- label: 'Quantity Requested',
117
- value: '',
118
- disabled: true,
119
- },
120
- ...generateQuantity(10),
121
- ]}
122
- />
123
- </div>
124
- </>
125
- )}
126
- <div className="field-item">
127
- <Field
128
- name="firstName"
129
- label="First name"
130
- validate={(value: string) =>
131
- requiredValidator(value, 'Please enter your First name')
132
- }
133
- component={CustomField}
134
- />
135
- </div>
136
- <div className="field-item">
137
- <Field
138
- name="lastName"
139
- label="Last name"
140
- validate={(value: string) =>
141
- requiredValidator(value, 'Please enter your Last name')
142
- }
143
- component={CustomField}
144
- />
145
- </div>
146
- <div className="field-item">
147
- <Field
148
- name="email"
149
- label="Email"
150
- validate={combineValidators(
151
- (value: string) =>
152
- requiredValidator(value, 'Please enter your Email'),
153
- (value: string) => emailValidator(value)
154
- )}
155
- component={CustomField}
156
- />
157
- </div>
158
-
159
- <Button
160
- type="submit"
161
- variant="contained"
162
- className="waiting-list-button"
163
- >
164
- {loading ? (
165
- <CircularProgress size="22px" />
166
- ) : (
167
- 'ADD TO WAITING LIST'
168
- )}
169
- </Button>
170
- </Form>
171
- </Formik>
172
- </>
173
- )}
174
- </div>
175
- )
176
- }
177
-
178
- export default WaitingList
1
+ import React, { useState } from 'react'
2
+ import Button from '@mui/material/Button'
3
+ import CircularProgress from '@mui/material/CircularProgress'
4
+ import { Field, Form, Formik } from 'formik'
5
+ import { CustomField } from '../common/index'
6
+ import { addToWaitingList } from '../../api'
7
+ import {
8
+ combineValidators,
9
+ requiredValidator,
10
+ emailValidator,
11
+ } from '../../validators'
12
+ import { ErrorFocus } from '../../utils/formikErrorFocus'
13
+
14
+ import './style.css'
15
+
16
+ interface WaitingListProps {
17
+ tickets: any;
18
+ eventId: number;
19
+ }
20
+
21
+ interface WaitingListFields {
22
+ ticketTypeId: string;
23
+ quantity: string;
24
+ firstName: string;
25
+ lastName: string;
26
+ email: string;
27
+ }
28
+
29
+ const generateQuantity = (n: number) => {
30
+ const quantityList = []
31
+ for (let i = 1; i <= n; i++) {
32
+ quantityList.push({ label: i, value: i })
33
+ }
34
+ return quantityList
35
+ }
36
+
37
+ const WaitingList = ({ tickets = {}, eventId }: WaitingListProps) => {
38
+ const isWindowDefined = typeof window !== 'undefined'
39
+ const userData =
40
+ isWindowDefined && window.localStorage.getItem('user_data')
41
+ ? JSON.parse(window.localStorage.getItem('user_data') || '')
42
+ : {}
43
+
44
+ const [showSuccessMessage, setShowSuccessMessage] = useState(false)
45
+ const [loading, setLoading] = useState(false)
46
+ const ticketTypesList = Object.values(tickets).map((d: any) => ({
47
+ label: d.displayName,
48
+ value: d.id,
49
+ }))
50
+
51
+ const showTicketsField = Boolean(ticketTypesList.length)
52
+
53
+ const handleSubmit = async (values: WaitingListFields) => {
54
+ try {
55
+ setLoading(true)
56
+ const requestData = {
57
+ data: {
58
+ attributes: values,
59
+ },
60
+ }
61
+ const { data } = await addToWaitingList(eventId, requestData)
62
+
63
+ if (data.success) {
64
+ setShowSuccessMessage(true)
65
+ }
66
+ } catch (error) {
67
+ } finally {
68
+ setLoading(false)
69
+ }
70
+ }
71
+
72
+ return (
73
+ <div className="waiting-list">
74
+ {showSuccessMessage ? (
75
+ <div className="success-message">
76
+ <p className="added-success-message">You've been added to the waiting list!</p>
77
+ <p>You'll be notified if tickets become available.</p>
78
+ </div>
79
+ ) : (
80
+ <>
81
+ <h2>WAITING LIST</h2>
82
+ <Formik
83
+ initialValues={{
84
+ ticketTypeId: '',
85
+ quantity: '',
86
+ firstName: userData.first_name || '',
87
+ lastName: userData.last_name || '',
88
+ email: userData.email || '',
89
+ }}
90
+ onSubmit={handleSubmit}
91
+ >
92
+ <Form>
93
+ <ErrorFocus />
94
+ {showTicketsField && (
95
+ <>
96
+ <div className="field-item">
97
+ <Field
98
+ name="ticketTypeId"
99
+ label="Type of Ticket"
100
+ type="select"
101
+ component={CustomField}
102
+ selectOptions={[
103
+ { label: 'Type of Ticket', value: '', disabled: true },
104
+ ...ticketTypesList,
105
+ ]}
106
+ />
107
+ </div>
108
+ <div className="field-item">
109
+ <Field
110
+ name="quantity"
111
+ label="Quantity Requested"
112
+ type="select"
113
+ component={CustomField}
114
+ selectOptions={[
115
+ {
116
+ label: 'Quantity Requested',
117
+ value: '',
118
+ disabled: true,
119
+ },
120
+ ...generateQuantity(10),
121
+ ]}
122
+ />
123
+ </div>
124
+ </>
125
+ )}
126
+ <div className="field-item">
127
+ <Field
128
+ name="firstName"
129
+ label="First name"
130
+ validate={(value: string) =>
131
+ requiredValidator(value, 'Please enter your First name')
132
+ }
133
+ component={CustomField}
134
+ />
135
+ </div>
136
+ <div className="field-item">
137
+ <Field
138
+ name="lastName"
139
+ label="Last name"
140
+ validate={(value: string) =>
141
+ requiredValidator(value, 'Please enter your Last name')
142
+ }
143
+ component={CustomField}
144
+ />
145
+ </div>
146
+ <div className="field-item">
147
+ <Field
148
+ name="email"
149
+ label="Email"
150
+ validate={combineValidators(
151
+ (value: string) =>
152
+ requiredValidator(value, 'Please enter your Email'),
153
+ (value: string) => emailValidator(value)
154
+ )}
155
+ component={CustomField}
156
+ />
157
+ </div>
158
+
159
+ <Button
160
+ type="submit"
161
+ variant="contained"
162
+ className="waiting-list-button"
163
+ >
164
+ {loading ? (
165
+ <CircularProgress size="22px" />
166
+ ) : (
167
+ 'ADD TO WAITING LIST'
168
+ )}
169
+ </Button>
170
+ </Form>
171
+ </Formik>
172
+ </>
173
+ )}
174
+ </div>
175
+ )
176
+ }
177
+
178
+ export default WaitingList
@@ -1,27 +1,27 @@
1
- .waiting-list {
2
- padding: 17px 35px 20px;
3
- }
4
- .waiting-list .field-item {
5
- margin-bottom: 30px;
6
- }
7
- .waiting-list .waiting-list-button {
8
- width: 100% !important;
9
- }
10
- .waiting-list .waiting-list-button:hover {
11
- background-color: #505050;
12
- }
13
- .waiting-list .success-message {
14
- text-align: center;
15
- margin-bottom: 15px;
16
- }
17
- .waiting-list .success-message p {
18
- margin: 0;
19
- }
20
- .waiting-list .no-tickets-text {
21
- text-align: center;
22
- font-weight: bold;
23
- }
24
- .waiting-list .added-success-message {
25
- font-size: 22px;
26
- margin-bottom: 10px;
1
+ .waiting-list {
2
+ padding: 17px 35px 20px;
3
+ }
4
+ .waiting-list .field-item {
5
+ margin-bottom: 30px;
6
+ }
7
+ .waiting-list .waiting-list-button {
8
+ width: 100% !important;
9
+ }
10
+ .waiting-list .waiting-list-button:hover {
11
+ background-color: #505050;
12
+ }
13
+ .waiting-list .success-message {
14
+ text-align: center;
15
+ margin-bottom: 15px;
16
+ }
17
+ .waiting-list .success-message p {
18
+ margin: 0;
19
+ }
20
+ .waiting-list .no-tickets-text {
21
+ text-align: center;
22
+ font-weight: bold;
23
+ }
24
+ .waiting-list .added-success-message {
25
+ font-size: 22px;
26
+ margin-bottom: 10px;
27
27
  }
package/src/env.ts CHANGED
@@ -1,20 +1,20 @@
1
- // preview
2
- export const ENV = {
3
- EVENT_ID: 160,
4
- BASE_URL: 'https://preview.ttf.fluxtech.me',
5
- CLIENT_ID: '4792a61f2fcb49197ab4c2d2f44df570',
6
- CLIENT_SECRET: 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9',
7
- STRIPE_PUBLISHABLE_KEY:
8
- 'pk_test_51H4BkOGqveRD6EShliLrT9vd7mPOBPvQSuqmvc3wIinDqxWsCLeS2N7HonPPn6MhjU35ayYy5v4I6MLlD4jNWrd000NSgAF6UL',
9
- BRAND_SLUG: 'mana-onetree-testing-brand'
10
- }
11
-
12
- // prod
13
- export const ENV_PROD = {
14
- EVENT_ID: 9766,
15
- BASE_URL: 'https://www.ticketfairy.com',
16
- CLIENT_ID: 'e9d8f8922797b4621e562255afe90dbf',
17
- CLIENT_SECRET: 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9',
18
- STRIPE_PUBLISHABLE_KEY:
19
- 'pk_live_51JucaXAnOd2Grid07FqHOkqcoh90bbCYL5bG7OuyM5RtzUoolrFcHroCWici0G9w0YpqO7qsGz6WP7K6HHYw1yhz00cm7fj5n5',
20
- }
1
+ // preview
2
+ export const ENV = {
3
+ EVENT_ID: 160,
4
+ BASE_URL: 'https://preview.ttf.fluxtech.me',
5
+ CLIENT_ID: '4792a61f2fcb49197ab4c2d2f44df570',
6
+ CLIENT_SECRET: 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9',
7
+ STRIPE_PUBLISHABLE_KEY:
8
+ 'pk_test_51H4BkOGqveRD6EShliLrT9vd7mPOBPvQSuqmvc3wIinDqxWsCLeS2N7HonPPn6MhjU35ayYy5v4I6MLlD4jNWrd000NSgAF6UL',
9
+ BRAND_SLUG: 'mana-onetree-testing-brand'
10
+ }
11
+
12
+ // prod
13
+ export const ENV_PROD = {
14
+ EVENT_ID: 9766,
15
+ BASE_URL: 'https://www.ticketfairy.com',
16
+ CLIENT_ID: 'e9d8f8922797b4621e562255afe90dbf',
17
+ CLIENT_SECRET: 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9',
18
+ STRIPE_PUBLISHABLE_KEY:
19
+ 'pk_live_51JucaXAnOd2Grid07FqHOkqcoh90bbCYL5bG7OuyM5RtzUoolrFcHroCWici0G9w0YpqO7qsGz6WP7K6HHYw1yhz00cm7fj5n5',
20
+ }
package/src/index.ts CHANGED
@@ -1,13 +1,15 @@
1
- export { BillingInfoContainer } from './components/billing-info-container/index'
2
- export { PaymentContainer } from './components/paymentContainer/index'
3
- export { ConfirmationContainer } from './components/confirmationContainer/index'
4
- export { TicketsContainer } from './components/ticketsContainer/index'
5
- export {
6
- currencyNormalizerCreator,
7
- createFixedFloatNormalizer,
8
- } from './normalizers'
9
- export { LoginModal } from './components/loginModal'
10
- export { MyTicketsContainer } from './components/myTicketsContainer'
11
- export { OrderDetailsContainer } from './components/orderDetailsContainer'
12
- export { setConfigs } from './utils/setConfigs'
13
- export { TicketResaleContainer } from './components'
1
+ export { BillingInfoContainer } from './components/billing-info-container/index'
2
+ export { PaymentContainer } from './components/paymentContainer/index'
3
+ export { ConfirmationContainer } from './components/confirmationContainer/index'
4
+ export { TicketsContainer } from './components/ticketsContainer/index'
5
+ export {
6
+ currencyNormalizerCreator,
7
+ createFixedFloatNormalizer,
8
+ } from './normalizers'
9
+ export { LoginModal } from './components/loginModal'
10
+ export { MyTicketsContainer } from './components/myTicketsContainer'
11
+ export { OrderDetailsContainer } from './components/orderDetailsContainer'
12
+ export { setConfigs } from './utils/setConfigs'
13
+ export { TicketResaleContainer } from './components'
14
+ export { RedirectModal } from './components/common/RedirectModal'
15
+ export { RsvpContainer } from './components/rsvpContainer'
@@ -1,46 +1,46 @@
1
- export const currencyNormalizerCreator = (value: string | number, currency: string) =>
2
- !value ? '' : `${getCurrencySymbolByCurrency(currency)}${value}`
3
-
4
- export const createFixedFloatNormalizer = (fixedValue: number) => (value: string | number) =>
5
- value || `${value}` === '0' ? (+value).toFixed(fixedValue) : ''
6
-
7
- export const getCurrencySymbolByCurrency = (currency = '') => {
8
- switch (currency) {
9
- case 'GBP':
10
- return '£'
11
- case 'EUR':
12
- return '€'
13
- case 'INR':
14
- return '₹'
15
- case 'JMD':
16
- return 'J$'
17
- case 'NZD':
18
- return 'NZ$'
19
- case 'MYR':
20
- return 'RM'
21
- case 'MXN':
22
- return 'Mex$'
23
- case 'SGD':
24
- return 'S$'
25
- case 'AUD':
26
- return 'A$'
27
- case 'ZAR':
28
- return 'R'
29
- case 'ke':
30
- return 'Ksh'
31
- case 'TRY':
32
- return '₺'
33
- case 'CAD':
34
- return 'CA$'
35
- case 'THB':
36
- return '฿'
37
- case 'ISK':
38
- return 'Kr'
39
- case 'SEK':
40
- return 'kr'
41
- default:
42
- return 'US$'
43
- }
44
- }
45
-
1
+ export const currencyNormalizerCreator = (value: string | number, currency: string) =>
2
+ !value ? '' : `${getCurrencySymbolByCurrency(currency)}${value}`
3
+
4
+ export const createFixedFloatNormalizer = (fixedValue: number) => (value: string | number) =>
5
+ value || `${value}` === '0' ? (+value).toFixed(fixedValue) : ''
6
+
7
+ export const getCurrencySymbolByCurrency = (currency = '') => {
8
+ switch (currency) {
9
+ case 'GBP':
10
+ return '£'
11
+ case 'EUR':
12
+ return '€'
13
+ case 'INR':
14
+ return '₹'
15
+ case 'JMD':
16
+ return 'J$'
17
+ case 'NZD':
18
+ return 'NZ$'
19
+ case 'MYR':
20
+ return 'RM'
21
+ case 'MXN':
22
+ return 'Mex$'
23
+ case 'SGD':
24
+ return 'S$'
25
+ case 'AUD':
26
+ return 'A$'
27
+ case 'ZAR':
28
+ return 'R'
29
+ case 'ke':
30
+ return 'Ksh'
31
+ case 'TRY':
32
+ return '₺'
33
+ case 'CAD':
34
+ return 'CA$'
35
+ case 'THB':
36
+ return '฿'
37
+ case 'ISK':
38
+ return 'Kr'
39
+ case 'SEK':
40
+ return 'kr'
41
+ default:
42
+ return 'US$'
43
+ }
44
+ }
45
+
46
46
  export const removePlusSign = (string = '') => string.replace('+', '')
@@ -1,37 +1,37 @@
1
- import { ReactNode } from 'react'
2
-
3
- export interface IGroupItem {
4
- name: string;
5
- label: string | JSX.Element;
6
-
7
- // optional
8
- type?: string;
9
- className?: string;
10
- required?: boolean;
11
- component?: ReactNode | JSX.Element | HTMLElement;
12
- onValidate?: (value: any) => void;
13
- uniqueId?: string;
14
-
15
- // aditional props
16
- [key: string]: any;
17
- }
18
-
19
- export interface IFieldData {
20
- groupItems: IGroupItem[];
21
-
22
- // optional
23
- groupClassname?: string;
24
- groupLabel?: string | JSX.Element | HTMLElement;
25
- groupLabelClassName?: string;
26
- id: number;
27
- uniqueId?: string;
28
- }
29
- export interface IBillingInfoData {
30
- id: number | string;
31
- fields: IFieldData[];
32
-
33
- // optional
34
- label?: string | JSX.Element;
35
- labelClassName?: string;
36
- uniqueId?: string;
37
- }
1
+ import { ReactNode } from 'react'
2
+
3
+ export interface IGroupItem {
4
+ name: string;
5
+ label: string | JSX.Element;
6
+
7
+ // optional
8
+ type?: string;
9
+ className?: string;
10
+ required?: boolean;
11
+ component?: ReactNode | JSX.Element | HTMLElement;
12
+ onValidate?: (value: any) => void;
13
+ uniqueId?: string;
14
+
15
+ // aditional props
16
+ [key: string]: any;
17
+ }
18
+
19
+ export interface IFieldData {
20
+ groupItems: IGroupItem[];
21
+
22
+ // optional
23
+ groupClassname?: string;
24
+ groupLabel?: string | JSX.Element | HTMLElement;
25
+ groupLabelClassName?: string;
26
+ id: number;
27
+ uniqueId?: string;
28
+ }
29
+ export interface IBillingInfoData {
30
+ id: number | string;
31
+ fields: IFieldData[];
32
+
33
+ // optional
34
+ label?: string | JSX.Element;
35
+ labelClassName?: string;
36
+ uniqueId?: string;
37
+ }
@@ -1,7 +1,7 @@
1
- export interface IPaymentField {
2
- label: string;
3
- id: string;
4
-
5
- className?: string;
6
- normalizer?: any;
7
- }
1
+ export interface IPaymentField {
2
+ label: string;
3
+ id: string;
4
+
5
+ className?: string;
6
+ normalizer?: any;
7
+ }