ordering-ui-react-native 0.17.49 → 0.17.50-release
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 +8 -7
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/OrderCreating/index.tsx +1 -21
- package/src/components/PaymentOptionsWebView/index.tsx +29 -8
- package/src/components/PhoneInputNumber/index.tsx +6 -2
- package/src/components/StripeMethodForm/index.tsx +136 -102
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +4 -4
- package/src/types/index.tsx +5 -0
- package/src/utils/index.tsx +7 -1
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
- package/themes/business/src/components/BusinessController/index.tsx +0 -1
- package/themes/business/src/components/Chat/index.tsx +125 -113
- package/themes/business/src/components/DriverMap/index.tsx +17 -6
- package/themes/business/src/components/DriverSchedule/index.tsx +29 -2
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
- package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/business/src/components/LoginForm/index.tsx +238 -80
- package/themes/business/src/components/LoginForm/styles.tsx +10 -0
- package/themes/business/src/components/MapView/index.tsx +10 -10
- package/themes/business/src/components/NewOrderNotification/index.tsx +35 -21
- package/themes/business/src/components/OrderDetails/Delivery.tsx +30 -4
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +93 -50
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
- package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
- package/themes/business/src/components/OrderMessage/index.tsx +18 -17
- package/themes/business/src/components/OrderSummary/index.tsx +113 -121
- package/themes/business/src/components/OrdersOption/index.tsx +32 -75
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
- package/themes/business/src/components/PreviousOrders/index.tsx +445 -243
- package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
- package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
- package/themes/business/src/components/ReviewCustomer/index.tsx +29 -14
- package/themes/business/src/components/StoresList/index.tsx +2 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +11 -13
- package/themes/business/src/components/shared/OLink.tsx +33 -13
- package/themes/business/src/components/shared/OModal.tsx +16 -9
- package/themes/business/src/components/shared/OText.tsx +8 -2
- package/themes/business/src/types/index.tsx +32 -2
- package/themes/business/src/utils/index.tsx +44 -1
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
- package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +480 -156
- package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +3 -2
- package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
- package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
- package/themes/kiosk/src/layouts/Container.tsx +7 -1
- package/themes/kiosk/src/types/index.d.ts +13 -0
- package/themes/kiosk/src/utils/index.tsx +15 -0
- package/themes/original/index.tsx +6 -0
- package/themes/original/src/components/AddressDetails/index.tsx +29 -11
- package/themes/original/src/components/AddressForm/index.tsx +79 -44
- package/themes/original/src/components/AddressList/index.tsx +27 -22
- package/themes/original/src/components/AddressList/styles.tsx +4 -2
- package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +160 -91
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -7
- package/themes/original/src/components/BusinessController/index.tsx +146 -68
- package/themes/original/src/components/BusinessController/styles.tsx +22 -2
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
- package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
- package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +23 -22
- package/themes/original/src/components/BusinessListingSearch/index.tsx +352 -326
- package/themes/original/src/components/BusinessPreorder/index.tsx +97 -16
- package/themes/original/src/components/BusinessProductsList/index.tsx +23 -14
- package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
- package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
- package/themes/original/src/components/BusinessProductsListing/index.tsx +669 -513
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
- package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +98 -79
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -11
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +100 -67
- package/themes/original/src/components/CartContent/index.tsx +115 -19
- package/themes/original/src/components/CartContent/styles.tsx +17 -7
- package/themes/original/src/components/Checkout/index.tsx +366 -173
- package/themes/original/src/components/Checkout/styles.tsx +4 -2
- package/themes/original/src/components/CitiesControl/index.tsx +89 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
- package/themes/original/src/components/CouponControl/index.tsx +10 -3
- package/themes/original/src/components/DriverTips/index.tsx +52 -34
- package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
- package/themes/original/src/components/Favorite/index.tsx +8 -9
- package/themes/original/src/components/Favorite/styles.tsx +1 -1
- package/themes/original/src/components/FavoriteList/index.tsx +51 -80
- package/themes/original/src/components/FloatingButton/index.tsx +1 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +6 -4
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
- package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +191 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
- package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
- package/themes/original/src/components/GoogleMap/index.tsx +15 -4
- package/themes/original/src/components/Help/index.tsx +8 -8
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +10 -31
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +5 -3
- package/themes/original/src/components/HelpGuide/index.tsx +6 -6
- package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
- package/themes/original/src/components/HelpOrder/index.tsx +6 -15
- package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
- package/themes/original/src/components/Home/index.tsx +13 -4
- package/themes/original/src/components/LastOrder/index.tsx +1 -34
- package/themes/original/src/components/LoginForm/Otp/index.tsx +55 -13
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
- package/themes/original/src/components/LoginForm/index.tsx +64 -26
- package/themes/original/src/components/LottieAnimation/index.tsx +89 -55
- package/themes/original/src/components/MessageListing/index.tsx +16 -42
- package/themes/original/src/components/Messages/index.tsx +32 -10
- package/themes/original/src/components/MomentOption/index.tsx +195 -88
- package/themes/original/src/components/MultiCart/index.tsx +50 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +151 -49
- package/themes/original/src/components/MultiCheckout/index.tsx +308 -88
- package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +68 -21
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +77 -52
- package/themes/original/src/components/NavBar/index.tsx +18 -18
- package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
- package/themes/original/src/components/Notifications/index.tsx +46 -50
- package/themes/original/src/components/Notifications/styles.tsx +6 -3
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +15 -3
- package/themes/original/src/components/OrderDetails/index.tsx +190 -358
- package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
- package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
- package/themes/original/src/components/OrderProgress/index.tsx +93 -114
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +85 -57
- package/themes/original/src/components/OrderTypeSelector/index.tsx +1 -1
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +24 -19
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
- package/themes/original/src/components/OrdersOption/index.tsx +76 -66
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PageBanner/index.tsx +171 -0
- package/themes/original/src/components/PageBanner/styles.tsx +11 -0
- package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +64 -7
- package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
- package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
- package/themes/original/src/components/ProductForm/index.tsx +114 -36
- package/themes/original/src/components/ProductForm/styles.tsx +5 -7
- package/themes/original/src/components/ProductItemAccordion/index.tsx +17 -14
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +24 -14
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +3 -4
- package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
- package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
- package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
- package/themes/original/src/components/Promotions/index.tsx +234 -220
- package/themes/original/src/components/Promotions/styles.tsx +10 -3
- package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
- package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
- package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
- package/themes/original/src/components/ReviewProducts/index.tsx +23 -11
- package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
- package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
- package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
- package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
- package/themes/original/src/components/ServiceForm/index.tsx +66 -17
- package/themes/original/src/components/Sessions/index.tsx +11 -8
- package/themes/original/src/components/Sessions/styles.tsx +5 -0
- package/themes/original/src/components/SignupForm/index.tsx +43 -20
- package/themes/original/src/components/SingleOrderCard/index.tsx +130 -52
- package/themes/original/src/components/SingleOrderCard/styles.tsx +11 -2
- package/themes/original/src/components/SingleProductCard/index.tsx +72 -34
- package/themes/original/src/components/SingleProductCard/styles.tsx +22 -4
- package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
- package/themes/original/src/components/StripeCardsList/index.tsx +13 -3
- package/themes/original/src/components/StripeElementsForm/index.tsx +67 -34
- package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
- package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
- package/themes/original/src/components/UserDetails/index.tsx +8 -4
- package/themes/original/src/components/UserFormDetails/index.tsx +76 -7
- package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
- package/themes/original/src/components/UserProfile/index.tsx +12 -29
- package/themes/original/src/components/UserProfileForm/index.tsx +27 -29
- package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
- package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
- package/themes/original/src/components/Wallets/index.tsx +67 -24
- package/themes/original/src/components/Wallets/styles.tsx +3 -4
- package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
- package/themes/original/src/components/shared/OButton.tsx +6 -2
- package/themes/original/src/components/shared/OInput.tsx +16 -2
- package/themes/original/src/components/shared/OModal.tsx +3 -3
- package/themes/original/src/layouts/Container.tsx +1 -1
- package/themes/original/src/types/index.tsx +40 -11
- package/themes/original/src/utils/index.tsx +375 -58
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { Platform, StyleSheet, TouchableOpacity } from 'react-native';
|
|
2
|
+
import { Platform, StyleSheet, TouchableOpacity, ScrollView } from 'react-native';
|
|
3
3
|
import { useSession, useLanguage, ToastType, useToast, useConfig } from 'ordering-components/native';
|
|
4
4
|
import { useTheme } from 'styled-components/native';
|
|
5
5
|
import { useForm, Controller } from 'react-hook-form';
|
|
6
|
+
import { SignupForm } from '../SignupForm'
|
|
6
7
|
|
|
7
8
|
import { UDForm, UDLoader, UDWrapper, WrapperPhone } from './styles';
|
|
8
9
|
|
|
9
|
-
import { OText, OButton, OInput } from '../shared';
|
|
10
|
+
import { OText, OButton, OInput, OModal, OIcon } from '../shared';
|
|
11
|
+
import { OAlert } from '../../../../../src/components/shared'
|
|
10
12
|
|
|
11
13
|
import { PhoneInputNumber } from '../PhoneInputNumber';
|
|
12
14
|
import { sortInputFields } from '../../utils';
|
|
15
|
+
import { ListItem } from '../UserProfile/styles';
|
|
13
16
|
|
|
14
17
|
export const UserFormDetailsUI = (props: any) => {
|
|
15
18
|
const {
|
|
@@ -27,6 +30,11 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
27
30
|
phoneUpdate,
|
|
28
31
|
hideUpdateButton,
|
|
29
32
|
setWillVerifyOtpState,
|
|
33
|
+
handlePlaceOrderAsGuest,
|
|
34
|
+
isCheckout,
|
|
35
|
+
setIsOpen,
|
|
36
|
+
handleRemoveAccount,
|
|
37
|
+
isProfile
|
|
30
38
|
} = props;
|
|
31
39
|
|
|
32
40
|
const theme = useTheme();
|
|
@@ -68,10 +76,11 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
68
76
|
const [, { showToast }] = useToast();
|
|
69
77
|
const { handleSubmit, control, errors, setValue } = useForm();
|
|
70
78
|
|
|
71
|
-
const [{ user }] = useSession();
|
|
79
|
+
const [{ user }, { login }] = useSession();
|
|
72
80
|
const [userPhoneNumber, setUserPhoneNumber] = useState<any>(null);
|
|
73
81
|
const [isValid, setIsValid] = useState(false)
|
|
74
82
|
const [isChanged, setIsChanged] = useState(false)
|
|
83
|
+
const [isModalOpen, setIsModalOpen] = useState(false)
|
|
75
84
|
const [phoneInputData, setPhoneInputData] = useState({
|
|
76
85
|
error: '',
|
|
77
86
|
phone: {
|
|
@@ -79,9 +88,19 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
79
88
|
cellphone: null,
|
|
80
89
|
},
|
|
81
90
|
});
|
|
91
|
+
const [confirm, setConfirm] = useState<any>({ open: false, content: null, handleOnAccept: null, id: null, title: null })
|
|
82
92
|
|
|
93
|
+
const isAdmin = user?.level === 0
|
|
83
94
|
const showInputPhoneNumber = (validationFields?.fields?.checkout?.cellphone?.enabled ?? false) || configs?.verification_phone_required?.value === '1'
|
|
84
95
|
|
|
96
|
+
const handleSuccessSignup = (user: any) => {
|
|
97
|
+
login({
|
|
98
|
+
user,
|
|
99
|
+
token: user?.session?.access_token
|
|
100
|
+
})
|
|
101
|
+
handlePlaceOrderAsGuest && handlePlaceOrderAsGuest()
|
|
102
|
+
}
|
|
103
|
+
|
|
85
104
|
const getInputRules = (field: any) => {
|
|
86
105
|
const rules: any = {
|
|
87
106
|
required: isRequiredField(field.code)
|
|
@@ -187,6 +206,18 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
187
206
|
handleChangeInput(countryCode, true);
|
|
188
207
|
}
|
|
189
208
|
|
|
209
|
+
const onRemoveAccount = () => {
|
|
210
|
+
setConfirm({
|
|
211
|
+
open: true,
|
|
212
|
+
content: [t('QUESTION_REMOVE_ACCOUNT', 'Are you sure that you want to remove your account?')],
|
|
213
|
+
title: t('ACCOUNT_ALERT', 'Account alert'),
|
|
214
|
+
handleOnAccept: () => {
|
|
215
|
+
setConfirm({ ...confirm, open: false })
|
|
216
|
+
handleRemoveAccount && handleRemoveAccount(user?.id)
|
|
217
|
+
}
|
|
218
|
+
})
|
|
219
|
+
}
|
|
220
|
+
|
|
190
221
|
useEffect(() => {
|
|
191
222
|
if (Object.keys(errors).length > 0) {
|
|
192
223
|
const list = Object.values(errors);
|
|
@@ -206,6 +237,10 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
206
237
|
if (!formState?.loading && formState?.result?.error) {
|
|
207
238
|
formState.result?.result &&
|
|
208
239
|
showToast(ToastType.Error, formState.result?.result[0]);
|
|
240
|
+
if (isCheckout) {
|
|
241
|
+
setIsOpen && setIsOpen(false)
|
|
242
|
+
cleanFormState && cleanFormState({ changes: {} })
|
|
243
|
+
}
|
|
209
244
|
}
|
|
210
245
|
}, [formState?.loading]);
|
|
211
246
|
|
|
@@ -389,6 +424,12 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
389
424
|
)}
|
|
390
425
|
</UDWrapper>
|
|
391
426
|
)}
|
|
427
|
+
{isProfile && (
|
|
428
|
+
<ListItem disabled={isAdmin} onPress={() => onRemoveAccount()} activeOpacity={0.7}>
|
|
429
|
+
<OIcon src={theme.images.general.user} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
|
|
430
|
+
<OText size={14} lineHeight={24} weight={'400'} style={{ opacity: isAdmin ? 0.5 : 1 }} color={theme.colors.danger5}>{t('REMOVE_ACCOUNT', 'Remove account')}</OText>
|
|
431
|
+
</ListItem>
|
|
432
|
+
)}
|
|
392
433
|
{validationFields?.loading && (
|
|
393
434
|
<UDLoader>
|
|
394
435
|
<OText size={12}>{t('LOADING', 'Loading')}</OText>
|
|
@@ -423,18 +464,46 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
423
464
|
text={
|
|
424
465
|
formState.loading
|
|
425
466
|
? t('UPDATING', 'Updating...')
|
|
426
|
-
:
|
|
467
|
+
: ((isCheckout && !!user?.guest_id)
|
|
468
|
+
? t('SIGN_UP_AND_PLACE_ORDER', 'Sign up and place order')
|
|
469
|
+
: t('CONTINUE', 'Continue'))
|
|
427
470
|
}
|
|
428
471
|
bgColor={theme.colors.white}
|
|
429
472
|
textStyle={{ color: theme.colors.primary, fontSize: 14 }}
|
|
430
473
|
borderColor={theme.colors.primary}
|
|
431
|
-
isDisabled={formState.loading || !isValid}
|
|
474
|
+
isDisabled={!user?.guest_id && (formState.loading || !isValid)}
|
|
432
475
|
imgRightSrc={null}
|
|
433
476
|
style={{ borderRadius: 7.6, shadowOpacity: 0, width: '100%', borderWidth: 1, marginTop: 20, marginBottom: 20 }}
|
|
434
|
-
onClick={handleSubmit(onSubmit)}
|
|
477
|
+
onClick={!user?.guest_id ? handleSubmit(onSubmit) : () => setIsModalOpen(true)}
|
|
435
478
|
/>
|
|
436
479
|
)}
|
|
480
|
+
{isCheckout && !!user?.guest_id && (
|
|
481
|
+
<TouchableOpacity style={{ marginTop: 10 }} onPress={() => handlePlaceOrderAsGuest()}>
|
|
482
|
+
<OText color={theme.colors.primary} style={{ textAlign: 'center' }}>{t('PLACE_ORDER_AS_GUEST', 'Place order as guest')}</OText>
|
|
483
|
+
</TouchableOpacity>
|
|
484
|
+
)}
|
|
485
|
+
<OModal
|
|
486
|
+
open={isModalOpen}
|
|
487
|
+
onClose={() => setIsModalOpen(false)}
|
|
488
|
+
>
|
|
489
|
+
<ScrollView style={{ paddingHorizontal: 20, width: '100%' }}>
|
|
490
|
+
<SignupForm
|
|
491
|
+
handleSuccessSignup={handleSuccessSignup}
|
|
492
|
+
isGuest
|
|
493
|
+
signupButtonText={t('SIGNUP', 'Signup')}
|
|
494
|
+
useSignupByEmail
|
|
495
|
+
useChekoutFileds
|
|
496
|
+
/>
|
|
497
|
+
</ScrollView>
|
|
498
|
+
</OModal>
|
|
499
|
+
<OAlert
|
|
500
|
+
open={confirm.open}
|
|
501
|
+
title={confirm.title}
|
|
502
|
+
content={confirm.content}
|
|
503
|
+
onAccept={confirm.handleOnAccept}
|
|
504
|
+
onCancel={() => setConfirm({ ...confirm, open: false, title: null })}
|
|
505
|
+
onClose={() => setConfirm({ ...confirm, open: false, title: null })}
|
|
506
|
+
/>
|
|
437
507
|
</>
|
|
438
508
|
);
|
|
439
509
|
};
|
|
440
|
-
|
|
@@ -35,7 +35,6 @@ import {
|
|
|
35
35
|
} from './styles';
|
|
36
36
|
import { useWindowDimensions } from 'react-native';
|
|
37
37
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
38
|
-
import styled from 'styled-components';
|
|
39
38
|
import ToggleSwitch from 'toggle-switch-react-native';
|
|
40
39
|
|
|
41
40
|
const ProfileListUI = (props: ProfileParams) => {
|
|
@@ -49,6 +48,9 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
49
48
|
|
|
50
49
|
const theme = useTheme();
|
|
51
50
|
|
|
51
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
52
|
+
const showLanguages = theme?.profile?.components?.languages?.hidden
|
|
53
|
+
|
|
52
54
|
const langPickerStyle = StyleSheet.create({
|
|
53
55
|
inputAndroid: {
|
|
54
56
|
color: theme.colors.textNormal,
|
|
@@ -89,8 +91,7 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
89
91
|
marginEnd: 14
|
|
90
92
|
},
|
|
91
93
|
pagePadding: {
|
|
92
|
-
|
|
93
|
-
paddingRight: 40
|
|
94
|
+
paddingHorizontal: isChewLayout ? 20 : 40
|
|
94
95
|
},
|
|
95
96
|
messageIconStyle: {
|
|
96
97
|
fontSize: 18,
|
|
@@ -106,8 +107,6 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
106
107
|
const [, { showToast }] = useToast();
|
|
107
108
|
const { errors } = useForm();
|
|
108
109
|
|
|
109
|
-
const isAdmin = user?.level === 0
|
|
110
|
-
|
|
111
110
|
const { height } = useWindowDimensions();
|
|
112
111
|
const { top, bottom } = useSafeAreaInsets();
|
|
113
112
|
|
|
@@ -141,19 +140,8 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
141
140
|
|
|
142
141
|
const detailProps = {
|
|
143
142
|
goToBack: () => props.navigation?.canGoBack() && props.navigation.goBack(),
|
|
144
|
-
onNavigationRedirect: (route: string, params: any) => props.navigation.navigate(route, params)
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
const onRemoveAccount = () => {
|
|
148
|
-
setConfirm({
|
|
149
|
-
open: true,
|
|
150
|
-
content: [t('QUESTION_REMOVE_ACCOUNT', 'Are you sure that you want to remove your account?')],
|
|
151
|
-
title: t('ACCOUNT_ALERT', 'Account alert'),
|
|
152
|
-
handleOnAccept: () => {
|
|
153
|
-
setConfirm({ ...confirm, open: false })
|
|
154
|
-
handleRemoveAccount && handleRemoveAccount(user?.id)
|
|
155
|
-
}
|
|
156
|
-
})
|
|
143
|
+
onNavigationRedirect: (route: string, params: any) => props.navigation.navigate(route, params),
|
|
144
|
+
handleRemoveAccount
|
|
157
145
|
}
|
|
158
146
|
|
|
159
147
|
useEffect(() => {
|
|
@@ -163,10 +151,7 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
163
151
|
}, [removeAccountState])
|
|
164
152
|
|
|
165
153
|
return (
|
|
166
|
-
<View style={{ flex: 1, height:
|
|
167
|
-
{/* <OText size={24} style={{ marginTop: 15, paddingHorizontal: 40 }}>
|
|
168
|
-
{t('PROFILE', 'Profile')}
|
|
169
|
-
</OText> */}
|
|
154
|
+
<View style={{ flex: 1, height: '100%', paddingTop: 20 }}>
|
|
170
155
|
<CenterView style={styles.pagePadding}>
|
|
171
156
|
{user?.photo && (
|
|
172
157
|
<View style={styles.photo}>
|
|
@@ -183,7 +168,7 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
183
168
|
<View style={{ flexBasis: '70%' }}>
|
|
184
169
|
<OText size={20} lineHeight={30} weight={Platform.OS === 'ios' ? '500' : 'bold'} color={theme.colors.textNormal}>{user?.name} {user?.lastname}</OText>
|
|
185
170
|
<TouchableOpacity onPress={() => navigation.navigate('ProfileForm', { ...detailProps })}>
|
|
186
|
-
<OText size={12} lineHeight={18} color={theme.colors.
|
|
171
|
+
<OText size={12} lineHeight={18} color={theme.colors.primary} style={{ textDecorationLine: 'underline' }}>{t('VIEW_ACCOUNT', 'View account')}</OText>
|
|
187
172
|
</TouchableOpacity>
|
|
188
173
|
</View>
|
|
189
174
|
</CenterView>
|
|
@@ -250,15 +235,13 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
250
235
|
</ListItem>
|
|
251
236
|
</Actions>
|
|
252
237
|
|
|
253
|
-
|
|
254
|
-
|
|
238
|
+
<Actions style={{ paddingTop: height * .02 }}>
|
|
239
|
+
{!showLanguages && (
|
|
240
|
+
<LanguageSelector iconColor={theme.colors.textNormal} pickerStyle={langPickerStyle} />
|
|
241
|
+
)}
|
|
255
242
|
<View style={{ height: 17 }} />
|
|
256
243
|
<LogoutButton color={theme.colors.textNormal} text={t('LOGOUT', 'Logout')} />
|
|
257
244
|
<View style={{ height: 17 }} />
|
|
258
|
-
<ListItem disabled={isAdmin} onPress={() => onRemoveAccount()} activeOpacity={0.7}>
|
|
259
|
-
<OIcon src={theme.images.general.user} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
|
|
260
|
-
<OText size={14} lineHeight={24} weight={'400'} style={{ opacity: isAdmin ? 0.5 : 1 }} color={theme.colors.danger5}>{t('REMOVE_ACCOUNT', 'Remove account')}</OText>
|
|
261
|
-
</ListItem>
|
|
262
245
|
</Actions>
|
|
263
246
|
</ListWrap>
|
|
264
247
|
<OAlert
|
|
@@ -16,9 +16,8 @@ import { ProfileParams } from '../../types';
|
|
|
16
16
|
import { UserFormDetailsUI } from '../UserFormDetails';
|
|
17
17
|
|
|
18
18
|
import { OIcon, OIconButton, OModal } from '../shared';
|
|
19
|
-
import { CenterView } from './styles';
|
|
19
|
+
import { CenterView, Container } from './styles';
|
|
20
20
|
import NavBar from '../NavBar';
|
|
21
|
-
import { Container } from '../../layouts/Container';
|
|
22
21
|
import { VerifyPhone } from '../VerifyPhone'
|
|
23
22
|
import Ionicons from 'react-native-vector-icons/Ionicons'
|
|
24
23
|
import FastImage from 'react-native-fast-image'
|
|
@@ -51,11 +50,6 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
51
50
|
shadowOpacity: 0.2,
|
|
52
51
|
backgroundColor: theme.colors.white,
|
|
53
52
|
},
|
|
54
|
-
pagePadding: {
|
|
55
|
-
paddingLeft: 40,
|
|
56
|
-
paddingRight: 40,
|
|
57
|
-
justifyContent: 'center',
|
|
58
|
-
},
|
|
59
53
|
navBarStyle: {
|
|
60
54
|
paddingLeft: 40,
|
|
61
55
|
paddingRight: 40,
|
|
@@ -284,21 +278,26 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
284
278
|
|
|
285
279
|
return (
|
|
286
280
|
<>
|
|
287
|
-
<
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
281
|
+
<Container
|
|
282
|
+
pdng={Platform.OS === 'ios' ? '20px' : '10px'}
|
|
283
|
+
>
|
|
284
|
+
<NavBar
|
|
285
|
+
title={t('ACCOUNT', 'Account')}
|
|
286
|
+
titleAlign={'center'}
|
|
287
|
+
onActionLeft={() => navigation.goBack()}
|
|
288
|
+
showCall={false}
|
|
289
|
+
btnStyle={{ paddingLeft: 0 }}
|
|
290
|
+
/>
|
|
291
|
+
<KeyboardAvoidingView
|
|
292
|
+
behavior={Platform.OS == 'ios' ? 'padding' : 'height'}
|
|
293
|
+
enabled={Platform.OS === 'ios' ? true : false}
|
|
294
|
+
style={{ flex: 1, flexDirection: 'column', justifyContent: 'center' }}
|
|
295
|
+
>
|
|
296
|
+
<CenterView>
|
|
298
297
|
<View style={styles.photo}>
|
|
299
298
|
{user?.photo ? (
|
|
300
299
|
<FastImage
|
|
301
|
-
style={{ height:
|
|
300
|
+
style={{ height: 80, width: 80, borderRadius: 8 }}
|
|
302
301
|
source={{
|
|
303
302
|
uri: user?.photo,
|
|
304
303
|
priority: FastImage.priority.normal,
|
|
@@ -317,17 +316,16 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
317
316
|
onClick={() => handleImagePicker()}
|
|
318
317
|
/>
|
|
319
318
|
</CenterView>
|
|
320
|
-
<View style={{ height: 8,
|
|
319
|
+
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginVertical: 32, zIndex: 10 }} />
|
|
321
320
|
<Spinner visible={formState?.loading || verifyPhoneState?.loading} />
|
|
322
|
-
<
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
</KeyboardAvoidingView>
|
|
321
|
+
<UserFormDetailsUI
|
|
322
|
+
{...props}
|
|
323
|
+
isProfile
|
|
324
|
+
isEdit
|
|
325
|
+
setWillVerifyOtpState={setWillVerifyOtpState}
|
|
326
|
+
/>
|
|
327
|
+
</KeyboardAvoidingView>
|
|
328
|
+
</Container>
|
|
331
329
|
<OModal
|
|
332
330
|
open={isModalVisible}
|
|
333
331
|
onClose={() => setIsModalVisible(false)}
|
|
@@ -9,6 +9,13 @@ export const UserData = styled.View`
|
|
|
9
9
|
text-align: center;
|
|
10
10
|
`
|
|
11
11
|
|
|
12
|
+
export const Container = styled.ScrollView`
|
|
13
|
+
position: relative;
|
|
14
|
+
flex: 1;
|
|
15
|
+
padding-top: ${(props: any) => props.pdng};
|
|
16
|
+
margin-bottom: 40px;
|
|
17
|
+
`
|
|
18
|
+
|
|
12
19
|
export const Names = styled.View`
|
|
13
20
|
flex-direction: row;
|
|
14
21
|
`
|
|
@@ -54,7 +54,7 @@ export const WalletTransactionItem = (props: any) => {
|
|
|
54
54
|
<OText>{item?.description}</OText>
|
|
55
55
|
</DescriptionBlock>
|
|
56
56
|
)}
|
|
57
|
-
{!!item?.code && (
|
|
57
|
+
{/* {!!item?.code && (
|
|
58
58
|
<DescriptionBlock>
|
|
59
59
|
<OText weight={'bold'}>
|
|
60
60
|
{t('CODE', 'Code')}
|
|
@@ -63,7 +63,7 @@ export const WalletTransactionItem = (props: any) => {
|
|
|
63
63
|
</OText>
|
|
64
64
|
</OText>
|
|
65
65
|
</DescriptionBlock>
|
|
66
|
-
)}
|
|
66
|
+
)} */}
|
|
67
67
|
</Container>
|
|
68
68
|
)
|
|
69
69
|
}
|
|
@@ -63,12 +63,12 @@ export const WalletTransactions = (props: any) => {
|
|
|
63
63
|
(transactionsList?.error ||
|
|
64
64
|
!transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.length) &&
|
|
65
65
|
(
|
|
66
|
-
<
|
|
67
|
-
|
|
66
|
+
<OText color={theme.colors.disabled} size={16} style={{ textAlign: 'center' }}>
|
|
67
|
+
{transactionsList?.error
|
|
68
68
|
? t('ERROR_NOT_FOUND_TRANSACTIONS', 'Sorry, an error has occurred')
|
|
69
69
|
: t('NOT_FOUND_TRANSACTIONS', 'No transactions to show at this time.')
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
</OText>
|
|
72
72
|
)}
|
|
73
73
|
</View>
|
|
74
74
|
</Container>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import { Pressable, StyleSheet, View, ScrollView, TouchableOpacity } from 'react-native';
|
|
2
|
+
import { Pressable, StyleSheet, View, ScrollView, TouchableOpacity, Platform } from 'react-native';
|
|
3
3
|
import { useTheme } from 'styled-components/native'
|
|
4
4
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
5
5
|
import FastImage from 'react-native-fast-image'
|
|
6
|
+
import NavBar from '../NavBar'
|
|
6
7
|
import {
|
|
7
8
|
WalletList,
|
|
8
9
|
useLanguage,
|
|
@@ -27,6 +28,7 @@ import {
|
|
|
27
28
|
import { OButton, OIcon, OText, OModal } from '../shared';
|
|
28
29
|
import { NotFoundSource } from '../NotFoundSource';
|
|
29
30
|
import { WalletTransactions } from '../WalletTransactions'
|
|
31
|
+
import { GiftCardUI } from '../GiftCard/GiftCardUI'
|
|
30
32
|
|
|
31
33
|
const WalletsUI = (props: any) => {
|
|
32
34
|
const {
|
|
@@ -47,6 +49,7 @@ const WalletsUI = (props: any) => {
|
|
|
47
49
|
const [{ parsePrice }] = useUtils()
|
|
48
50
|
const [{ configs }] = useConfig()
|
|
49
51
|
|
|
52
|
+
|
|
50
53
|
const styles = StyleSheet.create({
|
|
51
54
|
logoStyle: {
|
|
52
55
|
width: 120,
|
|
@@ -57,12 +60,20 @@ const WalletsUI = (props: any) => {
|
|
|
57
60
|
flexDirection: 'column',
|
|
58
61
|
justifyContent: 'center',
|
|
59
62
|
alignItems: 'center',
|
|
63
|
+
},
|
|
64
|
+
dividerStyle: {
|
|
65
|
+
height: 8,
|
|
66
|
+
backgroundColor: theme.colors.backgroundGray100,
|
|
67
|
+
marginVertical: 25,
|
|
68
|
+
marginHorizontal: -40,
|
|
69
|
+
width: '100%'
|
|
60
70
|
}
|
|
61
71
|
});
|
|
62
72
|
|
|
63
73
|
const [tabSelected, setTabSelected] = useState(isWalletCashEnabled ? 'cash' : 'credit_point')
|
|
64
74
|
const [openHistory, setOpenHistory] = useState(false)
|
|
65
|
-
const isChewLayout = theme?.
|
|
75
|
+
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
76
|
+
const hideWalletsTheme = theme?.bar_menu?.components?.wallets?.hidden
|
|
66
77
|
|
|
67
78
|
const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletPointsEnabled)
|
|
68
79
|
|
|
@@ -109,20 +120,41 @@ const WalletsUI = (props: any) => {
|
|
|
109
120
|
|
|
110
121
|
return (
|
|
111
122
|
<>
|
|
112
|
-
<Container
|
|
123
|
+
<Container
|
|
124
|
+
pdng={Platform.OS === 'ios' ? '10px' : '0'}
|
|
125
|
+
>
|
|
113
126
|
<Header>
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
127
|
+
<View style={{
|
|
128
|
+
...{
|
|
129
|
+
width: '100%',
|
|
130
|
+
display: 'flex',
|
|
131
|
+
flexDirection: hideWalletsTheme ? 'column' : 'row',
|
|
132
|
+
justifyContent: hideWalletsTheme ? 'flex-start' : 'space-between',
|
|
133
|
+
alignItems: hideWalletsTheme ? 'flex-start' : 'center',
|
|
134
|
+
marginTop: hideWalletsTheme ? 0 : 10,
|
|
135
|
+
},
|
|
136
|
+
}}>
|
|
137
|
+
<NavBar
|
|
138
|
+
title={t('WALLETS', 'Wallets')}
|
|
139
|
+
titleAlign={'center'}
|
|
140
|
+
onActionLeft={goToBack}
|
|
141
|
+
showCall={false}
|
|
142
|
+
paddingTop={10}
|
|
143
|
+
btnStyle={{ paddingLeft: 0 }}
|
|
144
|
+
hideArrowLeft={!hideWalletsTheme}
|
|
124
145
|
/>
|
|
125
|
-
|
|
146
|
+
{isChewLayout && (
|
|
147
|
+
<OButton
|
|
148
|
+
text={t('WALLET_HISTORY', 'Wallet history')}
|
|
149
|
+
bgColor={theme.colors.white}
|
|
150
|
+
borderColor={theme.colors.lightGray}
|
|
151
|
+
imgRightSrc={null}
|
|
152
|
+
textStyle={{ fontSize: 12, color: theme.colors.disabled }}
|
|
153
|
+
onClick={() => setOpenHistory(true)}
|
|
154
|
+
style={{ borderRadius: 8, height: 40, width: hideWalletsTheme ? '100%' : 150, marginTop: hideWalletsTheme ? 10 : 0 }}
|
|
155
|
+
/>
|
|
156
|
+
)}
|
|
157
|
+
</View>
|
|
126
158
|
</Header>
|
|
127
159
|
|
|
128
160
|
{!walletList.loading &&
|
|
@@ -146,8 +178,8 @@ const WalletsUI = (props: any) => {
|
|
|
146
178
|
borderBottomWidth: 1,
|
|
147
179
|
borderBottomColor:
|
|
148
180
|
tabSelected === wallet.type
|
|
149
|
-
|
|
150
|
-
|
|
181
|
+
? theme.colors.textNormal
|
|
182
|
+
: theme.colors.border
|
|
151
183
|
}}
|
|
152
184
|
>
|
|
153
185
|
<OText>
|
|
@@ -163,9 +195,9 @@ const WalletsUI = (props: any) => {
|
|
|
163
195
|
<LoyaltyContent>
|
|
164
196
|
<LoyaltyWrapp>
|
|
165
197
|
<OText size={20}>
|
|
166
|
-
{`${t('LOYALTY_LEVEL_TITLE', 'Your level is')}
|
|
198
|
+
{`${t('LOYALTY_LEVEL_TITLE', 'Your level is')}`}
|
|
167
199
|
</OText>
|
|
168
|
-
{
|
|
200
|
+
{loyaltyLevel.image ? (
|
|
169
201
|
<FastImage
|
|
170
202
|
style={styles.logoStyle}
|
|
171
203
|
source={{
|
|
@@ -180,7 +212,7 @@ const WalletsUI = (props: any) => {
|
|
|
180
212
|
source={theme.images.dummies.loyaltyLevel}
|
|
181
213
|
resizeMode='contain'
|
|
182
214
|
/>
|
|
183
|
-
)}
|
|
215
|
+
)}
|
|
184
216
|
<OText
|
|
185
217
|
size={22}
|
|
186
218
|
weight='bold'
|
|
@@ -206,6 +238,14 @@ const WalletsUI = (props: any) => {
|
|
|
206
238
|
</OText>
|
|
207
239
|
</BalanceElement>
|
|
208
240
|
|
|
241
|
+
{/* {currentWalletSelected?.type === 'cash' && (
|
|
242
|
+
<>
|
|
243
|
+
<View style={styles.dividerStyle} />
|
|
244
|
+
<GiftCardUI navigation={navigation} />
|
|
245
|
+
<View style={styles.dividerStyle} />
|
|
246
|
+
</>
|
|
247
|
+
)} */}
|
|
248
|
+
|
|
209
249
|
{!isChewLayout && (
|
|
210
250
|
<WalletTransactions
|
|
211
251
|
transactionsList={transactionsList}
|
|
@@ -259,15 +299,18 @@ const WalletsUI = (props: any) => {
|
|
|
259
299
|
<ScrollView>
|
|
260
300
|
<WalletTransactionsWrapper>
|
|
261
301
|
<OButton
|
|
302
|
+
imgLeftStyle={{ width: 18 }}
|
|
262
303
|
imgRightSrc={null}
|
|
263
304
|
style={{
|
|
264
305
|
borderWidth: 0,
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
306
|
+
width: 26,
|
|
307
|
+
height: 26,
|
|
308
|
+
backgroundColor: '#FFF',
|
|
309
|
+
borderColor: '#FFF',
|
|
310
|
+
shadowColor: '#FFF',
|
|
269
311
|
paddingLeft: 0,
|
|
270
|
-
paddingRight: 0
|
|
312
|
+
paddingRight: 0,
|
|
313
|
+
marginBottom: 10
|
|
271
314
|
}}
|
|
272
315
|
onClick={() => setOpenHistory(false)}
|
|
273
316
|
icon={AntDesignIcon}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import styled from 'styled-components/native'
|
|
2
2
|
|
|
3
3
|
export const Container = styled.View`
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
padding-horizontal: 20px;
|
|
5
|
+
padding-bottom: 20px;
|
|
6
|
+
padding-top: ${(props: any) => props.pdng};
|
|
6
7
|
`
|
|
7
8
|
export const Header = styled.View`
|
|
8
9
|
flex-direction: row;
|
|
9
|
-
align-items: center;
|
|
10
|
-
justify-content: space-between;
|
|
11
10
|
`
|
|
12
11
|
export const SectionContent = styled.View`
|
|
13
12
|
width: 100%;
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Platform } from 'react-native';
|
|
3
3
|
import OText from './OText';
|
|
4
|
+
import { useTheme } from 'styled-components/native'
|
|
4
5
|
|
|
5
6
|
const HeaderTitle = (props: any) => {
|
|
6
7
|
const { text, style } = props
|
|
8
|
+
const theme = useTheme();
|
|
9
|
+
|
|
7
10
|
return (
|
|
8
11
|
<OText
|
|
9
|
-
size={
|
|
12
|
+
size={20}
|
|
13
|
+
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
10
14
|
style={style ?? {
|
|
11
15
|
marginTop: Platform.OS === 'android' ? 50 : 30,
|
|
12
|
-
paddingHorizontal: 40,
|
|
13
|
-
textTransform: 'capitalize'
|
|
16
|
+
paddingHorizontal: props.ph ?? 40,
|
|
17
|
+
textTransform: 'capitalize',
|
|
18
|
+
color: props.titleColor || theme.colors.textNormal,
|
|
14
19
|
}}
|
|
15
20
|
>
|
|
16
21
|
{text}
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
import * as React from 'react';
|
|
13
13
|
import styled, { useTheme } from 'styled-components/native';
|
|
14
14
|
import { OIcon } from './';
|
|
15
|
+
import { css } from 'styled-components';
|
|
15
16
|
|
|
16
17
|
const StyledButton = styled.View<Props>`
|
|
17
18
|
background-color: ${(props: any) => props.theme.colors.primary};
|
|
@@ -26,6 +27,9 @@ const StyledButton = styled.View<Props>`
|
|
|
26
27
|
padding-left: 20px;
|
|
27
28
|
padding-right: 20px;
|
|
28
29
|
position: relative;
|
|
30
|
+
${(props: any) => props?.theme?.general?.components?.buttons?.borderRadius && css`
|
|
31
|
+
border-radius: ${props?.theme?.general?.components?.buttons?.borderRadius}px;
|
|
32
|
+
`}
|
|
29
33
|
`
|
|
30
34
|
const StyledButtonDisabled = styled(StyledButton)`
|
|
31
35
|
background-color: ${(props: any) => props.theme.colors.disabled};
|
|
@@ -115,12 +119,12 @@ const OButton = (props: Props): React.ReactElement => {
|
|
|
115
119
|
style={{ width: props.isCircle ? 52 : props.style?.width, ...props.parentStyle }}
|
|
116
120
|
disabled={props.isDisabledWithSameStyles}
|
|
117
121
|
>
|
|
118
|
-
<StyledButton style={props.bgColor ? { ...props.style, backgroundColor: props.bgColor, borderColor: props.borderColor } : props.style}>
|
|
122
|
+
<StyledButton style={props.bgColor ? { ...props.style, backgroundColor: props.bgColor, borderColor: props.borderColor, borderRadius: parseInt(theme?.general?.components?.buttons?.borderRadius) || props.style?.borderRadius } : { ...props.style, borderRadius: parseInt(theme?.general?.components?.buttons?.borderRadius) || props.style?.borderRadius }}>
|
|
119
123
|
{props.icon ? (
|
|
120
124
|
<props.icon {...props.iconProps} />
|
|
121
125
|
) : null}
|
|
122
126
|
{props.imgLeftSrc ? (
|
|
123
|
-
<OIcon style={props.imgLeftStyle} src={props.imgLeftSrc} />
|
|
127
|
+
<OIcon style={props.imgLeftStyle} src={props.imgLeftSrc} color={theme.colors.textNormal} />
|
|
124
128
|
) : null}
|
|
125
129
|
{props.text ? (
|
|
126
130
|
<StyledText style={props.textStyle}>{props.text}</StyledText>
|