ordering-ui-react-native 0.18.55 → 0.18.56-crash-driver-1
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/package.json +6 -4
- package/src/components/BusinessInformation/index.tsx +10 -9
- package/src/components/PaymentOptionsWebView/index.tsx +30 -8
- package/src/components/PhoneInputNumber/index.tsx +6 -2
- package/src/components/StripeMethodForm/index.tsx +60 -55
- package/src/components/shared/OToast.tsx +3 -2
- package/src/types/index.tsx +3 -1
- package/src/utils/index.tsx +2 -2
- package/themes/business/index.tsx +6 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +15 -8
- package/themes/business/src/components/BusinessController/index.tsx +19 -17
- package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
- package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
- package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
- package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
- package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
- package/themes/business/src/components/Chat/index.tsx +48 -19
- package/themes/business/src/components/DriverMap/index.tsx +36 -23
- package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/GoogleMap/index.tsx +15 -8
- package/themes/business/src/components/Home/index.tsx +5 -1
- package/themes/business/src/components/LanguageSelector/index.tsx +1 -2
- package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
- package/themes/business/src/components/LoginForm/index.tsx +2 -2
- package/themes/business/src/components/LogoutButton/index.tsx +1 -1
- package/themes/business/src/components/MapView/index.tsx +28 -17
- package/themes/business/src/components/MessagesOption/index.tsx +22 -94
- package/themes/business/src/components/NewOrderNotification/index.tsx +162 -106
- package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
- package/themes/business/src/components/OrderDetails/Business.tsx +53 -3
- package/themes/business/src/components/OrderDetails/Delivery.tsx +209 -13
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +107 -75
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +79 -41
- package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +7 -2
- package/themes/business/src/components/OrderMessage/index.tsx +1 -1
- package/themes/business/src/components/OrderSummary/index.tsx +245 -82
- package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
- package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
- package/themes/business/src/components/OrdersOption/index.tsx +125 -48
- package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
- package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
- package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +43 -41
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
- package/themes/business/src/components/PreviousOrders/index.tsx +195 -221
- package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
- package/themes/business/src/components/PrinterEdition/index.tsx +363 -0
- package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
- package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
- package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
- package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +1 -1
- package/themes/business/src/components/SearchBar/index.tsx +2 -1
- package/themes/business/src/components/Sessions/index.tsx +187 -0
- package/themes/business/src/components/Sessions/styles.tsx +20 -0
- package/themes/business/src/components/StoresList/index.tsx +4 -3
- package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
- package/themes/business/src/components/UserProfileForm/index.tsx +103 -53
- package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
- package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/business/src/components/shared/OInput.tsx +2 -0
- package/themes/business/src/hooks/useLocation.tsx +5 -4
- package/themes/business/src/types/index.tsx +21 -1
- package/themes/business/src/utils/index.tsx +5 -0
- package/themes/kiosk/src/components/Checkout/index.tsx +5 -3
- package/themes/kiosk/src/components/CustomerName/index.tsx +1 -1
- package/themes/kiosk/src/components/Intro/index.tsx +16 -1
- package/themes/kiosk/src/components/LoginForm/index.tsx +131 -101
- package/themes/kiosk/src/components/PaymentOptions/index.tsx +57 -121
- package/themes/original/index.tsx +11 -3
- package/themes/original/src/components/AddressDetails/index.tsx +20 -10
- package/themes/original/src/components/AddressForm/index.tsx +41 -20
- package/themes/original/src/components/AddressForm/styles.tsx +1 -1
- package/themes/original/src/components/AddressList/index.tsx +22 -11
- package/themes/original/src/components/AddressList/styles.tsx +4 -4
- package/themes/original/src/components/AnalyticsSegment/index.tsx +10 -7
- package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +8 -11
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
- package/themes/original/src/components/BusinessController/index.tsx +40 -43
- package/themes/original/src/components/BusinessController/styles.tsx +12 -12
- package/themes/original/src/components/BusinessInformation/index.tsx +45 -17
- package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +57 -361
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
- package/themes/original/src/components/BusinessPreorder/index.tsx +9 -7
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -3
- package/themes/original/src/components/BusinessProductsList/index.tsx +5 -4
- package/themes/original/src/components/BusinessProductsListing/index.tsx +67 -28
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +3 -4
- package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +30 -404
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +2 -2
- package/themes/original/src/components/Cart/index.tsx +51 -40
- package/themes/original/src/components/CartContent/index.tsx +98 -54
- package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +308 -75
- package/themes/original/src/components/Checkout/styles.tsx +17 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
- package/themes/original/src/components/DatePicker/index.tsx +33 -0
- package/themes/original/src/components/DatePicker/styles.tsx +20 -0
- package/themes/original/src/components/DriverTips/index.tsx +6 -3
- package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
- package/themes/original/src/components/Favorite/index.tsx +8 -4
- package/themes/original/src/components/Favorite/styles.tsx +0 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -0
- package/themes/original/src/components/GPSButton/index.tsx +7 -5
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +84 -8
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
- package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
- package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
- package/themes/original/src/components/GoogleMap/index.tsx +52 -5
- package/themes/original/src/components/Help/index.tsx +7 -0
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +5 -0
- package/themes/original/src/components/HelpGuide/index.tsx +5 -0
- package/themes/original/src/components/HelpOrder/index.tsx +5 -0
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
- package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +3 -2
- package/themes/original/src/components/LastOrder/index.tsx +2 -1
- package/themes/original/src/components/LastOrders/index.tsx +2 -1
- package/themes/original/src/components/LoginForm/Otp/index.tsx +79 -25
- package/themes/original/src/components/LoginForm/index.tsx +38 -14
- package/themes/original/src/components/MessageListing/index.tsx +6 -0
- package/themes/original/src/components/Messages/index.tsx +9 -3
- package/themes/original/src/components/Messages/styles.tsx +1 -1
- package/themes/original/src/components/MomentOption/index.tsx +20 -5
- package/themes/original/src/components/MomentSelector/index.tsx +1 -1
- package/themes/original/src/components/MultiCart/index.tsx +1 -1
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +48 -15
- package/themes/original/src/components/MultiCheckout/index.tsx +295 -56
- package/themes/original/src/components/MultiCheckout/styles.tsx +20 -1
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +21 -16
- package/themes/original/src/components/MyOrders/index.tsx +37 -39
- package/themes/original/src/components/NavBar/index.tsx +15 -14
- package/themes/original/src/components/NetworkError/index.tsx +2 -3
- package/themes/original/src/components/NetworkError/styles.tsx +2 -2
- package/themes/original/src/components/Notifications/index.tsx +9 -8
- package/themes/original/src/components/Notifications/styles.tsx +0 -1
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +21 -6
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +14 -5
- package/themes/original/src/components/OrderDetails/index.tsx +718 -667
- package/themes/original/src/components/OrderDetails/styles.tsx +24 -7
- package/themes/original/src/components/OrderProgress/index.tsx +50 -14
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
- package/themes/original/src/components/OrderSummary/index.tsx +26 -34
- package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -0
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/index.tsx +14 -6
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PageBanner/index.tsx +3 -0
- package/themes/original/src/components/PaymentOptionCard/index.tsx +182 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
- package/themes/original/src/components/PaymentOptions/index.tsx +118 -37
- package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -1
- package/themes/original/src/components/PreviousOrders/index.tsx +2 -0
- package/themes/original/src/components/ProductForm/ActionButton.tsx +122 -0
- package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
- package/themes/original/src/components/ProductForm/index.tsx +193 -267
- package/themes/original/src/components/ProductForm/styles.tsx +1 -1
- package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -42
- package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +120 -79
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
- package/themes/original/src/components/Promotions/index.tsx +13 -11
- package/themes/original/src/components/Promotions/styles.tsx +0 -2
- package/themes/original/src/components/ReviewDriver/index.tsx +5 -0
- package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/index.tsx +5 -0
- package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
- package/themes/original/src/components/ReviewProducts/index.tsx +5 -0
- package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
- package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
- package/themes/original/src/components/ServiceForm/index.tsx +2 -2
- package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
- package/themes/original/src/components/Sessions/index.tsx +5 -0
- package/themes/original/src/components/SignupForm/index.tsx +76 -60
- package/themes/original/src/components/SingleOrderCard/index.tsx +6 -5
- package/themes/original/src/components/SingleProductCard/index.tsx +5 -4
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -5
- package/themes/original/src/components/StripeCardsList/index.tsx +26 -8
- package/themes/original/src/components/StripeElementsForm/index.tsx +80 -62
- package/themes/original/src/components/StripeElementsForm/naked.tsx +59 -1
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +91 -0
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
- package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
- package/themes/original/src/components/UserFormDetails/index.tsx +128 -79
- package/themes/original/src/components/UserFormDetails/styles.tsx +8 -1
- package/themes/original/src/components/UserProfile/index.tsx +5 -4
- package/themes/original/src/components/UserProfileForm/index.tsx +35 -36
- package/themes/original/src/components/UserVerification/index.tsx +55 -50
- package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
- package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
- package/themes/original/src/components/Wallets/index.tsx +35 -49
- package/themes/original/src/components/Wallets/styles.tsx +3 -4
- package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
- package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
- package/themes/original/src/components/shared/OButton.tsx +5 -5
- package/themes/original/src/components/shared/OInput.tsx +7 -4
- package/themes/original/src/components/shared/OModal.tsx +12 -14
- package/themes/original/src/layouts/Container.tsx +5 -3
- package/themes/original/src/types/index.tsx +13 -2
- package/themes/original/src/utils/index.tsx +124 -22
- package/src/navigators/BottomNavigator.tsx +0 -117
- package/src/navigators/CheckoutNavigator.tsx +0 -66
- package/src/navigators/HomeNavigator.tsx +0 -202
- package/src/navigators/NavigationRef.tsx +0 -7
- package/src/navigators/RootNavigator.tsx +0 -269
- package/src/pages/Account.tsx +0 -34
- package/src/pages/AddressForm.tsx +0 -62
- package/src/pages/AddressList.tsx +0 -24
- package/src/pages/BusinessProductsList.tsx +0 -81
- package/src/pages/BusinessesListing.tsx +0 -43
- package/src/pages/CartList.tsx +0 -49
- package/src/pages/Checkout.tsx +0 -101
- package/src/pages/ForgotPassword.tsx +0 -24
- package/src/pages/Help.tsx +0 -23
- package/src/pages/HelpAccountAndPayment.tsx +0 -23
- package/src/pages/HelpGuide.tsx +0 -23
- package/src/pages/HelpOrder.tsx +0 -23
- package/src/pages/Home.tsx +0 -36
- package/src/pages/IntroductoryTutorial.tsx +0 -170
- package/src/pages/Login.tsx +0 -47
- package/src/pages/MomentOption.tsx +0 -30
- package/src/pages/MultiCheckout.tsx +0 -31
- package/src/pages/MultiOrdersDetails.tsx +0 -27
- package/src/pages/MyOrders.tsx +0 -40
- package/src/pages/NetworkError.tsx +0 -24
- package/src/pages/NotFound.tsx +0 -22
- package/src/pages/OrderDetails.tsx +0 -25
- package/src/pages/ProductDetails.tsx +0 -55
- package/src/pages/Profile.tsx +0 -36
- package/src/pages/ReviewDriver.tsx +0 -30
- package/src/pages/ReviewOrder.tsx +0 -32
- package/src/pages/ReviewProducts.tsx +0 -30
- package/src/pages/Sessions.tsx +0 -22
- package/src/pages/Signup.tsx +0 -53
- package/src/pages/SpinnerLoader.tsx +0 -10
- package/src/pages/Splash.tsx +0 -21
|
@@ -13,7 +13,7 @@ import { OIcon, OText } from '../shared';
|
|
|
13
13
|
export const ScheduleAccordion = (props: any) => {
|
|
14
14
|
|
|
15
15
|
const {
|
|
16
|
-
|
|
16
|
+
timeFormated,
|
|
17
17
|
schedule,
|
|
18
18
|
weekIndex
|
|
19
19
|
} = props
|
|
@@ -52,9 +52,9 @@ export const ScheduleAccordion = (props: any) => {
|
|
|
52
52
|
{schedule?.lapses?.map((lapse: any) => (
|
|
53
53
|
schedule?.enabled ?
|
|
54
54
|
<OText mBottom={16}>
|
|
55
|
-
{
|
|
55
|
+
{timeFormated(lapse.open) +
|
|
56
56
|
' - ' +
|
|
57
|
-
|
|
57
|
+
timeFormated(lapse.close)}
|
|
58
58
|
</OText>
|
|
59
59
|
:
|
|
60
60
|
<OText color={theme.colors.red} mBottom={16}>
|
|
@@ -116,7 +116,7 @@ const ServiceFormUI = (props: ServiceFormParams) => {
|
|
|
116
116
|
marginHorizontal: 0
|
|
117
117
|
},
|
|
118
118
|
professionalList: {
|
|
119
|
-
paddingHorizontal:
|
|
119
|
+
paddingHorizontal: 20,
|
|
120
120
|
paddingVertical: 30,
|
|
121
121
|
}
|
|
122
122
|
})
|
|
@@ -602,7 +602,7 @@ const ServiceFormUI = (props: ServiceFormParams) => {
|
|
|
602
602
|
<PlaceholderLine width={60} height={20} />
|
|
603
603
|
</Placeholder>
|
|
604
604
|
) : (
|
|
605
|
-
<OText color={theme.colors.primary} size={13}>{t('
|
|
605
|
+
<OText color={theme.colors.primary} size={13}>{t('AS_GUEST_USER', 'As guest user')}</OText>
|
|
606
606
|
)}
|
|
607
607
|
</TouchableOpacity>
|
|
608
608
|
)}
|
|
@@ -11,7 +11,7 @@ export const ProfessionalPhoto = styled.ImageBackground`
|
|
|
11
11
|
`;
|
|
12
12
|
|
|
13
13
|
export const InfoWrapper = styled.View`
|
|
14
|
-
padding-horizontal:
|
|
14
|
+
padding-horizontal: 20px;
|
|
15
15
|
margin-vertical: 30px;
|
|
16
16
|
`
|
|
17
17
|
|
|
@@ -22,7 +22,7 @@ export const Divider = styled.View`
|
|
|
22
22
|
`
|
|
23
23
|
|
|
24
24
|
export const ProfessionalWrapper = styled.View`
|
|
25
|
-
padding-horizontal:
|
|
25
|
+
padding-horizontal: 20px;
|
|
26
26
|
margin-top: 30px;
|
|
27
27
|
`
|
|
28
28
|
|
|
@@ -41,10 +41,10 @@ export const ButtonWrapper = styled.View`
|
|
|
41
41
|
align-items: center;
|
|
42
42
|
flex-direction: row;
|
|
43
43
|
padding-vertical: 13px;
|
|
44
|
-
padding-horizontal:
|
|
44
|
+
padding-horizontal: 20px;
|
|
45
45
|
margin-top: 30px;
|
|
46
46
|
margin-bottom: 40px;
|
|
47
47
|
width: 100%;
|
|
48
48
|
border-top-width: 1px;
|
|
49
49
|
border-top-color: ${(props: any) => props.theme.colors.backgroundGray200};
|
|
50
|
-
`
|
|
50
|
+
`
|
|
@@ -72,6 +72,11 @@ export const SessionsUI = (props: SessionsParams) => {
|
|
|
72
72
|
showCall={false}
|
|
73
73
|
paddingTop={10}
|
|
74
74
|
btnStyle={{ paddingLeft: 0 }}
|
|
75
|
+
buttonProps={{
|
|
76
|
+
bgColor: theme.colors.white,
|
|
77
|
+
borderColor: theme.colors.white,
|
|
78
|
+
textStyle: { color: theme.colors.btnFont }
|
|
79
|
+
}}
|
|
75
80
|
/>
|
|
76
81
|
{user?.session_strategy === 'jwt_session' ? (
|
|
77
82
|
<>
|
|
@@ -8,6 +8,7 @@ import { PhoneInputNumber } from '../PhoneInputNumber';
|
|
|
8
8
|
import { FacebookLogin } from '../FacebookLogin';
|
|
9
9
|
import Recaptcha from 'react-native-recaptcha-that-works'
|
|
10
10
|
import ReCaptcha from '@fatnlazycat/react-native-recaptcha-v3'
|
|
11
|
+
import ReactNativeHapticFeedback from "react-native-haptic-feedback";
|
|
11
12
|
|
|
12
13
|
import {
|
|
13
14
|
SignupForm as SignUpController,
|
|
@@ -37,7 +38,7 @@ import Alert from '../../../../../src/providers/AlertProvider'
|
|
|
37
38
|
import { OText, OButton, OInput } from '../shared';
|
|
38
39
|
import { OModal } from '../../../../../src/components/shared';
|
|
39
40
|
import { SignupParams } from '../../types';
|
|
40
|
-
import { sortInputFields
|
|
41
|
+
import { sortInputFields } from '../../utils';
|
|
41
42
|
import { GoogleLogin } from '../GoogleLogin';
|
|
42
43
|
import { AppleLogin } from '../AppleLogin';
|
|
43
44
|
|
|
@@ -154,7 +155,7 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
154
155
|
const showInputPhoneNumber = (validationFields?.fields?.checkout?.cellphone?.enabled ?? false) || configs?.verification_phone_required?.value === '1'
|
|
155
156
|
const googleLoginEnabled = configs?.google_login_enabled?.value === '1' || !configs?.google_login_enabled?.enabled
|
|
156
157
|
const facebookLoginEnabled = configs?.facebook_login_enabled?.value === '1' || !configs?.facebook_login_enabled?.enabled
|
|
157
|
-
const appleLoginEnabled = configs?.apple_login_enabled?.value === '1' || !configs?.apple_login_enabled?.enabled
|
|
158
|
+
const appleLoginEnabled = Platform.OS === 'ios' && (configs?.apple_login_enabled?.value === '1' || !configs?.apple_login_enabled?.enabled)
|
|
158
159
|
|
|
159
160
|
const closeAlert = () => {
|
|
160
161
|
setAlertState({
|
|
@@ -164,6 +165,14 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
164
165
|
})
|
|
165
166
|
}
|
|
166
167
|
|
|
168
|
+
const vibrateApp = (impact?: string) => {
|
|
169
|
+
const options = {
|
|
170
|
+
enableVibrateFallback: true,
|
|
171
|
+
ignoreAndroidSystemSettings: false
|
|
172
|
+
};
|
|
173
|
+
ReactNativeHapticFeedback.trigger(impact || "impactLight", options);
|
|
174
|
+
}
|
|
175
|
+
|
|
167
176
|
const handleRefs = (ref: any, code: string) => {
|
|
168
177
|
switch (code) {
|
|
169
178
|
case 'name': {
|
|
@@ -479,6 +488,11 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
479
488
|
btnStyle={{ paddingLeft: 0 }}
|
|
480
489
|
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
481
490
|
titleStyle={{ marginLeft: 0, marginRight: 0 }}
|
|
491
|
+
buttonProps={{
|
|
492
|
+
bgColor: theme.colors.white,
|
|
493
|
+
borderColor: theme.colors.white,
|
|
494
|
+
textStyle: { color: theme.colors.btnFont }
|
|
495
|
+
}}
|
|
482
496
|
/>
|
|
483
497
|
)}
|
|
484
498
|
<FormSide>
|
|
@@ -574,65 +588,67 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
574
588
|
{sortInputFields({
|
|
575
589
|
values: validationFields?.fields?.checkout,
|
|
576
590
|
}).map(
|
|
577
|
-
(
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
(signUpTab === '
|
|
583
|
-
|
|
584
|
-
{
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
<Controller
|
|
593
|
-
control={control}
|
|
594
|
-
render={({ onChange, value }: any) => (
|
|
595
|
-
<OInput
|
|
596
|
-
placeholder={t(field.name?.replace(/\s/g, '_')?.toUpperCase(), field.name)}
|
|
597
|
-
style={style.inputStyle}
|
|
598
|
-
icon={
|
|
599
|
-
field.code === 'email'
|
|
600
|
-
? theme.images.general.email
|
|
601
|
-
: theme.images.general.user
|
|
602
|
-
}
|
|
603
|
-
value={value}
|
|
604
|
-
onChange={(val: any) =>
|
|
605
|
-
field.code !== 'email'
|
|
606
|
-
? (onChange(val))
|
|
607
|
-
: handleChangeInputEmail(val, onChange)
|
|
608
|
-
}
|
|
609
|
-
autoCapitalize={
|
|
610
|
-
field.code === 'email' ? 'none' : 'sentences'
|
|
611
|
-
}
|
|
612
|
-
autoCorrect={field.code === 'email' && false}
|
|
613
|
-
type={
|
|
614
|
-
field.code === 'email' ? 'email-address' : 'default'
|
|
615
|
-
}
|
|
616
|
-
autoCompleteType={
|
|
617
|
-
field.code === 'email' ? 'email' : 'off'
|
|
618
|
-
}
|
|
619
|
-
returnKeyType="next"
|
|
620
|
-
blurOnSubmit={false}
|
|
621
|
-
forwardRef={(ref: any) => handleRefs(ref, field.code)}
|
|
622
|
-
onSubmitEditing={() =>
|
|
623
|
-
field.code === 'email'
|
|
624
|
-
? phoneRef?.current?.focus?.()
|
|
625
|
-
: handleFocusRef(getNextFieldCode(i))
|
|
626
|
-
}
|
|
627
|
-
borderColor={errors?.[`${field.code}`] ? theme.colors.danger5 : theme.colors.border}
|
|
628
|
-
/>
|
|
591
|
+
(item: any, i: number) => {
|
|
592
|
+
const field = item?.validation_field || item
|
|
593
|
+
return (!notValidationFields.includes(field.code) &&
|
|
594
|
+
showField &&
|
|
595
|
+
showField(field.code) &&
|
|
596
|
+
(signUpTab === 'default' ||
|
|
597
|
+
(signUpTab === 'otpEmail' && field.code === 'email')) && (
|
|
598
|
+
<React.Fragment key={field.id}>
|
|
599
|
+
{errors?.[`${field.code}`] && (
|
|
600
|
+
<OText
|
|
601
|
+
size={14}
|
|
602
|
+
color={theme.colors.danger5}
|
|
603
|
+
weight={'normal'}>
|
|
604
|
+
{errors?.[`${field.code}`]?.message} {errors?.[`${field.code}`]?.type === 'required' && '*'}
|
|
605
|
+
</OText>
|
|
629
606
|
)}
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
607
|
+
<Controller
|
|
608
|
+
control={control}
|
|
609
|
+
render={({ onChange, value }: any) => (
|
|
610
|
+
<OInput
|
|
611
|
+
placeholder={t(field.name?.replace(/\s/g, '_')?.toUpperCase(), field.name)}
|
|
612
|
+
style={style.inputStyle}
|
|
613
|
+
icon={
|
|
614
|
+
field.code === 'email'
|
|
615
|
+
? theme.images.general.email
|
|
616
|
+
: theme.images.general.user
|
|
617
|
+
}
|
|
618
|
+
value={value}
|
|
619
|
+
onChange={(val: any) =>
|
|
620
|
+
field.code !== 'email'
|
|
621
|
+
? (onChange(val))
|
|
622
|
+
: handleChangeInputEmail(val, onChange)
|
|
623
|
+
}
|
|
624
|
+
autoCapitalize={
|
|
625
|
+
field.code === 'email' ? 'none' : 'sentences'
|
|
626
|
+
}
|
|
627
|
+
autoCorrect={field.code === 'email' && false}
|
|
628
|
+
type={
|
|
629
|
+
field.code === 'email' ? 'email-address' : 'default'
|
|
630
|
+
}
|
|
631
|
+
autoCompleteType={
|
|
632
|
+
field.code === 'email' ? 'email' : 'off'
|
|
633
|
+
}
|
|
634
|
+
returnKeyType="next"
|
|
635
|
+
blurOnSubmit={false}
|
|
636
|
+
forwardRef={(ref: any) => handleRefs(ref, field.code)}
|
|
637
|
+
onSubmitEditing={() =>
|
|
638
|
+
field.code === 'email'
|
|
639
|
+
? phoneRef?.current?.focus?.()
|
|
640
|
+
: handleFocusRef(getNextFieldCode(i))
|
|
641
|
+
}
|
|
642
|
+
borderColor={errors?.[`${field.code}`] ? theme.colors.danger5 : theme.colors.border}
|
|
643
|
+
/>
|
|
644
|
+
)}
|
|
645
|
+
name={field.code}
|
|
646
|
+
rules={getInputRules(field)}
|
|
647
|
+
defaultValue=""
|
|
648
|
+
/>
|
|
649
|
+
</React.Fragment>
|
|
650
|
+
))
|
|
651
|
+
}
|
|
636
652
|
)}
|
|
637
653
|
|
|
638
654
|
{(!!showInputPhoneNumber && (signUpTab === 'default' || signUpTab === 'otpCellphone')) && (
|
|
@@ -52,7 +52,8 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
|
52
52
|
const [confirm, setConfirm] = useState<any>({ open: false, content: null, handleOnAccept: null, id: null, title: null })
|
|
53
53
|
const [isPressed, setIsPressed] = useState(false)
|
|
54
54
|
|
|
55
|
-
const allowedOrderStatus = [1, 2, 5, 6, 10, 11, 12];
|
|
55
|
+
const allowedOrderStatus = [1, 2, 5, 6, 10, 11, 12, 15];
|
|
56
|
+
const isGiftCardOrder = !order?.business_id
|
|
56
57
|
|
|
57
58
|
const styles = StyleSheet.create({
|
|
58
59
|
container: {
|
|
@@ -284,17 +285,17 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
|
284
285
|
) : (
|
|
285
286
|
<Price>
|
|
286
287
|
<OText size={12} lineHeight={18}>
|
|
287
|
-
{parsePrice(order?.
|
|
288
|
+
{parsePrice(order?.total)}
|
|
288
289
|
</OText>
|
|
289
290
|
</Price>
|
|
290
291
|
)}
|
|
291
292
|
</>
|
|
292
293
|
)}
|
|
293
|
-
{!!pastOrders && (
|
|
294
|
+
{!!pastOrders && !isGiftCardOrder && (
|
|
294
295
|
<ButtonWrapper>
|
|
295
296
|
{!hideReviewOrderButton &&
|
|
296
297
|
allowedOrderStatus.includes(parseInt(order?.status)) &&
|
|
297
|
-
!order.review && (
|
|
298
|
+
!order.review && order?.cart && (
|
|
298
299
|
<TouchableOpacity
|
|
299
300
|
onPress={() => handleClickOrderReview(order)}
|
|
300
301
|
style={styles.reviewButton}>
|
|
@@ -303,7 +304,7 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
|
303
304
|
</OText>
|
|
304
305
|
</TouchableOpacity>
|
|
305
306
|
)}
|
|
306
|
-
{!hideReorderButton && typeof order?.id === 'number' && (
|
|
307
|
+
{!hideReorderButton && typeof order?.id === 'number' && order?.cart && (
|
|
307
308
|
<OButton
|
|
308
309
|
text={t('REORDER', 'Reorder')}
|
|
309
310
|
imgRightSrc={''}
|
|
@@ -48,6 +48,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
48
48
|
const hideAddButton = theme?.business_view?.components?.products?.components?.add_to_cart_button?.hidden ?? true
|
|
49
49
|
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
50
50
|
const hideProductDescription = theme?.business_view?.components?.products?.components?.product?.components?.description?.hidden
|
|
51
|
+
const hideProductDummyLogo = theme?.business_view?.components?.products?.components?.product?.components?.dummy?.hidden
|
|
51
52
|
const hideProductLogo = viewString
|
|
52
53
|
? theme?.[viewString]?.components?.cart?.components?.products?.image?.hidden
|
|
53
54
|
: theme?.business_view?.components?.products?.components?.product?.components?.image?.hidden
|
|
@@ -169,7 +170,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
169
170
|
}
|
|
170
171
|
|
|
171
172
|
return (
|
|
172
|
-
<
|
|
173
|
+
<View style={{ minHeight: hideAddButton ? 125 : 190, marginLeft: logoPosition === 'left' ? 12.5 : 0 }}>
|
|
173
174
|
{isIntersectionObserver ? (
|
|
174
175
|
<CardAnimation
|
|
175
176
|
onClick={() => handleClickproduct()}
|
|
@@ -182,7 +183,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
182
183
|
<View style={{ flexDirection: logoPosition === 'left' ? 'row-reverse' : 'row' }}>
|
|
183
184
|
{productAddedToCartLength > 0 && (
|
|
184
185
|
<QuantityContainer businessSingleId={businessSingleId} style={[styles.quantityContainer, {
|
|
185
|
-
transform: [{ translateX: 25 }, { translateY: -25 }],
|
|
186
|
+
transform: [{ translateX: logoPosition === 'right' ? 25 : -25 }, { translateY: -25 }],
|
|
186
187
|
}]}>
|
|
187
188
|
<OText size={12} color={theme.colors.white}>{productAddedToCartLength.toString()}</OText>
|
|
188
189
|
</QuantityContainer>
|
|
@@ -283,7 +284,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
283
284
|
</OText>
|
|
284
285
|
</RibbonBox>
|
|
285
286
|
)}
|
|
286
|
-
{!hideProductLogo && (
|
|
287
|
+
{(!hideProductLogo && (product?.images || !hideProductDummyLogo)) && (
|
|
287
288
|
<FastImage
|
|
288
289
|
style={styles.productStyle}
|
|
289
290
|
source={product?.images ? {
|
|
@@ -340,7 +341,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
340
341
|
</Placeholder>
|
|
341
342
|
</View>
|
|
342
343
|
)}
|
|
343
|
-
</
|
|
344
|
+
</View>
|
|
344
345
|
);
|
|
345
346
|
}, SingleProductCardPropsAreEqual);
|
|
346
347
|
|
|
@@ -18,11 +18,6 @@ export const QuantityContainer = styled.View`
|
|
|
18
18
|
background: ${({ theme }: any) => theme.colors.primary};
|
|
19
19
|
align-items: center;
|
|
20
20
|
justify-content: center;
|
|
21
|
-
${({ businessSingleId }: any) => businessSingleId ? css`
|
|
22
|
-
left: 0;
|
|
23
|
-
` : css`
|
|
24
|
-
right: 0;
|
|
25
|
-
`}
|
|
26
21
|
`
|
|
27
22
|
export const PricesContainer = styled.View`
|
|
28
23
|
flex-direction: row;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
|
-
import { View, StyleSheet, ScrollView } from 'react-native';
|
|
2
|
+
import { View, StyleSheet, ScrollView, Platform } from 'react-native';
|
|
3
3
|
import {
|
|
4
4
|
PaymentOptionStripe,
|
|
5
5
|
useSession,
|
|
6
6
|
useLanguage,
|
|
7
|
+
useValidationFields
|
|
7
8
|
} from 'ordering-components/native';
|
|
8
9
|
import { PlaceholderLine } from 'rn-placeholder';
|
|
9
10
|
import { useTheme } from 'styled-components/native';
|
|
10
11
|
import { getIconCard } from '../../utils';
|
|
11
|
-
import { OAlert, OIcon, OText } from '../shared';
|
|
12
|
+
import { OAlert, OIcon, OText, OModal } from '../shared';
|
|
12
13
|
|
|
13
14
|
import { NotFoundSource } from '../NotFoundSource';
|
|
14
15
|
|
|
@@ -17,30 +18,40 @@ import {
|
|
|
17
18
|
OSItemContent,
|
|
18
19
|
OSItemActions,
|
|
19
20
|
} from '../PaymentOptionStripe/styles';
|
|
21
|
+
import { StripeElementsForm } from '../StripeElementsForm';
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
import { KeyboardAvoidingView } from 'react-native';
|
|
24
|
+
|
|
25
|
+
export const StripeCardsListUI = (props: any) => {
|
|
22
26
|
const {
|
|
23
27
|
onSelectCard,
|
|
24
28
|
deleteCard,
|
|
25
29
|
cardSelected,
|
|
26
30
|
cardsList,
|
|
27
31
|
handleCardClick,
|
|
28
|
-
|
|
32
|
+
onOpen,
|
|
33
|
+
gateway,
|
|
34
|
+
paySelected
|
|
29
35
|
} = props;
|
|
30
36
|
|
|
31
37
|
const theme = useTheme();
|
|
32
38
|
|
|
33
39
|
const [{ token }] = useSession();
|
|
34
40
|
const [, t] = useLanguage();
|
|
41
|
+
const [validationFields] = useValidationFields()
|
|
42
|
+
const validateZipcodeCard =
|
|
43
|
+
validationFields?.fields?.card?.zipcode?.enabled && validationFields?.fields?.card?.zipcode?.required
|
|
44
|
+
const paymethodsWithoutSaveCards = ['credomatic']
|
|
35
45
|
|
|
36
46
|
const handleCardSelected = (card: any) => {
|
|
47
|
+
if (!card?.zipcode && validateZipcodeCard) return
|
|
37
48
|
handleCardClick(card);
|
|
38
49
|
onSelectCard(card);
|
|
39
50
|
}
|
|
40
51
|
|
|
41
52
|
useEffect(() => {
|
|
42
|
-
if (!cardsList
|
|
43
|
-
|
|
53
|
+
if (!cardsList?.loading && cardsList?.cards?.length === 0 && !paymethodsWithoutSaveCards.includes(gateway)) {
|
|
54
|
+
onOpen && onOpen();
|
|
44
55
|
}
|
|
45
56
|
}, [cardsList?.loading])
|
|
46
57
|
|
|
@@ -82,10 +93,10 @@ const StripeCardsListUI = (props: any) => {
|
|
|
82
93
|
style={styles.cardsList}
|
|
83
94
|
>
|
|
84
95
|
{cardsList.cards.map((card: any) => (
|
|
85
|
-
<OSItem key={card.id} isUnique={cardsList.cards.length}>
|
|
96
|
+
<OSItem key={card.id} isUnique={cardsList.cards.length} isInvalid={!card?.zipcode && validateZipcodeCard}>
|
|
86
97
|
<OSItemContent onPress={() => handleCardSelected(card)}>
|
|
87
98
|
<View style={styles.viewStyle}>
|
|
88
|
-
{card.id === cardSelected?.id ? (
|
|
99
|
+
{(card.id === cardSelected?.id || card.id === paySelected?.data?.id) ? (
|
|
89
100
|
<OIcon
|
|
90
101
|
src={theme.images.general.radio_act}
|
|
91
102
|
width={16}
|
|
@@ -107,6 +118,13 @@ const StripeCardsListUI = (props: any) => {
|
|
|
107
118
|
XXXX-XXXX-XXXX-{card.last4}
|
|
108
119
|
</OText>
|
|
109
120
|
</View>
|
|
121
|
+
{!card?.zipcode && validateZipcodeCard && (
|
|
122
|
+
<View style={styles.viewStyle}>
|
|
123
|
+
<OText size={10} color={theme?.colors?.danger5}>
|
|
124
|
+
({t('MISSING_ZIPCODE', 'Missing zipcode')})
|
|
125
|
+
</OText>
|
|
126
|
+
</View>
|
|
127
|
+
)}
|
|
110
128
|
</OSItemContent>
|
|
111
129
|
<OSItemActions>
|
|
112
130
|
<OAlert
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import { View, StyleSheet, useWindowDimensions, Keyboard, Platform } from 'react-native';
|
|
3
|
-
import { useLanguage, useSession, useConfig } from 'ordering-components/native';
|
|
3
|
+
import { useLanguage, useSession, useConfig, useValidationFields } from 'ordering-components/native';
|
|
4
4
|
import {
|
|
5
5
|
StripeProvider,
|
|
6
6
|
CardField,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from '@stripe/stripe-react-native';
|
|
10
10
|
import { useTheme } from 'styled-components/native';
|
|
11
11
|
import { ErrorMessage } from './styles';
|
|
12
|
-
|
|
12
|
+
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
13
13
|
import { StripeElementsForm as StripeFormController } from './naked';
|
|
14
14
|
import { OButton, OText } from '../shared';
|
|
15
15
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
@@ -17,7 +17,7 @@ import { StripeMethodForm } from '../../../../../src/components/StripeMethodForm
|
|
|
17
17
|
|
|
18
18
|
const StripeElementsFormUI = (props: any) => {
|
|
19
19
|
const {
|
|
20
|
-
|
|
20
|
+
publicKeyState,
|
|
21
21
|
handleSource,
|
|
22
22
|
values,
|
|
23
23
|
businessId,
|
|
@@ -33,7 +33,11 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
33
33
|
placeByMethodPay,
|
|
34
34
|
methodPaySupported,
|
|
35
35
|
setPlaceByMethodPay,
|
|
36
|
-
cartTotal
|
|
36
|
+
cartTotal,
|
|
37
|
+
publicKeyAddCard,
|
|
38
|
+
urlScheme,
|
|
39
|
+
androidAppId,
|
|
40
|
+
businessNames
|
|
37
41
|
} = props;
|
|
38
42
|
|
|
39
43
|
const theme = useTheme();
|
|
@@ -41,6 +45,7 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
41
45
|
const [, t] = useLanguage();
|
|
42
46
|
const [{ user }] = useSession();
|
|
43
47
|
const [{ configs }] = useConfig();
|
|
48
|
+
const [validationFields] = useValidationFields()
|
|
44
49
|
const [card, setCard] = useState<any>(null);
|
|
45
50
|
const [isCompleted, setIsCompleted] = useState(false);
|
|
46
51
|
const [errors, setErrors] = useState('')
|
|
@@ -49,11 +54,13 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
49
54
|
const { height } = useWindowDimensions();
|
|
50
55
|
const { top, bottom } = useSafeAreaInsets();
|
|
51
56
|
const [isKeyboardShow, setIsKeyboardShow] = useState(false);
|
|
52
|
-
|
|
57
|
+
const zipCodeEnabled = validationFields?.fields?.card?.zipcode?.enabled
|
|
58
|
+
const zipCodeRequired = validationFields?.fields?.card?.zipcode?.required
|
|
59
|
+
const isToSave = methodsPay?.includes(paymethod) ? publicKeyState?.key : (publicKeyAddCard || publicKeyState?.key)
|
|
53
60
|
const styles = StyleSheet.create({
|
|
54
61
|
container: {
|
|
55
62
|
width: '100%',
|
|
56
|
-
paddingHorizontal:
|
|
63
|
+
paddingHorizontal: 20,
|
|
57
64
|
justifyContent: 'space-between',
|
|
58
65
|
paddingBottom: 12
|
|
59
66
|
},
|
|
@@ -166,7 +173,8 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
166
173
|
!!card?.last4 &&
|
|
167
174
|
!!card?.expiryMonth &&
|
|
168
175
|
!!card?.expiryYear &&
|
|
169
|
-
!!card?.brand
|
|
176
|
+
!!card?.brand &&
|
|
177
|
+
((!zipCodeEnabled || !zipCodeRequired || !!card?.postalCode))
|
|
170
178
|
)
|
|
171
179
|
}
|
|
172
180
|
}, [card])
|
|
@@ -194,69 +202,79 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
194
202
|
|
|
195
203
|
return (
|
|
196
204
|
<View style={{ ...styles.container, height: methodsPay?.includes(paymethod) ? 'auto' : height - top - bottom - 60 - (isKeyboardShow ? 250 : 0) }}>
|
|
197
|
-
{
|
|
198
|
-
<
|
|
199
|
-
<
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
{
|
|
205
|
-
<
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
205
|
+
{publicKeyState.loading ? (
|
|
206
|
+
<Placeholder Animation={Fade}>
|
|
207
|
+
<PlaceholderLine height={50} style={{ marginTop: 20 }} />
|
|
208
|
+
</Placeholder>
|
|
209
|
+
) : (
|
|
210
|
+
<>
|
|
211
|
+
{publicKeyState?.key ? (
|
|
212
|
+
<View style={{ flex: 1 }}>
|
|
213
|
+
<StripeProvider
|
|
214
|
+
publishableKey={isToSave}
|
|
215
|
+
merchantIdentifier={merchantId}
|
|
216
|
+
urlScheme={`${urlScheme}://checkout/${cart?.uuid}`}
|
|
217
|
+
>
|
|
218
|
+
{methodsPay?.includes(paymethod) ? (
|
|
219
|
+
<StripeMethodForm
|
|
220
|
+
handleSource={handleSource}
|
|
221
|
+
onCancel={onCancel}
|
|
222
|
+
cart={cart}
|
|
223
|
+
cartTotal={cartTotal}
|
|
224
|
+
setErrors={setErrors}
|
|
225
|
+
paymethod={paymethod}
|
|
226
|
+
devMode={publicKeyState?.key?.includes('test')}
|
|
227
|
+
setMethodPaySupported={setMethodPaySupported}
|
|
228
|
+
placeByMethodPay={placeByMethodPay}
|
|
229
|
+
methodPaySupported={methodPaySupported}
|
|
230
|
+
setPlaceByMethodPay={setPlaceByMethodPay}
|
|
231
|
+
androidAppId={androidAppId}
|
|
232
|
+
businessNames={businessNames}
|
|
233
|
+
/>
|
|
234
|
+
) : (
|
|
235
|
+
<CardField
|
|
236
|
+
postalCodeEnabled={zipCodeEnabled}
|
|
237
|
+
cardStyle={{
|
|
238
|
+
backgroundColor: '#FFFFFF',
|
|
239
|
+
textColor: '#000000',
|
|
240
|
+
borderWidth: 1,
|
|
241
|
+
borderRadius: 8,
|
|
242
|
+
borderColor: theme.colors.border
|
|
243
|
+
}}
|
|
244
|
+
style={{
|
|
245
|
+
width: '100%',
|
|
246
|
+
height: 50,
|
|
247
|
+
marginVertical: 30,
|
|
248
|
+
zIndex: 9999,
|
|
249
|
+
}}
|
|
250
|
+
onCardChange={(cardDetails: any) => setCard(cardDetails)}
|
|
251
|
+
/>
|
|
252
|
+
)}
|
|
253
|
+
</StripeProvider>
|
|
254
|
+
{!!errors && (
|
|
255
|
+
<ErrorMessage>
|
|
256
|
+
<OText
|
|
257
|
+
size={20}
|
|
258
|
+
color={theme.colors.error}
|
|
259
|
+
style={{ marginTop: 20, textAlign: 'center' }}
|
|
260
|
+
>
|
|
261
|
+
{errors}
|
|
262
|
+
</OText>
|
|
263
|
+
</ErrorMessage>
|
|
264
|
+
)}
|
|
265
|
+
</View>
|
|
266
|
+
) : (
|
|
239
267
|
<ErrorMessage>
|
|
240
268
|
<OText
|
|
241
269
|
size={20}
|
|
242
270
|
color={theme.colors.error}
|
|
243
|
-
style={{ marginTop: 20
|
|
271
|
+
style={{ marginTop: 20 }}
|
|
244
272
|
>
|
|
245
|
-
{
|
|
273
|
+
{t('SOMETHING_WRONG', 'Something is wrong!')}
|
|
246
274
|
</OText>
|
|
247
275
|
</ErrorMessage>
|
|
248
276
|
)}
|
|
249
|
-
|
|
250
|
-
) : (
|
|
251
|
-
<ErrorMessage>
|
|
252
|
-
<OText
|
|
253
|
-
size={20}
|
|
254
|
-
color={theme.colors.error}
|
|
255
|
-
style={{ marginTop: 20 }}
|
|
256
|
-
>
|
|
257
|
-
{t('SOMETHING_WRONG', 'Something is wrong!')}
|
|
258
|
-
</OText>
|
|
259
|
-
</ErrorMessage>
|
|
277
|
+
</>
|
|
260
278
|
)}
|
|
261
279
|
{!methodsPay?.includes(paymethod) && (
|
|
262
280
|
<OButton
|