tf-checkout-react 1.0.99 → 1.0.100-beta.2

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 (117) hide show
  1. package/README.md +278 -1
  2. package/dist/api/index.d.ts +31 -26
  3. package/dist/components/account-settings/index.d.ts +3 -0
  4. package/dist/components/billing-info-container/index.d.ts +5 -5
  5. package/dist/components/billing-info-container/utils.d.ts +1 -0
  6. package/dist/components/common/CustomField.d.ts +1 -1
  7. package/dist/components/common/DatePickerField.d.ts +14 -0
  8. package/dist/components/common/RedirectModal.d.ts +7 -0
  9. package/dist/components/common/SnackbarAlert.d.ts +13 -0
  10. package/dist/components/confirmationContainer/index.d.ts +2 -1
  11. package/dist/components/countdown/index.d.ts +4 -1
  12. package/dist/components/myTicketsContainer/tableConfig.d.ts +0 -1
  13. package/dist/components/orderDetailsContainer/index.d.ts +5 -1
  14. package/dist/components/orderDetailsContainer/ticketsTable.d.ts +4 -1
  15. package/dist/components/paymentContainer/index.d.ts +3 -1
  16. package/dist/components/rsvpContainer/index.d.ts +7 -0
  17. package/dist/components/stripePayment/index.d.ts +2 -1
  18. package/dist/components/ticketResale/index.d.ts +5 -3
  19. package/dist/components/ticketsContainer/AccessCodeSection.d.ts +7 -0
  20. package/dist/components/ticketsContainer/PromoCodeSection.d.ts +6 -9
  21. package/dist/components/ticketsContainer/TicketsSection.d.ts +5 -3
  22. package/dist/components/ticketsContainer/index.d.ts +13 -2
  23. package/dist/components/timerWidget/index.d.ts +3 -3
  24. package/dist/env.d.ts +1 -0
  25. package/dist/images/cross.svg +44 -0
  26. package/dist/images/done.svg +3 -3
  27. package/dist/index.d.ts +2 -0
  28. package/dist/tf-checkout-react.cjs.development.js +1400 -575
  29. package/dist/tf-checkout-react.cjs.development.js.map +1 -1
  30. package/dist/tf-checkout-react.cjs.production.min.js +1 -1
  31. package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
  32. package/dist/tf-checkout-react.esm.js +1409 -586
  33. package/dist/tf-checkout-react.esm.js.map +1 -1
  34. package/dist/tf-checkout-styles.css +1 -1
  35. package/dist/utils/cookies.d.ts +3 -0
  36. package/dist/utils/createCheckoutDataBodyWithDefaultHolder.d.ts +6 -1
  37. package/dist/utils/downloadPDF.d.ts +1 -1
  38. package/dist/utils/getDomain.d.ts +1 -0
  39. package/dist/utils/index.d.ts +2 -0
  40. package/package.json +89 -89
  41. package/src/.DS_Store +0 -0
  42. package/src/.d.ts +2 -2
  43. package/src/api/index.ts +313 -278
  44. package/src/assets/images/cross.svg +44 -0
  45. package/src/assets/images/done.svg +3 -3
  46. package/src/components/.DS_Store +0 -0
  47. package/src/components/account-settings/index.tsx +161 -0
  48. package/src/components/account-settings/style.css +200 -0
  49. package/src/components/billing-info-container/index.tsx +821 -777
  50. package/src/components/billing-info-container/style.css +106 -106
  51. package/src/components/billing-info-container/utils.ts +233 -223
  52. package/src/components/common/CheckboxField.tsx +41 -41
  53. package/src/components/common/CustomField.tsx +87 -84
  54. package/src/components/common/DatePickerField.tsx +98 -0
  55. package/src/components/common/FormikPhoneNumberField.tsx +51 -51
  56. package/src/components/common/Loader.tsx +9 -9
  57. package/src/components/common/RadioField.tsx +35 -35
  58. package/src/components/common/RedirectModal.tsx +43 -0
  59. package/src/components/common/SelectField.tsx +80 -80
  60. package/src/components/common/SnackbarAlert.tsx +54 -0
  61. package/src/components/common/dist/PhoneNumberField.js +96 -0
  62. package/src/components/common/index.tsx +4 -4
  63. package/src/components/confirmModal/index.tsx +51 -51
  64. package/src/components/confirmModal/style.css +21 -21
  65. package/src/components/confirmationContainer/config.ts +72 -72
  66. package/src/components/confirmationContainer/index.tsx +197 -194
  67. package/src/components/confirmationContainer/social-buttons.tsx +94 -94
  68. package/src/components/confirmationContainer/style.css +202 -202
  69. package/src/components/countdown/index.tsx +100 -89
  70. package/src/components/countdown/style.css +9 -9
  71. package/src/components/index.ts +7 -7
  72. package/src/components/loginModal/index.tsx +171 -209
  73. package/src/components/loginModal/style.css +71 -71
  74. package/src/components/myTicketsContainer/index.tsx +201 -137
  75. package/src/components/myTicketsContainer/row.tsx +41 -41
  76. package/src/components/myTicketsContainer/style.css +40 -40
  77. package/src/components/myTicketsContainer/tableConfig.tsx +32 -34
  78. package/src/components/orderDetailsContainer/index.tsx +289 -249
  79. package/src/components/orderDetailsContainer/style.css +73 -73
  80. package/src/components/orderDetailsContainer/ticketsTable.tsx +177 -124
  81. package/src/components/paymentContainer/index.tsx +352 -284
  82. package/src/components/registerModal/index.tsx +183 -190
  83. package/src/components/rsvpContainer/index.tsx +126 -0
  84. package/src/components/stripePayment/index.tsx +258 -253
  85. package/src/components/stripePayment/style.css +60 -60
  86. package/src/components/ticketResale/index.tsx +74 -56
  87. package/src/components/ticketResaleModal/index.tsx +213 -210
  88. package/src/components/ticketResaleModal/style.css +28 -28
  89. package/src/components/ticketsContainer/AccessCodeSection.tsx +50 -0
  90. package/src/components/ticketsContainer/PromoCodeSection.tsx +89 -99
  91. package/src/components/ticketsContainer/ReferralLogic.tsx +31 -33
  92. package/src/components/ticketsContainer/TicketRow.tsx +89 -83
  93. package/src/components/ticketsContainer/TicketsSection.tsx +87 -81
  94. package/src/components/ticketsContainer/index.tsx +506 -409
  95. package/src/components/ticketsContainer/style.css +181 -181
  96. package/src/components/ticketsContainer/utils.ts +11 -11
  97. package/src/components/timerWidget/index.tsx +87 -70
  98. package/src/components/timerWidget/style.css +34 -26
  99. package/src/components/waitingList/index.tsx +178 -178
  100. package/src/components/waitingList/style.css +26 -26
  101. package/src/env.ts +20 -19
  102. package/src/index.ts +15 -13
  103. package/src/normalizers/index.ts +45 -45
  104. package/src/types/billing-info-data.ts +37 -37
  105. package/src/types/payment-field.ts +7 -7
  106. package/src/types/referral-promotion.ts +7 -7
  107. package/src/utils/cookies.ts +42 -0
  108. package/src/utils/createCheckoutDataBodyWithDefaultHolder.ts +71 -59
  109. package/src/utils/downloadPDF.tsx +52 -30
  110. package/src/utils/formikErrorFocus.ts +24 -24
  111. package/src/utils/getDomain.ts +15 -0
  112. package/src/utils/getImage.ts +14 -14
  113. package/src/utils/getQueryVariable.ts +13 -13
  114. package/src/utils/index.ts +7 -5
  115. package/src/utils/setConfigs.ts +26 -26
  116. package/src/utils/showZero.tsx +10 -10
  117. package/src/validators/index.ts +20 -20
