tf-checkout-react-native 1.0.18 → 1.0.21
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/README.md +1000 -21
- package/lib/api/ApiClient.d.ts +16 -36
- package/lib/api/ApiClient.js +140 -40
- package/lib/api/ApiClient.js.map +1 -1
- package/lib/api/Constants.js +3 -3
- package/lib/api/Constants.js.map +1 -1
- package/lib/api/types.d.ts +117 -22
- package/lib/components/index.d.ts +3 -0
- package/lib/components/index.js +3 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/login/Login.d.ts +2 -1
- package/lib/components/login/Login.js +25 -63
- package/lib/components/login/Login.js.map +1 -1
- package/lib/components/login/LoginView.d.ts +2 -1
- package/lib/components/login/LoginView.js +4 -1
- package/lib/components/login/LoginView.js.map +1 -1
- package/lib/components/login/types.d.ts +9 -9
- package/lib/components/phoneInput/PhoneInput.d.ts +4 -0
- package/lib/components/phoneInput/PhoneInput.js +33 -0
- package/lib/components/phoneInput/PhoneInput.js.map +1 -0
- package/lib/components/phoneInput/styles.d.ts +28 -0
- package/lib/components/phoneInput/styles.js +30 -0
- package/lib/components/phoneInput/styles.js.map +1 -0
- package/lib/components/phoneInput/types.d.ts +30 -0
- package/lib/components/phoneInput/types.js +2 -0
- package/lib/components/phoneInput/types.js.map +1 -0
- package/lib/components/promoCode/PromoCode.d.ts +2 -1
- package/lib/components/promoCode/PromoCode.js.map +1 -1
- package/lib/components/promoCode/types.d.ts +1 -1
- package/lib/components/radioButton/RadioButton.d.ts +4 -0
- package/lib/components/radioButton/RadioButton.js +9 -0
- package/lib/components/radioButton/RadioButton.js.map +1 -0
- package/lib/components/radioButton/styles.d.ts +24 -0
- package/lib/components/radioButton/styles.js +30 -0
- package/lib/components/radioButton/styles.js.map +1 -0
- package/lib/components/radioButton/types.d.ts +15 -0
- package/lib/components/radioButton/types.js +2 -0
- package/lib/components/radioButton/types.js.map +1 -0
- package/lib/components/stripePayment/StripePayment.d.ts +4 -0
- package/lib/components/stripePayment/StripePayment.js +23 -0
- package/lib/components/stripePayment/StripePayment.js.map +1 -0
- package/lib/components/stripePayment/types.d.ts +12 -0
- package/lib/components/stripePayment/types.js +2 -0
- package/lib/components/stripePayment/types.js.map +1 -0
- package/lib/components/waitingList/WaitingList.d.ts +2 -1
- package/lib/components/waitingList/WaitingList.js +32 -29
- package/lib/components/waitingList/WaitingList.js.map +1 -1
- package/lib/components/waitingList/WaitingListView.d.ts +2 -1
- package/lib/components/waitingList/WaitingListView.js.map +1 -1
- package/lib/components/waitingList/types.d.ts +0 -1
- package/lib/containers/billingInfo/Billing.js +209 -123
- package/lib/containers/billingInfo/Billing.js.map +1 -1
- package/lib/containers/billingInfo/types.d.ts +10 -6
- package/lib/containers/checkout/Checkout.d.ts +2 -1
- package/lib/containers/checkout/Checkout.js +67 -69
- package/lib/containers/checkout/Checkout.js.map +1 -1
- package/lib/containers/checkout/types.d.ts +1 -1
- package/lib/containers/index.d.ts +1 -0
- package/lib/containers/index.js +1 -0
- package/lib/containers/index.js.map +1 -1
- package/lib/containers/myOrderDetails/MyOrderDetails.js +50 -4
- package/lib/containers/myOrderDetails/MyOrderDetails.js.map +1 -1
- package/lib/containers/myOrderDetails/MyOrderDetailsView.d.ts +2 -2
- package/lib/containers/myOrderDetails/MyOrderDetailsView.js +69 -47
- package/lib/containers/myOrderDetails/MyOrderDetailsView.js.map +1 -1
- package/lib/containers/myOrderDetails/types.d.ts +101 -77
- package/lib/containers/myOrders/MyOrders.js +26 -4
- package/lib/containers/myOrders/MyOrders.js.map +1 -1
- package/lib/containers/myOrders/MyOrdersView.d.ts +2 -1
- package/lib/containers/myOrders/MyOrdersView.js.map +1 -1
- package/lib/containers/myOrders/types.d.ts +4 -2
- package/lib/containers/purchaseConfirmation/PurchaseConfirmation.d.ts +2 -1
- package/lib/containers/purchaseConfirmation/PurchaseConfirmation.js +23 -8
- package/lib/containers/purchaseConfirmation/PurchaseConfirmation.js.map +1 -1
- package/lib/containers/purchaseConfirmation/PurchaseConfirmationView.d.ts +2 -1
- package/lib/containers/purchaseConfirmation/PurchaseConfirmationView.js.map +1 -1
- package/lib/containers/resaleTickets/ResaleTickets.d.ts +4 -0
- package/lib/containers/resaleTickets/ResaleTickets.js +149 -0
- package/lib/containers/resaleTickets/ResaleTickets.js.map +1 -0
- package/lib/containers/resaleTickets/ResaleTicketsView.d.ts +4 -0
- package/lib/containers/resaleTickets/ResaleTicketsView.js +182 -0
- package/lib/containers/resaleTickets/ResaleTicketsView.js.map +1 -0
- package/lib/containers/resaleTickets/types.d.ts +128 -0
- package/lib/containers/resaleTickets/types.js +11 -0
- package/lib/containers/resaleTickets/types.js.map +1 -0
- package/lib/containers/tickets/Tickets.d.ts +2 -1
- package/lib/containers/tickets/Tickets.js +73 -84
- package/lib/containers/tickets/Tickets.js.map +1 -1
- package/lib/containers/tickets/TicketsView.d.ts +1 -1
- package/lib/containers/tickets/TicketsView.js +2 -2
- package/lib/containers/tickets/TicketsView.js.map +1 -1
- package/lib/containers/tickets/types.d.ts +3 -14
- package/lib/core/BillingCore/BillingCore.d.ts +5 -0
- package/lib/core/BillingCore/BillingCore.js +28 -0
- package/lib/core/BillingCore/BillingCore.js.map +1 -0
- package/lib/core/BillingCore/BillingCoreTypes.d.ts +16 -0
- package/lib/core/BillingCore/BillingCoreTypes.js +2 -0
- package/lib/core/BillingCore/BillingCoreTypes.js.map +1 -0
- package/lib/core/CheckoutCore/CheckoutCore.d.ts +5 -0
- package/lib/core/CheckoutCore/CheckoutCore.js +25 -0
- package/lib/core/CheckoutCore/CheckoutCore.js.map +1 -0
- package/lib/core/CheckoutCore/CheckoutCoreTypes.d.ts +8 -0
- package/lib/core/CheckoutCore/CheckoutCoreTypes.js +2 -0
- package/lib/core/CheckoutCore/CheckoutCoreTypes.js.map +1 -0
- package/lib/core/CoreProps.d.ts +4 -0
- package/lib/core/CoreProps.js +2 -0
- package/lib/core/CoreProps.js.map +1 -0
- package/lib/core/LoginCore/LoginCore.d.ts +5 -0
- package/lib/core/LoginCore/LoginCore.js +100 -0
- package/lib/core/LoginCore/LoginCore.js.map +1 -0
- package/lib/core/LoginCore/LoginCoreTypes.d.ts +10 -0
- package/lib/core/LoginCore/LoginCoreTypes.js +2 -0
- package/lib/core/LoginCore/LoginCoreTypes.js.map +1 -0
- package/lib/core/MyOrdersCore/MyOrdersCore.d.ts +3 -0
- package/lib/core/MyOrdersCore/MyOrdersCore.js +16 -0
- package/lib/core/MyOrdersCore/MyOrdersCore.js.map +1 -0
- package/lib/core/MyOrdersCore/MyOrdersCoreTypes.d.ts +5 -0
- package/lib/core/MyOrdersCore/MyOrdersCoreTypes.js +2 -0
- package/lib/core/MyOrdersCore/MyOrdersCoreTypes.js.map +1 -0
- package/lib/core/OrderDetailsCore/OrderDetailsCore.d.ts +5 -0
- package/lib/core/OrderDetailsCore/OrderDetailsCore.js +15 -0
- package/lib/core/OrderDetailsCore/OrderDetailsCore.js.map +1 -0
- package/lib/core/OrderDetailsCore/OrderDetailsCoreTypes.d.ts +7 -0
- package/lib/core/OrderDetailsCore/OrderDetailsCoreTypes.js +2 -0
- package/lib/core/OrderDetailsCore/OrderDetailsCoreTypes.js.map +1 -0
- package/lib/core/PurchaseConfirmationCore/PurchaseConfirmationCore.d.ts +5 -0
- package/lib/core/PurchaseConfirmationCore/PurchaseConfirmationCore.js +12 -0
- package/lib/core/PurchaseConfirmationCore/PurchaseConfirmationCore.js.map +1 -0
- package/lib/core/PurchaseConfirmationCore/PurchaseConfirmationCoreTypes.d.ts +4 -0
- package/lib/core/PurchaseConfirmationCore/PurchaseConfirmationCoreTypes.js +2 -0
- package/lib/core/PurchaseConfirmationCore/PurchaseConfirmationCoreTypes.js.map +1 -0
- package/lib/core/TicketsCore/TicketsCore.d.ts +5 -0
- package/lib/core/TicketsCore/TicketsCore.js +59 -0
- package/lib/core/TicketsCore/TicketsCore.js.map +1 -0
- package/lib/core/TicketsCore/TicketsCoreTypes.d.ts +15 -0
- package/lib/core/TicketsCore/TicketsCoreTypes.js +2 -0
- package/lib/core/TicketsCore/TicketsCoreTypes.js.map +1 -0
- package/lib/core/WaitingListCore/WaitingListCore.d.ts +5 -0
- package/lib/core/WaitingListCore/WaitingListCore.js +17 -0
- package/lib/core/WaitingListCore/WaitingListCore.js.map +1 -0
- package/lib/core/WaitingListCore/WaitingListCoreTypes.d.ts +9 -0
- package/lib/core/WaitingListCore/WaitingListCoreTypes.js +2 -0
- package/lib/core/WaitingListCore/WaitingListCoreTypes.js.map +1 -0
- package/lib/core/index.d.ts +16 -0
- package/lib/core/index.js +9 -0
- package/lib/core/index.js.map +1 -0
- package/lib/helpers/Config.d.ts +1 -0
- package/lib/helpers/Config.js.map +1 -1
- package/lib/helpers/CountryCodes.d.ts +15 -0
- package/lib/helpers/CountryCodes.js +3382 -0
- package/lib/helpers/CountryCodes.js.map +1 -0
- package/lib/helpers/LocalStorage.d.ts +1 -0
- package/lib/helpers/LocalStorage.js +4 -1
- package/lib/helpers/LocalStorage.js.map +1 -1
- package/lib/helpers/Validators.d.ts +6 -0
- package/lib/helpers/Validators.js +10 -0
- package/lib/helpers/Validators.js.map +1 -1
- package/lib/index.d.ts +5 -3
- package/lib/index.js +4 -2
- package/lib/index.js.map +1 -1
- package/lib/types/IEvent.d.ts +6 -0
- package/lib/types/ITicket.d.ts +10 -1
- package/lib/types/IUserProfile.d.ts +15 -11
- package/package.json +13 -6
package/lib/api/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
import {
|
|
2
|
+
import { IOnCheckoutSuccess } from '..';
|
|
3
|
+
import { IError, IEvent, ITicket, IUserProfile } from '../types';
|
|
3
4
|
export interface IClientRequest extends AxiosInstance {
|
|
4
5
|
setGuestToken: (token: string) => void;
|
|
5
6
|
setAccessToken: (token: string) => void;
|
|
@@ -23,13 +24,31 @@ export interface IAuthorizeResponse {
|
|
|
23
24
|
code?: string;
|
|
24
25
|
}
|
|
25
26
|
export interface IAddToCartParams {
|
|
26
|
-
eventId: number | string;
|
|
27
27
|
attributes: {
|
|
28
|
-
alternative_view_id?: string | number;
|
|
28
|
+
alternative_view_id?: string | number | null;
|
|
29
29
|
product_cart_quantity: number;
|
|
30
|
-
product_options: {
|
|
30
|
+
product_options: {
|
|
31
|
+
[key: string]: number | string;
|
|
32
|
+
};
|
|
31
33
|
product_id: number;
|
|
32
|
-
ticket_types: {
|
|
34
|
+
ticket_types: {
|
|
35
|
+
[key: string]: {
|
|
36
|
+
product_options: {
|
|
37
|
+
[key: string]: number | string;
|
|
38
|
+
ticket_price: number;
|
|
39
|
+
};
|
|
40
|
+
quantity: number;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export interface IAddToWaitingListResponse {
|
|
46
|
+
addToWaitingListError?: IError;
|
|
47
|
+
addToWaitingListData?: {
|
|
48
|
+
error: boolean;
|
|
49
|
+
message: string;
|
|
50
|
+
status: number;
|
|
51
|
+
success: boolean;
|
|
33
52
|
};
|
|
34
53
|
}
|
|
35
54
|
export interface IEventData {
|
|
@@ -87,8 +106,6 @@ export interface IRegisterNewUserResponse {
|
|
|
87
106
|
raw?: any;
|
|
88
107
|
};
|
|
89
108
|
data?: {
|
|
90
|
-
access_token: string;
|
|
91
|
-
refresh_token: string;
|
|
92
109
|
token_type: string;
|
|
93
110
|
scope: string;
|
|
94
111
|
user_profile: {
|
|
@@ -100,7 +117,7 @@ export interface IRegisterNewUserResponse {
|
|
|
100
117
|
}
|
|
101
118
|
export interface ICheckoutResponse {
|
|
102
119
|
error?: IError;
|
|
103
|
-
data?:
|
|
120
|
+
data?: IOnCheckoutSuccess;
|
|
104
121
|
}
|
|
105
122
|
export interface IPaymentConfig {
|
|
106
123
|
id: string;
|
|
@@ -132,8 +149,8 @@ export interface IOrderReview {
|
|
|
132
149
|
};
|
|
133
150
|
}
|
|
134
151
|
export interface IOrderReviewResponse {
|
|
135
|
-
|
|
136
|
-
|
|
152
|
+
orderReviewError?: IError;
|
|
153
|
+
orderReviewData?: IOrderReview;
|
|
137
154
|
}
|
|
138
155
|
export interface IMyOrdersEvent {
|
|
139
156
|
url_name: string;
|
|
@@ -157,25 +174,32 @@ export interface IMyOrdersResponse {
|
|
|
157
174
|
myOrdersError?: IError;
|
|
158
175
|
}
|
|
159
176
|
export interface IMyOrderDetailsItem {
|
|
160
|
-
|
|
177
|
+
isActive: boolean;
|
|
161
178
|
currency: string;
|
|
162
|
-
price: string;
|
|
163
179
|
discount: string;
|
|
180
|
+
name: string;
|
|
181
|
+
price: string;
|
|
164
182
|
quantity: string;
|
|
165
183
|
total: string;
|
|
184
|
+
hash: string;
|
|
166
185
|
}
|
|
167
186
|
export interface IMyOrderDetailsTicket {
|
|
187
|
+
currency: string;
|
|
188
|
+
description: string;
|
|
189
|
+
descriptionPlain?: string;
|
|
190
|
+
eventName: string;
|
|
168
191
|
hash: string;
|
|
169
|
-
ticketType: string;
|
|
170
|
-
holderName?: string;
|
|
171
192
|
holderEmail?: string;
|
|
193
|
+
holderName: string;
|
|
172
194
|
holderPhone?: string;
|
|
195
|
+
isOnSale: boolean;
|
|
196
|
+
isSellable: boolean;
|
|
197
|
+
pdfLink: string;
|
|
198
|
+
qrData: string;
|
|
199
|
+
resaleFeeAmount: number;
|
|
173
200
|
status: string;
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
isSellable?: boolean;
|
|
177
|
-
description?: string;
|
|
178
|
-
descriptionPlain?: string;
|
|
201
|
+
ticketType: string;
|
|
202
|
+
ticketTypeHash: string;
|
|
179
203
|
}
|
|
180
204
|
export interface IMyOrderDetailsHeader {
|
|
181
205
|
isReferralDisabled: boolean;
|
|
@@ -183,14 +207,85 @@ export interface IMyOrderDetailsHeader {
|
|
|
183
207
|
total: string;
|
|
184
208
|
salesReferred: string;
|
|
185
209
|
}
|
|
186
|
-
export interface
|
|
210
|
+
export interface IMyOrderDetailsData {
|
|
187
211
|
header: IMyOrderDetailsHeader;
|
|
188
|
-
items
|
|
212
|
+
items?: IMyOrderDetailsItem[];
|
|
189
213
|
tickets: IMyOrderDetailsTicket[];
|
|
190
214
|
}
|
|
191
|
-
export interface
|
|
215
|
+
export interface IMyOrderDetailsResponse {
|
|
216
|
+
orderDetailsError?: IError;
|
|
217
|
+
orderDetailsData?: IMyOrderDetailsData;
|
|
218
|
+
}
|
|
219
|
+
export interface ICartData {
|
|
192
220
|
quantity: number;
|
|
193
221
|
isTfOptInHidden?: boolean;
|
|
194
222
|
isTfOptIn: boolean;
|
|
195
223
|
isMarketingOptedIn: boolean;
|
|
196
224
|
}
|
|
225
|
+
export interface ICartResponse {
|
|
226
|
+
cartError?: IError;
|
|
227
|
+
cartData?: ICartData;
|
|
228
|
+
}
|
|
229
|
+
export interface ICountryData {
|
|
230
|
+
[key: number | string]: string;
|
|
231
|
+
}
|
|
232
|
+
export interface ICountriesResponse {
|
|
233
|
+
countriesError?: IError;
|
|
234
|
+
countriesData?: ICountryData;
|
|
235
|
+
}
|
|
236
|
+
export interface IStateData {
|
|
237
|
+
[key: number | string]: string;
|
|
238
|
+
}
|
|
239
|
+
export interface IStatesResponse {
|
|
240
|
+
statesError?: IError;
|
|
241
|
+
statesData?: IStateData;
|
|
242
|
+
}
|
|
243
|
+
export interface IUserProfileResponse {
|
|
244
|
+
userProfileError?: IError;
|
|
245
|
+
userProfileData?: IUserProfile;
|
|
246
|
+
}
|
|
247
|
+
export interface IPurchaseConfirmationData {
|
|
248
|
+
conversionPixels?: any;
|
|
249
|
+
currency: {
|
|
250
|
+
currency: string;
|
|
251
|
+
decimalPlaces: number;
|
|
252
|
+
symbol: string;
|
|
253
|
+
};
|
|
254
|
+
customConfirmationPageText?: string;
|
|
255
|
+
customerId: string;
|
|
256
|
+
isReferralDisabled: boolean;
|
|
257
|
+
eventDate: string;
|
|
258
|
+
eventDescription: string;
|
|
259
|
+
eventType: string;
|
|
260
|
+
message: string;
|
|
261
|
+
orderTotal: number;
|
|
262
|
+
personalShareLink: string;
|
|
263
|
+
productId: string;
|
|
264
|
+
productImage: string;
|
|
265
|
+
productName: string;
|
|
266
|
+
productPrice: number;
|
|
267
|
+
productUrl: string;
|
|
268
|
+
twitterHashtag?: string;
|
|
269
|
+
personalShareSales: {
|
|
270
|
+
price: number;
|
|
271
|
+
sales: number;
|
|
272
|
+
}[];
|
|
273
|
+
}
|
|
274
|
+
export interface IPurchaseConfirmationResponse {
|
|
275
|
+
purchaseConfirmationError?: IError;
|
|
276
|
+
purchaseConfirmationData?: IPurchaseConfirmationData;
|
|
277
|
+
}
|
|
278
|
+
export interface IResaleTicketData {
|
|
279
|
+
message: string;
|
|
280
|
+
}
|
|
281
|
+
export interface IResaleTicketResponse {
|
|
282
|
+
resaleTicketError?: IError;
|
|
283
|
+
resaleTicketData?: IResaleTicketData;
|
|
284
|
+
}
|
|
285
|
+
export interface IRemoveTicketFromResaleData {
|
|
286
|
+
message: string;
|
|
287
|
+
}
|
|
288
|
+
export interface IRemoveTicketFromResaleResponse {
|
|
289
|
+
removeTicketFromResaleError?: IError;
|
|
290
|
+
removeTicketFromResaleData?: IRemoveTicketFromResaleData;
|
|
291
|
+
}
|
|
@@ -8,6 +8,9 @@ export { default as Input } from './input/Input';
|
|
|
8
8
|
export { default as Loading } from './loading/Loading';
|
|
9
9
|
export { default as LoggedIn } from './loggedIn/LoggedIn';
|
|
10
10
|
export { default as Login } from './login/Login';
|
|
11
|
+
export { default as PhoneInput } from './phoneInput/PhoneInput';
|
|
11
12
|
export { default as PromoCode } from './promoCode/PromoCode';
|
|
13
|
+
export { default as RadioButton } from './radioButton/RadioButton';
|
|
12
14
|
export { default as Separator } from './separator/Separator';
|
|
15
|
+
export { default as StripePayment } from './stripePayment/StripePayment';
|
|
13
16
|
export { default as WaitingList } from './waitingList/WaitingList';
|
package/lib/components/index.js
CHANGED
|
@@ -8,7 +8,10 @@ export { default as Input } from './input/Input';
|
|
|
8
8
|
export { default as Loading } from './loading/Loading';
|
|
9
9
|
export { default as LoggedIn } from './loggedIn/LoggedIn';
|
|
10
10
|
export { default as Login } from './login/Login';
|
|
11
|
+
export { default as PhoneInput } from './phoneInput/PhoneInput';
|
|
11
12
|
export { default as PromoCode } from './promoCode/PromoCode';
|
|
13
|
+
export { default as RadioButton } from './radioButton/RadioButton';
|
|
12
14
|
export { default as Separator } from './separator/Separator';
|
|
15
|
+
export { default as StripePayment } from './stripePayment/StripePayment';
|
|
13
16
|
export { default as WaitingList } from './waitingList/WaitingList';
|
|
14
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AACjF,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AACjF,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
1
2
|
import { ILoginProps } from './types';
|
|
2
|
-
declare const Login:
|
|
3
|
+
declare const Login: FC<ILoginProps>;
|
|
3
4
|
export default Login;
|
|
@@ -1,84 +1,46 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
2
|
import { Keyboard } from 'react-native';
|
|
3
|
-
import {
|
|
4
|
-
import { Config } from '../../helpers/Config';
|
|
5
|
-
import { deleteAllData, LocalStorageKeys, storeData, } from '../../helpers/LocalStorage';
|
|
3
|
+
import { LoginCore } from '../../core';
|
|
6
4
|
import LoginView from './LoginView';
|
|
7
|
-
const Login = ({ onLoginSuccessful, isLoginDialogVisible, showLoginDialog, hideLoginDialog, userFirstName, onLogoutSuccess, texts, styles,
|
|
5
|
+
const Login = ({ onLoginSuccessful, onLoginError, isLoginDialogVisible, showLoginDialog, hideLoginDialog, userFirstName, onLogoutSuccess, onLogoutError, texts, styles, refs, brandImages, }) => {
|
|
8
6
|
const [isLoading, setIsLoading] = useState(false);
|
|
9
7
|
const [loginError, setLoginError] = useState('');
|
|
10
8
|
const [userProfileData, setUserProfileData] = useState();
|
|
11
|
-
const
|
|
9
|
+
const loginCoreRef = useRef(null);
|
|
10
|
+
const handleOnPressLogin = async (fields) => {
|
|
11
|
+
var _a;
|
|
12
12
|
if (loginError) {
|
|
13
13
|
setLoginError('');
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const { code, error } = await authorize(bodyFormData);
|
|
20
|
-
if (error || !code) {
|
|
21
|
-
setIsLoading(false);
|
|
22
|
-
if (onLoginError) {
|
|
23
|
-
setLoginError((error === null || error === void 0 ? void 0 : error.message) || 'Auth error');
|
|
24
|
-
return onLoginError(error);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
const bodyFormDataToken = new FormData();
|
|
28
|
-
bodyFormDataToken.append('code', code);
|
|
29
|
-
bodyFormDataToken.append('scope', 'profile');
|
|
30
|
-
bodyFormDataToken.append('grant_type', 'authorization_code');
|
|
31
|
-
bodyFormDataToken.append('client_id', Config.CLIENT_ID);
|
|
32
|
-
bodyFormDataToken.append('client_secret', Config.CLIENT_SECRET);
|
|
33
|
-
const { error: tokenError, accessToken } = await fetchAccessToken(bodyFormDataToken);
|
|
34
|
-
if (tokenError) {
|
|
35
|
-
setIsLoading(false);
|
|
36
|
-
if (onFetchAccessTokenError) {
|
|
37
|
-
return onFetchAccessTokenError(tokenError);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
if (onFetchAccessTokenError) {
|
|
41
|
-
setAccessTokenHandler(accessToken);
|
|
42
|
-
}
|
|
43
|
-
if (onFetchAccessTokenSuccess) {
|
|
44
|
-
onFetchAccessTokenSuccess();
|
|
15
|
+
if (!((_a = loginCoreRef.current) === null || _a === void 0 ? void 0 : _a.login)) {
|
|
16
|
+
return onLoginError === null || onLoginError === void 0 ? void 0 : onLoginError({
|
|
17
|
+
message: 'LoginCoreRef is not initialized',
|
|
18
|
+
});
|
|
45
19
|
}
|
|
46
|
-
|
|
47
|
-
|
|
20
|
+
setIsLoading(true);
|
|
21
|
+
const { data: authorizationData, error: authorizationError } = await loginCoreRef.current.login(fields);
|
|
22
|
+
if (authorizationError || !authorizationData) {
|
|
48
23
|
setIsLoading(false);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
if (onFetchUserProfileSuccess) {
|
|
55
|
-
onFetchUserProfileSuccess({
|
|
56
|
-
firstName: userProfile.firstName,
|
|
57
|
-
lastName: userProfile.lastName,
|
|
58
|
-
});
|
|
24
|
+
setLoginError((authorizationError === null || authorizationError === void 0 ? void 0 : authorizationError.message) || 'Auth error');
|
|
25
|
+
return onLoginError === null || onLoginError === void 0 ? void 0 : onLoginError(authorizationError);
|
|
59
26
|
}
|
|
60
|
-
const storedUserData = {
|
|
61
|
-
id: userProfile.id,
|
|
62
|
-
firstName: userProfile.firstName,
|
|
63
|
-
lastName: userProfile.lastName,
|
|
64
|
-
email: userProfile.email,
|
|
65
|
-
};
|
|
66
|
-
await storeData(LocalStorageKeys.USER_DATA, JSON.stringify(storedUserData));
|
|
67
|
-
await storeData(LocalStorageKeys.ACCESS_TOKEN, accessToken);
|
|
68
27
|
Keyboard.dismiss();
|
|
69
|
-
setUserProfileData(
|
|
70
|
-
onLoginSuccessful(
|
|
28
|
+
setUserProfileData(authorizationData);
|
|
29
|
+
onLoginSuccessful(authorizationData);
|
|
71
30
|
setIsLoading(false);
|
|
72
31
|
hideLoginDialog();
|
|
73
32
|
};
|
|
74
33
|
const handleOnPressLogout = async () => {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
onLogoutSuccess();
|
|
34
|
+
var _a;
|
|
35
|
+
if (!((_a = loginCoreRef.current) === null || _a === void 0 ? void 0 : _a.logout)) {
|
|
36
|
+
return onLogoutError === null || onLogoutError === void 0 ? void 0 : onLogoutError({ message: 'LoginCoreRef is not initialized' });
|
|
79
37
|
}
|
|
38
|
+
await loginCoreRef.current.logout();
|
|
39
|
+
setUserProfileData(undefined);
|
|
40
|
+
onLogoutSuccess === null || onLogoutSuccess === void 0 ? void 0 : onLogoutSuccess();
|
|
80
41
|
};
|
|
81
|
-
return (React.createElement(
|
|
42
|
+
return (React.createElement(LoginCore, { ref: loginCoreRef },
|
|
43
|
+
React.createElement(LoginView, { showDialog: showLoginDialog, hideDialog: hideLoginDialog, isDialogVisible: isLoginDialogVisible, onPressLogin: handleOnPressLogin, isLoading: isLoading, userProfile: userProfileData, onPressLogout: handleOnPressLogout, texts: texts, styles: styles, userFirstName: userFirstName, loginError: loginError, refs: refs, brandImages: brandImages })));
|
|
82
44
|
};
|
|
83
45
|
export default Login;
|
|
84
46
|
//# sourceMappingURL=Login.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Login.js","sourceRoot":"","sources":["../../../src/components/login/Login.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":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B,CACQ,CACb,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
1
2
|
import { ILoginViewProps } from './types';
|
|
2
|
-
declare const LoginView:
|
|
3
|
+
declare const LoginView: FC<ILoginViewProps>;
|
|
3
4
|
export default LoginView;
|
|
@@ -68,7 +68,10 @@ const LoginView = ({ showDialog, hideDialog, isDialogVisible, onPressLogin, isLo
|
|
|
68
68
|
return true;
|
|
69
69
|
};
|
|
70
70
|
const handleOnPressLogin = () => {
|
|
71
|
-
onPressLogin(
|
|
71
|
+
onPressLogin({
|
|
72
|
+
email: email.value,
|
|
73
|
+
password: password.value,
|
|
74
|
+
});
|
|
72
75
|
};
|
|
73
76
|
const logoutTitle = ((_a = texts === null || texts === void 0 ? void 0 : texts.logoutDialog) === null || _a === void 0 ? void 0 : _a.title)
|
|
74
77
|
? texts.logoutDialog.title
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoginView.js","sourceRoot":"","sources":["../../../src/components/login/LoginView.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,YAAY,CAAA;AAC7B,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"LoginView.js","sourceRoot":"","sources":["../../../src/components/login/LoginView.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,YAAY,CAAA;AAC7B,OAAO,KAAK,EAAE,EAAM,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACjE,OAAO,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,IAAI,EACJ,gBAAgB,EAChB,wBAAwB,EACxB,IAAI,GACL,MAAM,cAAc,CAAA;AAErB,OAAO,CAAC,MAAM,WAAW,CAAA;AACzB,OAAO,MAAM,MAAM,kBAAkB,CAAA;AACrC,OAAO,SAAS,MAAM,wBAAwB,CAAA;AAE9C,OAAO,CAAC,MAAM,UAAU,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ewStyle } from 'react-native';
|
|
4
|
-
import { IError,
|
|
4
|
+
import { IError, IUserProfilePublic } from '../../types';
|
|
5
5
|
import { IButtonStyles } from '../button/types';
|
|
6
6
|
import { IFormField } from '../formField/types';
|
|
7
7
|
import { IInputStyles } from '../input/types';
|
|
@@ -26,17 +26,13 @@ export interface ILoginBrandImages {
|
|
|
26
26
|
image2Style?: StyleProp<ImageStyle>;
|
|
27
27
|
}
|
|
28
28
|
export interface ILoginProps {
|
|
29
|
-
onLoginSuccessful: (userProfile:
|
|
29
|
+
onLoginSuccessful: (userProfile: IUserProfilePublic) => void;
|
|
30
30
|
onLoginError?: (error: IError) => void;
|
|
31
|
-
onFetchUserProfileError?: (error: IError) => void;
|
|
32
|
-
onFetchUserProfileSuccess?: (data: any) => void;
|
|
33
|
-
onFetchAccessTokenError?: (error: IError) => void;
|
|
34
|
-
onFetchAccessTokenSuccess?: () => void;
|
|
35
31
|
isLoginDialogVisible: boolean;
|
|
36
32
|
showLoginDialog: () => void;
|
|
37
33
|
hideLoginDialog: () => void;
|
|
38
34
|
onLogoutSuccess?: () => void;
|
|
39
|
-
onLogoutError?: () => void;
|
|
35
|
+
onLogoutError?: (error: IError) => void;
|
|
40
36
|
styles?: ILoginViewStyles;
|
|
41
37
|
texts?: ILoginViewTexts;
|
|
42
38
|
userFirstName?: string;
|
|
@@ -95,9 +91,9 @@ export interface ILoginViewProps {
|
|
|
95
91
|
showDialog: () => void;
|
|
96
92
|
hideDialog: () => void;
|
|
97
93
|
isDialogVisible: boolean;
|
|
98
|
-
onPressLogin: (
|
|
94
|
+
onPressLogin: (fields: ILoginFields) => void;
|
|
99
95
|
isLoading: boolean;
|
|
100
|
-
userProfile?:
|
|
96
|
+
userProfile?: IUserProfilePublic;
|
|
101
97
|
onPressLogout: () => void;
|
|
102
98
|
styles?: ILoginViewStyles;
|
|
103
99
|
texts?: ILoginViewTexts;
|
|
@@ -106,6 +102,10 @@ export interface ILoginViewProps {
|
|
|
106
102
|
refs?: ILoginRefs;
|
|
107
103
|
brandImages?: ILoginBrandImages;
|
|
108
104
|
}
|
|
105
|
+
export interface ILoginFields {
|
|
106
|
+
email: string;
|
|
107
|
+
password: string;
|
|
108
|
+
}
|
|
109
109
|
export interface ILoginViewState {
|
|
110
110
|
email: IFormField;
|
|
111
111
|
password: IFormField;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import InputPhone from '@sesamsolutions/phone-input';
|
|
2
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
3
|
+
import { Platform, View } from 'react-native';
|
|
4
|
+
import R from '../../res';
|
|
5
|
+
import Input from '../input/Input';
|
|
6
|
+
import s from './/styles';
|
|
7
|
+
const PhoneInput = ({ phoneNumber, onChangePhoneNumber, styles, error, texts, country = 'US', }) => {
|
|
8
|
+
const [localValue, setLocalValue] = useState('');
|
|
9
|
+
const setLocalValueCallback = useCallback(() => {
|
|
10
|
+
setLocalValue(phoneNumber);
|
|
11
|
+
}, [phoneNumber]);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
setLocalValueCallback();
|
|
14
|
+
}, [phoneNumber, setLocalValueCallback]);
|
|
15
|
+
const handleOnChangeInputPhone = (payload) => {
|
|
16
|
+
setLocalValue(payload.input);
|
|
17
|
+
onChangePhoneNumber(payload);
|
|
18
|
+
};
|
|
19
|
+
return (React.createElement(View, { style: [s.rootContainer, styles === null || styles === void 0 ? void 0 : styles.rootContainer] },
|
|
20
|
+
React.createElement(Input, { onChangeText: setLocalValue, label: (texts === null || texts === void 0 ? void 0 : texts.label) || 'Phone number', keyboardType: 'phone-pad', error: error, value: localValue, labelOffset: {
|
|
21
|
+
x1: Platform.OS === 'ios' ? -40 : -40,
|
|
22
|
+
}, styles: {
|
|
23
|
+
container: s.phoneInputContainer,
|
|
24
|
+
...styles === null || styles === void 0 ? void 0 : styles.input,
|
|
25
|
+
errorColor: (styles === null || styles === void 0 ? void 0 : styles.errorColor) || R.colors.danger,
|
|
26
|
+
}, renderLeftAccessory: () => {
|
|
27
|
+
var _a;
|
|
28
|
+
return (React.createElement(View, { style: (s.countryContainer, (_a = styles === null || styles === void 0 ? void 0 : styles.country) === null || _a === void 0 ? void 0 : _a.container) },
|
|
29
|
+
React.createElement(InputPhone, { initialCountry: country, onChange: handleOnChangeInputPhone, style: s.countryButton, textStyle: s.textInput, value: localValue, dismissKeyboard: false })));
|
|
30
|
+
} })));
|
|
31
|
+
};
|
|
32
|
+
export default PhoneInput;
|
|
33
|
+
//# sourceMappingURL=PhoneInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhoneInput.js","sourceRoot":"","sources":["../../../src/components/phoneInput/PhoneInput.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,6BAA6B,CAAA;AACpD,OAAO,KAAK,EAAE,EAAM,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAE7C,OAAO,CAAC,MAAM,WAAW,CAAA;AACzB,OAAO,KAAK,MAAM,gBAAgB,CAAA;AAClC,OAAO,CAAC,MAAM,WAAW,CAAA;AAGzB,MAAM,UAAU,GAAyB,CAAC,EACxC,WAAW,EACX,mBAAmB,EACnB,MAAM,EACN,KAAK,EACL,KAAK,EACL,OAAO,GAAG,IAAI,GACf,EAAE,EAAE;IACH,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAA;IAChD,MAAM,qBAAqB,GAAG,WAAW,CAAC,GAAG,EAAE;QAC7C,aAAa,CAAC,WAAW,CAAC,CAAA;IAC5B,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAA;IAEjB,SAAS,CAAC,GAAG,EAAE;QACb,qBAAqB,EAAE,CAAA;IACzB,CAAC,EAAE,CAAC,WAAW,EAAE,qBAAqB,CAAC,CAAC,CAAA;IAExC,MAAM,wBAAwB,GAAG,CAAC,OAAoC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C,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
rootContainer: {
|
|
3
|
+
flexDirection: "row";
|
|
4
|
+
width: string;
|
|
5
|
+
};
|
|
6
|
+
countryContainer: {
|
|
7
|
+
marginBottom: number;
|
|
8
|
+
paddingBottom: number;
|
|
9
|
+
width: number;
|
|
10
|
+
};
|
|
11
|
+
countryButton: {
|
|
12
|
+
width: number;
|
|
13
|
+
overflow: "hidden";
|
|
14
|
+
marginBottom: number;
|
|
15
|
+
paddingBottom: number;
|
|
16
|
+
borderBottomWidth: number;
|
|
17
|
+
borderBottomColor: string;
|
|
18
|
+
zIndex: number;
|
|
19
|
+
};
|
|
20
|
+
phoneInputContainer: {
|
|
21
|
+
flex: number;
|
|
22
|
+
};
|
|
23
|
+
textInput: {
|
|
24
|
+
width: number;
|
|
25
|
+
borderBottomWidth: number;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Platform, StyleSheet } from 'react-native';
|
|
2
|
+
import R from '../../res';
|
|
3
|
+
export default StyleSheet.create({
|
|
4
|
+
rootContainer: {
|
|
5
|
+
flexDirection: 'row',
|
|
6
|
+
width: '100%',
|
|
7
|
+
},
|
|
8
|
+
countryContainer: {
|
|
9
|
+
marginBottom: 0,
|
|
10
|
+
paddingBottom: 0,
|
|
11
|
+
width: Platform.OS === 'ios' ? 32 : 16,
|
|
12
|
+
},
|
|
13
|
+
countryButton: {
|
|
14
|
+
width: Platform.OS === 'ios' ? 32 : 32,
|
|
15
|
+
overflow: 'hidden',
|
|
16
|
+
marginBottom: -8,
|
|
17
|
+
paddingBottom: 0,
|
|
18
|
+
borderBottomWidth: 0,
|
|
19
|
+
borderBottomColor: R.colors.transparent,
|
|
20
|
+
zIndex: 4,
|
|
21
|
+
},
|
|
22
|
+
phoneInputContainer: {
|
|
23
|
+
flex: 1,
|
|
24
|
+
},
|
|
25
|
+
textInput: {
|
|
26
|
+
width: 0,
|
|
27
|
+
borderBottomWidth: 0,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/phoneInput/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEnD,OAAO,CAAC,MAAM,WAAW,CAAA;AAEzB,eAAe,UAAU,CAAC,MAAM,CAAC;IAC/B,aAAa,EAAE;QACb,aAAa,EAAE,KAAK;QACpB,KAAK,EAAE,MAAM;KACd;IACD,gBAAgB,EAAE;QAChB,YAAY,EAAE,CAAC;QACf,aAAa,EAAE,CAAC;QAChB,KAAK,EAAE,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;KACvC;IACD,aAAa,EAAE;QACb,KAAK,EAAE,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;QACtC,QAAQ,EAAE,QAAQ;QAClB,YAAY,EAAE,CAAC,CAAC;QAChB,aAAa,EAAE,CAAC;QAChB,iBAAiB,EAAE,CAAC;QACpB,iBAAiB,EAAE,CAAC,CAAC,MAAM,CAAC,WAAW;QACvC,MAAM,EAAE,CAAC;KACV;IACD,mBAAmB,EAAE;QACnB,IAAI,EAAE,CAAC;KACR;IACD,SAAS,EAAE;QACT,KAAK,EAAE,CAAC;QACR,iBAAiB,EAAE,CAAC;KACrB;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ColorValue, StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import { IInputStyles } from '../input/types';
|
|
3
|
+
export interface IOnChangePhoneNumberPayload {
|
|
4
|
+
countryCode: string;
|
|
5
|
+
dialCode: string;
|
|
6
|
+
e164: string;
|
|
7
|
+
input: string;
|
|
8
|
+
isValid: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface IPhoneInputProps {
|
|
11
|
+
phoneNumber: string;
|
|
12
|
+
onChangePhoneNumber: (payload: IOnChangePhoneNumberPayload) => void;
|
|
13
|
+
styles?: IPhoneInputStyles;
|
|
14
|
+
error?: string;
|
|
15
|
+
texts?: IPhoneInputTexts;
|
|
16
|
+
country?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface IPhoneInputTexts {
|
|
19
|
+
label?: string;
|
|
20
|
+
customError?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface IPhoneInputStyles {
|
|
23
|
+
rootContainer?: StyleProp<ViewStyle>;
|
|
24
|
+
errorColor?: ColorValue;
|
|
25
|
+
country?: {
|
|
26
|
+
container?: StyleProp<ViewStyle>;
|
|
27
|
+
button?: StyleProp<ViewStyle>;
|
|
28
|
+
};
|
|
29
|
+
input?: IInputStyles;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/phoneInput/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
1
2
|
import { IPromoCodeProps } from './types';
|
|
2
|
-
declare const PromoCode:
|
|
3
|
+
declare const PromoCode: FC<IPromoCodeProps>;
|
|
3
4
|
export default PromoCode;
|