@@ -1,194 +1,197 @@
1
- /* eslint-disable react/no-unescaped-entities */
2
- import React, { useEffect, useRef, useState } from 'react'
3
- import './style.css'
4
- import _map from 'lodash/map'
5
- import _get from 'lodash/get'
6
- import { IReferralPromotion } from '../../types'
7
- import { getConfirmationData } from '../../api'
8
- import { AxiosError } from 'axios'
9
- import SocialButtons from './social-buttons'
10
-
11
- export interface IShareButton {
12
- mainLabel: string;
13
- subLabel: string;
14
- platform: string;
15
- shareData: any;
16
- }
17
-
18
- export interface IConfirmationPage {
19
- isReferralEnabled: boolean;
20
- showDefaultShareButtons: boolean;
21
- messengerAppId: string;
22
- shareButtons: IShareButton[];
23
- onGetConfirmationDataSuccess: (res: any) => void;
24
- onGetConfirmationDataError: (e: AxiosError) => void;
25
- orderHash?: string;
26
- }
27
-
28
- export const ConfirmationContainer = ({
29
- isReferralEnabled,
30
- showDefaultShareButtons,
31
- messengerAppId = '',
32
- shareButtons = [],
33
- onGetConfirmationDataSuccess = () => {},
34
- onGetConfirmationDataError = () => {},
35
- orderHash,
36
- }: IConfirmationPage) => {
37
- const inputRef = useRef(null)
38
- const [data, setData] = useState<any>(null)
39
-
40
- // 1. get payment complete data ---> v1/order/${orderHash}/payment/complete/
41
-
42
- useEffect(() => {
43
- (async () => {
44
- const dataEncoded =
45
- (typeof window !== 'undefined' &&
46
- window.localStorage.getItem('checkoutData')) ||
47
- ''
48
-
49
- const dataDecoded = dataEncoded
50
- ? JSON.parse(dataEncoded)
51
- : { hash: orderHash }
52
- const { hash } = dataDecoded
53
-
54
- if (hash) {
55
- try {
56
- const response = await getConfirmationData(hash)
57
- const data = _get(response, 'data.data.attributes')
58
- data.personal_share_sales = data.personal_share_sales.map(
59
- (d: any) => {
60
- const salesData: IReferralPromotion = {
61
- label: `If your friends buy ${d.sales} tickets`,
62
- price: '',
63
- }
64
- if (d.price === 0) {
65
- salesData.subLabel = 'Your ticket becomes'
66
- salesData.price = 'FREE!'
67
- } else {
68
- salesData.subLabel = 'Your ticket goes down to'
69
- salesData.price = data.currency.symbol + d.price?.toFixed(2)
70
- }
71
-
72
- return salesData
73
- }
74
- )
75
- data.personal_share_sales.unshift({
76
- label: 'Your ticket is currently',
77
- price: data.currency.symbol + data.product_price?.toFixed(2),
78
- })
79
- setData(data)
80
- onGetConfirmationDataSuccess(response.data)
81
- } catch (error) {
82
- onGetConfirmationDataError(error.response)
83
- }
84
- }
85
- })()
86
- }, [])
87
-
88
- const onChangeShareLink = (e: React.ChangeEvent<HTMLInputElement>) => {
89
- const newData = { ...data, personal_share_link: e.target.value }
90
- setData(newData)
91
- }
92
-
93
- return (
94
- <div className="confirmation-page">
95
- {data && (
96
- <>
97
- <p className="title">Your Tickets are Confirmed!</p>
98
- <div className="share-message-section">
99
- <span className="main">Your tickets have been emailed to you</span>
100
- <span className="helper">
101
- Please bring them with you to the event
102
- </span>
103
- </div>
104
- {data.disable_referral === false && isReferralEnabled && (
105
- <>
106
- <div className="referral_text_image_section">
107
- <div className="referral_text_section">
108
- <div className="referral_title_text">
109
- Your ticket can become
110
- <span className="strong-text"> cheaper </span>
111
- or even
112
- <span className="strong-text"> FREE!</span>
113
- </div>
114
- <div className="referral_text">
115
- <span className="strong-text"> Invite friends </span>
116
- and we'll refund up to
117
- <span className="strong-text"> 100% </span>
118
- of your ticket money, if they buy tickets as well!
119
- </div>
120
- </div>
121
- <img src={data.product_image} alt="No Data" />
122
- </div>
123
- <div className="share_wrapper">
124
- <div className="share_section">
125
- <div className="invitation_section">
126
- <div className="invitation_title">
127
- How do you invite your friends?
128
- </div>
129
- <div className="share_buttons">
130
- <div className="share-by-link">
131
- <h5 className="share-by-link label">
132
- Send them this link:
133
- </h5>
134
- <div className="share-btn-inner">
135
- <input
136
- ref={inputRef}
137
- className="share-input"
138
- value={data.personal_share_link}
139
- onChange={onChangeShareLink}
140
- />
141
- <div
142
- className="share-by-link-copy-icon"
143
- onClick={() =>
144
- navigator.clipboard.writeText(
145
- _get(inputRef, 'current.value')
146
- )
147
- }
148
- >
149
- <img
150
- src="https://img.icons8.com/office/50/000000/copy.png"
151
- alt="copy"
152
- />
153
- </div>
154
- </div>
155
- </div>
156
- {(showDefaultShareButtons || !!shareButtons.length) && (
157
- <SocialButtons
158
- showDefaultShareButtons={showDefaultShareButtons}
159
- name={data.product_name}
160
- appId={messengerAppId}
161
- shareLink={data.personal_share_link}
162
- shareButtons={shareButtons}
163
- />
164
- )}
165
- </div>
166
- </div>
167
- </div>
168
- <div className="pricing-section">
169
- <div className="invitation_title">How much cheaper?</div>
170
- {_map(data.personal_share_sales, (pricing, index) => (
171
- <div key={index} className="pricing-section_wrapper">
172
- <div className="pricing-section_label">
173
- {pricing.label}
174
- {pricing.subLabel && (
175
- <div className="pricing-section_sublabel">
176
- {pricing.subLabel}
177
- </div>
178
- )}
179
- </div>
180
- <div className="pricing-section_price">
181
- {' '}
182
- {pricing.price}
183
- </div>
184
- </div>
185
- ))}
186
- </div>
187
- </div>
188
- </>
189
- )}
190
- </>
191
- )}
192
- </div>
193
- )
194
- }
1
+ /* eslint-disable react/no-unescaped-entities */
2
+ import React, { useEffect, useRef, useState } from 'react'
3
+ import './style.css'
4
+ import _map from 'lodash/map'
5
+ import _get from 'lodash/get'
6
+ import { IReferralPromotion } from '../../types'
7
+ import { getConfirmationData } from '../../api'
8
+ import { AxiosError } from 'axios'
9
+ import SocialButtons from './social-buttons'
10
+
11
+ export interface IShareButton {
12
+ mainLabel: string;
13
+ subLabel: string;
14
+ platform: string;
15
+ shareData: any;
16
+ }
17
+
18
+ export interface IConfirmationPage {
19
+ isReferralEnabled: boolean;
20
+ showDefaultShareButtons: boolean;
21
+ messengerAppId: string;
22
+ shareButtons: IShareButton[];
23
+ onGetConfirmationDataSuccess: (res: any) => void;
24
+ onGetConfirmationDataError: (e: AxiosError) => void;
25
+ onLinkCopied: () => void;
26
+ orderHash?: string;
27
+ }
28
+
29
+ export const ConfirmationContainer = ({
30
+ isReferralEnabled,
31
+ showDefaultShareButtons,
32
+ messengerAppId = '',
33
+ shareButtons = [],
34
+ onGetConfirmationDataSuccess = () => {},
35
+ onGetConfirmationDataError = () => {},
36
+ orderHash,
37
+ onLinkCopied = () => {}
38
+ }: IConfirmationPage) => {
39
+ const inputRef = useRef(null)
40
+ const [data, setData] = useState<any>(null)
41
+
42
+ // 1. get payment complete data ---> v1/order/${orderHash}/payment/complete/
43
+
44
+ useEffect(() => {
45
+ (async () => {
46
+ const dataEncoded =
47
+ (typeof window !== 'undefined' &&
48
+ window.localStorage.getItem('checkoutData')) ||
49
+ ''
50
+
51
+ const dataDecoded = dataEncoded
52
+ ? JSON.parse(dataEncoded)
53
+ : { hash: orderHash }
54
+ const { hash } = dataDecoded
55
+
56
+ if (hash) {
57
+ try {
58
+ const response = await getConfirmationData(hash)
59
+ const data = _get(response, 'data.data.attributes')
60
+ data.personal_share_sales = data.personal_share_sales.map(
61
+ (d: any) => {
62
+ const salesData: IReferralPromotion = {
63
+ label: `If your friends buy ${d.sales} tickets`,
64
+ price: '',
65
+ }
66
+ if (d.price === 0) {
67
+ salesData.subLabel = 'Your ticket becomes'
68
+ salesData.price = 'FREE!'
69
+ } else {
70
+ salesData.subLabel = 'Your ticket goes down to'
71
+ salesData.price = data.currency.symbol + d.price?.toFixed(2)
72
+ }
73
+
74
+ return salesData
75
+ }
76
+ )
77
+ data.personal_share_sales.unshift({
78
+ label: 'Your ticket is currently',
79
+ price: data.currency.symbol + data.product_price?.toFixed(2),
80
+ })
81
+ setData(data)
82
+ onGetConfirmationDataSuccess(response.data)
83
+ } catch (error) {
84
+ onGetConfirmationDataError(error.response)
85
+ }
86
+ }
87
+ })()
88
+ }, [])
89
+
90
+ const onChangeShareLink = (e: React.ChangeEvent<HTMLInputElement>) => {
91
+ const newData = { ...data, personal_share_link: e.target.value }
92
+ setData(newData)
93
+ }
94
+
95
+ return (
96
+ <div className="confirmation-page">
97
+ {data && (
98
+ <>
99
+ <p className="title">Your Tickets are Confirmed!</p>
100
+ <div className="share-message-section">
101
+ <span className="main">Your tickets have been emailed to you</span>
102
+ <span className="helper">
103
+ Please bring them with you to the event
104
+ </span>
105
+ </div>
106
+ {data.disable_referral === false && isReferralEnabled && (
107
+ <>
108
+ <div className="referral_text_image_section">
109
+ <div className="referral_text_section">
110
+ <div className="referral_title_text">
111
+ Your ticket can become
112
+ <span className="strong-text"> cheaper </span>
113
+ or even
114
+ <span className="strong-text"> FREE!</span>
115
+ </div>
116
+ <div className="referral_text">
117
+ <span className="strong-text"> Invite friends </span>
118
+ and we'll refund up to
119
+ <span className="strong-text"> 100% </span>
120
+ of your ticket money, if they buy tickets as well!
121
+ </div>
122
+ </div>
123
+ <img src={data.product_image} alt="No Data" />
124
+ </div>
125
+ <div className="share_wrapper">
126
+ <div className="share_section">
127
+ <div className="invitation_section">
128
+ <div className="invitation_title">
129
+ How do you invite your friends?
130
+ </div>
131
+ <div className="share_buttons">
132
+ <div className="share-by-link">
133
+ <h5 className="share-by-link label">
134
+ Send them this link:
135
+ </h5>
136
+ <div className="share-btn-inner">
137
+ <input
138
+ ref={inputRef}
139
+ className="share-input"
140
+ value={data.personal_share_link}
141
+ onChange={onChangeShareLink}
142
+ />
143
+ <div
144
+ className="share-by-link-copy-icon"
145
+ onClick={() => {
146
+ navigator.clipboard.writeText(
147
+ _get(inputRef, 'current.value')
148
+ )
149
+ onLinkCopied()
150
+ }}
151
+ >
152
+ <img
153
+ src="https://img.icons8.com/office/50/000000/copy.png"
154
+ alt="copy"
155
+ />
156
+ </div>
157
+ </div>
158
+ </div>
159
+ {(showDefaultShareButtons || !!shareButtons.length) && (
160
+ <SocialButtons
161
+ showDefaultShareButtons={showDefaultShareButtons}
162
+ name={data.product_name}
163
+ appId={messengerAppId}
164
+ shareLink={data.personal_share_link}
165
+ shareButtons={shareButtons}
166
+ />
167
+ )}
168
+ </div>
169
+ </div>
170
+ </div>
171
+ <div className="pricing-section">
172
+ <div className="invitation_title">How much cheaper?</div>
173
+ {_map(data.personal_share_sales, (pricing, index) => (
174
+ <div key={index} className="pricing-section_wrapper">
175
+ <div className="pricing-section_label">
176
+ {pricing.label}
177
+ {pricing.subLabel && (
178
+ <div className="pricing-section_sublabel">
179
+ {pricing.subLabel}
180
+ </div>
181
+ )}
182
+ </div>
183
+ <div className="pricing-section_price">
184
+ {' '}
185
+ {pricing.price}
186
+ </div>
187
+ </div>
188
+ ))}
189
+ </div>
190
+ </div>
191
+ </>
192
+ )}
193
+ </>
194
+ )}
195
+ </div>
196
+ )
197
+ }
@@ -1,94 +1,94 @@
1
- import React from 'react';
2
- import { IShareButton } from'./index'
3
- import config from './config'
4
-
5
- const SocialComponent = ({ mainLabel, subLabel, platform, shareData }: IShareButton) => {
6
- const Component = config(platform)?.component
7
- const Icon = config(platform)?.icon
8
-
9
- return (
10
- <>
11
- {Component && (
12
- <Component {...shareData}>
13
- <div className='social-media-sharing'>
14
- <div className='share-icon'>
15
- <Icon size={32} round />
16
- </div>
17
- <span className="share-text">
18
- {mainLabel}
19
- <br /> {subLabel}
20
- </span>
21
- </div>
22
- </Component>
23
- )}
24
- </>
25
- )
26
- }
27
-
28
- interface SocialButtonsTypes {
29
- shareLink: string;
30
- name: string;
31
- appId: string;
32
- showDefaultShareButtons: boolean;
33
- shareButtons: IShareButton[]
34
- }
35
-
36
- const SocialButtons = ({ showDefaultShareButtons, shareLink, name, appId, shareButtons }: SocialButtonsTypes) => {
37
- return (
38
- <>
39
- <div className="convenient_buttons">
40
- or use one of these convenient buttons:
41
- </div>
42
- <div className="social-media-btns">
43
- {showDefaultShareButtons && (
44
- <>
45
- <SocialComponent
46
- mainLabel='Share on'
47
- subLabel='Facebook'
48
- platform='facebook'
49
- shareData={{
50
- quote: name,
51
- url: shareLink
52
- }}
53
- />
54
- <SocialComponent
55
- mainLabel='Tweet to your'
56
- subLabel='Followers'
57
- platform='twitter'
58
- shareData={{
59
- title: name,
60
- url: shareLink
61
- }}
62
- />
63
- <SocialComponent
64
- mainLabel='Message friends on'
65
- subLabel='Facebook'
66
- platform='messenger'
67
- shareData={{
68
- appId: appId,
69
- url: shareLink
70
- }}
71
- />
72
- <SocialComponent
73
- mainLabel='Message friends on'
74
- subLabel='Whatsapp'
75
- platform='whatsapp'
76
- shareData={{
77
- title: name,
78
- url: shareLink
79
- }}
80
- />
81
- </>
82
- )}
83
- {shareButtons.map((shareButton: IShareButton, index: number) => (
84
- <SocialComponent key={index} {...shareButton} />
85
- ))}
86
- </div>
87
- {(showDefaultShareButtons || shareButtons.length) && (
88
- <p>We <strong>never</strong> post on Facebook without your permission!</p>
89
- )}
90
- </>
91
- )
92
- }
93
-
94
- export default SocialButtons
1
+ import React from 'react';
2
+ import { IShareButton } from'./index'
3
+ import config from './config'
4
+
5
+ const SocialComponent = ({ mainLabel, subLabel, platform, shareData }: IShareButton) => {
6
+ const Component = config(platform)?.component
7
+ const Icon = config(platform)?.icon
8
+
9
+ return (
10
+ <>
11
+ {Component && (
12
+ <Component {...shareData}>
13
+ <div className='social-media-sharing'>
14
+ <div className='share-icon'>
15
+ <Icon size={32} round />
16
+ </div>
17
+ <span className="share-text">
18
+ {mainLabel}
19
+ <br /> {subLabel}
20
+ </span>
21
+ </div>
22
+ </Component>
23
+ )}
24
+ </>
25
+ )
26
+ }
27
+
28
+ interface SocialButtonsTypes {
29
+ shareLink: string;
30
+ name: string;
31
+ appId: string;
32
+ showDefaultShareButtons: boolean;
33
+ shareButtons: IShareButton[]
34
+ }
35
+
36
+ const SocialButtons = ({ showDefaultShareButtons, shareLink, name, appId, shareButtons }: SocialButtonsTypes) => {
37
+ return (
38
+ <>
39
+ <div className="convenient_buttons">
40
+ or use one of these convenient buttons:
41
+ </div>
42
+ <div className="social-media-btns">
43
+ {showDefaultShareButtons && (
44
+ <>
45
+ <SocialComponent
46
+ mainLabel='Share on'
47
+ subLabel='Facebook'
48
+ platform='facebook'
49
+ shareData={{
50
+ quote: name,
51
+ url: shareLink
52
+ }}
53
+ />
54
+ <SocialComponent
55
+ mainLabel='Tweet to your'
56
+ subLabel='Followers'
57
+ platform='twitter'
58
+ shareData={{
59
+ title: name,
60
+ url: shareLink
61
+ }}
62
+ />
63
+ <SocialComponent
64
+ mainLabel='Message friends on'
65
+ subLabel='Facebook'
66
+ platform='messenger'
67
+ shareData={{
68
+ appId: appId,
69
+ url: shareLink
70
+ }}
71
+ />
72
+ <SocialComponent
73
+ mainLabel='Message friends on'
74
+ subLabel='Whatsapp'
75
+ platform='whatsapp'
76
+ shareData={{
77
+ title: name,
78
+ url: shareLink
79
+ }}
80
+ />
81
+ </>
82
+ )}
83
+ {shareButtons.map((shareButton: IShareButton, index: number) => (
84
+ <SocialComponent key={index} {...shareButton} />
85
+ ))}
86
+ </div>
87
+ {(showDefaultShareButtons || shareButtons.length) && (
88
+ <p>We <strong>never</strong> post on Facebook without your permission!</p>
89
+ )}
90
+ </>
91
+ )
92
+ }
93
+
94
+ export default SocialButtons