ordering-ui-react-native 0.16.68 → 0.16.69-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 +6 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/ActiveOrders/index.tsx +61 -63
- package/src/components/ActiveOrders/styles.tsx +8 -14
- package/src/components/BusinessInformation/index.tsx +19 -4
- package/src/components/BusinessInformation/styles.tsx +2 -2
- package/src/components/BusinessProductsList/index.tsx +10 -10
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +2 -1
- package/src/components/LanguageSelector/index.tsx +21 -16
- package/src/components/Messages/index.tsx +2 -2
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptions/index.tsx +298 -345
- package/src/components/PaymentOptionsWebView/index.tsx +119 -120
- package/src/components/SingleProductReview/index.tsx +7 -4
- package/src/components/StripeElementsForm/index.tsx +25 -16
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +4 -4
- package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
- package/src/utils/index.tsx +2 -1
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +260 -238
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
- package/themes/business/src/components/BusinessController/index.tsx +2 -2
- package/themes/business/src/components/Chat/index.tsx +31 -31
- package/themes/business/src/components/DriverMap/index.tsx +7 -5
- package/themes/business/src/components/LoginForm/index.tsx +111 -74
- package/themes/business/src/components/MapView/index.tsx +14 -3
- package/themes/business/src/components/MessagesOption/index.tsx +11 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +70 -43
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
- package/themes/business/src/components/OrdersOption/index.tsx +63 -73
- package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
- package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
- package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
- package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
- 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 +440 -245
- package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
- package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
- package/themes/business/src/components/shared/ODropDown.tsx +42 -8
- package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
- package/themes/business/src/components/shared/OLink.tsx +33 -13
- package/themes/business/src/components/shared/OText.tsx +8 -2
- package/themes/business/src/types/index.tsx +14 -3
- package/themes/business/src/utils/index.tsx +10 -0
- 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/index.tsx +121 -10
- package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
- 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/ProductForm/index.tsx +1 -14
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/types/index.d.ts +2 -0
- package/themes/original/index.tsx +6 -0
- package/themes/original/src/components/AddressDetails/index.tsx +10 -8
- package/themes/original/src/components/AddressForm/index.tsx +153 -137
- package/themes/original/src/components/AddressList/index.tsx +18 -18
- package/themes/original/src/components/AddressList/styles.tsx +4 -2
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +49 -33
- package/themes/original/src/components/BusinessController/index.tsx +101 -70
- package/themes/original/src/components/BusinessController/styles.tsx +14 -9
- package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
- package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
- package/themes/original/src/components/BusinessListingSearch/index.tsx +87 -142
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
- package/themes/original/src/components/BusinessProductsList/index.tsx +41 -62
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +561 -479
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +13 -12
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +93 -98
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
- package/themes/original/src/components/BusinessesListing/index.tsx +8 -8
- package/themes/original/src/components/Cart/index.tsx +63 -38
- package/themes/original/src/components/CartContent/index.tsx +80 -18
- package/themes/original/src/components/CartContent/styles.tsx +11 -1
- package/themes/original/src/components/Checkout/index.tsx +110 -114
- package/themes/original/src/components/Checkout/styles.tsx +4 -3
- 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/DriverTips/index.tsx +47 -37
- package/themes/original/src/components/DriverTips/styles.tsx +2 -1
- package/themes/original/src/components/Favorite/index.tsx +7 -4
- package/themes/original/src/components/Favorite/styles.tsx +1 -1
- package/themes/original/src/components/FavoriteList/index.tsx +69 -45
- 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 +20 -19
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/GoogleMap/index.tsx +10 -1
- package/themes/original/src/components/Help/index.tsx +7 -7
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +14 -20
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
- package/themes/original/src/components/HelpGuide/index.tsx +12 -11
- package/themes/original/src/components/HelpGuide/styles.tsx +5 -0
- package/themes/original/src/components/HelpOrder/index.tsx +12 -20
- package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
- package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
- package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
- package/themes/original/src/components/LoginForm/index.tsx +98 -41
- package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
- package/themes/original/src/components/MessageListing/index.tsx +7 -7
- package/themes/original/src/components/Messages/index.tsx +35 -20
- package/themes/original/src/components/MomentOption/index.tsx +17 -11
- package/themes/original/src/components/MultiCart/index.tsx +50 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
- package/themes/original/src/components/MultiCheckout/index.tsx +158 -77
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +60 -33
- package/themes/original/src/components/MyOrders/index.tsx +86 -20
- package/themes/original/src/components/NavBar/index.tsx +7 -6
- package/themes/original/src/components/NetworkError/index.tsx +5 -3
- package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
- package/themes/original/src/components/Notifications/index.tsx +144 -0
- package/themes/original/src/components/Notifications/styles.tsx +20 -0
- package/themes/original/src/components/OrderDetails/index.tsx +114 -15
- package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
- package/themes/original/src/components/OrderItAgain/index.tsx +46 -43
- package/themes/original/src/components/OrderProgress/index.tsx +77 -66
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +3 -36
- package/themes/original/src/components/OrderTypeSelector/index.tsx +13 -6
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +94 -98
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
- package/themes/original/src/components/OrdersOption/index.tsx +97 -55
- 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 +1 -2
- package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
- package/themes/original/src/components/PlaceSpot/index.tsx +249 -47
- package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
- package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
- package/themes/original/src/components/ProductForm/index.tsx +212 -253
- package/themes/original/src/components/ProductForm/styles.tsx +5 -8
- package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +17 -9
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
- package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
- package/themes/original/src/components/ProfessionalProfile/index.tsx +19 -8
- package/themes/original/src/components/Promotions/index.tsx +234 -220
- package/themes/original/src/components/Promotions/styles.tsx +7 -2
- package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
- package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
- package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
- package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
- 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 +328 -264
- package/themes/original/src/components/SignupForm/index.tsx +134 -89
- package/themes/original/src/components/SingleOrderCard/index.tsx +129 -54
- package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
- package/themes/original/src/components/SingleProductCard/index.tsx +85 -82
- package/themes/original/src/components/SingleProductCard/styles.tsx +2 -9
- package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
- package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
- package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
- package/themes/original/src/components/StripeElementsForm/index.tsx +13 -2
- package/themes/original/src/components/UpsellingProducts/index.tsx +244 -215
- package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
- package/themes/original/src/components/UserDetails/index.tsx +5 -3
- package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
- package/themes/original/src/components/UserProfile/index.tsx +58 -35
- package/themes/original/src/components/UserProfile/styles.ts +17 -0
- package/themes/original/src/components/UserProfileForm/index.tsx +19 -28
- package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
- package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
- package/themes/original/src/components/Wallets/index.tsx +176 -164
- package/themes/original/src/components/Wallets/styles.tsx +12 -8
- package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
- package/themes/original/src/components/shared/OBottomPopup.tsx +6 -4
- package/themes/original/src/components/shared/OButton.tsx +9 -4
- package/themes/original/src/components/shared/OIcon.tsx +8 -1
- package/themes/original/src/components/shared/OInput.tsx +10 -1
- package/themes/original/src/layouts/Container.tsx +13 -9
- package/themes/original/src/types/index.tsx +44 -6
- package/themes/original/src/utils/index.tsx +103 -58
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -17,7 +17,7 @@ import { LanguageSelector } from '../LanguageSelector'
|
|
|
17
17
|
import MessageCircle from 'react-native-vector-icons/AntDesign'
|
|
18
18
|
import Ionicons from 'react-native-vector-icons/Ionicons'
|
|
19
19
|
import MaterialIcons from 'react-native-vector-icons/MaterialIcons'
|
|
20
|
-
import
|
|
20
|
+
import FontAwesome from 'react-native-vector-icons/FontAwesome'
|
|
21
21
|
import FastImage from 'react-native-fast-image'
|
|
22
22
|
import { OAlert } from '../../../../../src/components/shared'
|
|
23
23
|
|
|
@@ -29,21 +29,27 @@ import {
|
|
|
29
29
|
CenterView,
|
|
30
30
|
Actions,
|
|
31
31
|
ListWrap,
|
|
32
|
-
ListItem
|
|
32
|
+
ListItem,
|
|
33
|
+
NotificationsWrapper,
|
|
34
|
+
NotificationBadge
|
|
33
35
|
} from './styles';
|
|
34
36
|
import { useWindowDimensions } from 'react-native';
|
|
35
37
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
38
|
+
import styled from 'styled-components';
|
|
39
|
+
import ToggleSwitch from 'toggle-switch-react-native';
|
|
36
40
|
|
|
37
41
|
const ProfileListUI = (props: ProfileParams) => {
|
|
38
42
|
const {
|
|
39
43
|
navigation,
|
|
40
|
-
|
|
44
|
+
notificationsGroup,
|
|
41
45
|
handleRemoveAccount,
|
|
42
|
-
removeAccountState
|
|
46
|
+
removeAccountState,
|
|
47
|
+
handleChangePromotions,
|
|
43
48
|
} = props;
|
|
44
49
|
|
|
45
50
|
const theme = useTheme();
|
|
46
51
|
|
|
52
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
47
53
|
|
|
48
54
|
const langPickerStyle = StyleSheet.create({
|
|
49
55
|
inputAndroid: {
|
|
@@ -85,8 +91,7 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
85
91
|
marginEnd: 14
|
|
86
92
|
},
|
|
87
93
|
pagePadding: {
|
|
88
|
-
|
|
89
|
-
paddingRight: 40
|
|
94
|
+
paddingHorizontal: isChewLayout ? 20 : 40
|
|
90
95
|
},
|
|
91
96
|
messageIconStyle: {
|
|
92
97
|
fontSize: 18,
|
|
@@ -108,22 +113,19 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
108
113
|
const { top, bottom } = useSafeAreaInsets();
|
|
109
114
|
|
|
110
115
|
const [confirm, setConfirm] = useState<any>({ open: false, content: null, handleOnAccept: null, id: null, title: null })
|
|
111
|
-
|
|
112
|
-
const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (configs?.wallet_cash_enabled?.value === '1' || configs?.wallet_credit_point_enabled?.value === '1')
|
|
116
|
+
const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (configs?.wallet_cash_enabled?.value === '1' || configs?.wallet_credit_point_enabled?.value === '1')
|
|
113
117
|
const IsPromotionsEnabled = configs?.advanced_offers_module?.value === '1' || configs?.advanced_offers_module?.value === true
|
|
114
118
|
const onRedirect = (route: string, params?: any) => {
|
|
115
119
|
navigation.navigate(route, params)
|
|
116
120
|
}
|
|
117
121
|
|
|
118
122
|
useEffect(() => {
|
|
119
|
-
if (
|
|
120
|
-
if (
|
|
121
|
-
showToast(ToastType.Error, formState.result.result);
|
|
122
|
-
} else {
|
|
123
|
+
if (notificationsGroup.result.result && !notificationsGroup.loading) {
|
|
124
|
+
if (!notificationsGroup.result?.error) {
|
|
123
125
|
showToast(ToastType.Success, t('UPDATE_SUCCESSFULLY', 'Update successfully'));
|
|
124
126
|
}
|
|
125
127
|
}
|
|
126
|
-
}, [
|
|
128
|
+
}, [notificationsGroup.result])
|
|
127
129
|
|
|
128
130
|
useEffect(() => {
|
|
129
131
|
if (Object.keys(errors).length > 0) {
|
|
@@ -139,21 +141,20 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
139
141
|
}, [errors]);
|
|
140
142
|
|
|
141
143
|
const detailProps = {
|
|
142
|
-
|
|
143
144
|
goToBack: () => props.navigation?.canGoBack() && props.navigation.goBack(),
|
|
144
145
|
onNavigationRedirect: (route: string, params: any) => props.navigation.navigate(route, params)
|
|
145
146
|
}
|
|
146
147
|
|
|
147
148
|
const onRemoveAccount = () => {
|
|
148
149
|
setConfirm({
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
150
|
+
open: true,
|
|
151
|
+
content: [t('QUESTION_REMOVE_ACCOUNT', 'Are you sure that you want to remove your account?')],
|
|
152
|
+
title: t('ACCOUNT_ALERT', 'Account alert'),
|
|
153
|
+
handleOnAccept: () => {
|
|
154
|
+
setConfirm({ ...confirm, open: false })
|
|
155
|
+
handleRemoveAccount && handleRemoveAccount(user?.id)
|
|
156
|
+
}
|
|
157
|
+
})
|
|
157
158
|
}
|
|
158
159
|
|
|
159
160
|
useEffect(() => {
|
|
@@ -163,10 +164,7 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
163
164
|
}, [removeAccountState])
|
|
164
165
|
|
|
165
166
|
return (
|
|
166
|
-
<View style={{ flex: 1, height: height - top - bottom
|
|
167
|
-
{/* <OText size={24} style={{ marginTop: 15, paddingHorizontal: 40 }}>
|
|
168
|
-
{t('PROFILE', 'Profile')}
|
|
169
|
-
</OText> */}
|
|
167
|
+
<View style={{ flex: 1, height: height - top - bottom, paddingTop: 20 }}>
|
|
170
168
|
<CenterView style={styles.pagePadding}>
|
|
171
169
|
{user?.photo && (
|
|
172
170
|
<View style={styles.photo}>
|
|
@@ -183,12 +181,12 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
183
181
|
<View style={{ flexBasis: '70%' }}>
|
|
184
182
|
<OText size={20} lineHeight={30} weight={Platform.OS === 'ios' ? '500' : 'bold'} color={theme.colors.textNormal}>{user?.name} {user?.lastname}</OText>
|
|
185
183
|
<TouchableOpacity onPress={() => navigation.navigate('ProfileForm', { ...detailProps })}>
|
|
186
|
-
<OText size={12} lineHeight={18} color={theme.colors.
|
|
184
|
+
<OText size={12} lineHeight={18} color={theme.colors.primary} style={{ textDecorationLine: 'underline' }}>{t('VIEW_ACCOUNT', 'View account')}</OText>
|
|
187
185
|
</TouchableOpacity>
|
|
188
186
|
</View>
|
|
189
187
|
</CenterView>
|
|
190
188
|
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginVertical: 32 }} />
|
|
191
|
-
<Spinner visible={
|
|
189
|
+
<Spinner visible={notificationsGroup?.loading} />
|
|
192
190
|
<ListWrap style={{ ...styles.pagePadding }}>
|
|
193
191
|
<Actions>
|
|
194
192
|
<ListItem onPress={() => onRedirect('AddressList', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
@@ -199,6 +197,10 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
199
197
|
<MessageCircle name='message1' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
200
198
|
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('MESSAGES', 'Messages')}</OText>
|
|
201
199
|
</ListItem>
|
|
200
|
+
<ListItem onPress={() => onRedirect('MyOrders', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
201
|
+
<FontAwesome name='list-alt' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
202
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('MY_ORDERS', 'My Orders')}</OText>
|
|
203
|
+
</ListItem>
|
|
202
204
|
{isWalletEnabled && (
|
|
203
205
|
<ListItem onPress={() => onRedirect('Wallets', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
204
206
|
<Ionicons name='wallet-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
@@ -215,6 +217,27 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
215
217
|
<OIcon src={theme.images.general.ic_help} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
|
|
216
218
|
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('HELP', 'Help')}</OText>
|
|
217
219
|
</ListItem>
|
|
220
|
+
<ListItem onPress={() => navigation.navigate('Notifications', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
221
|
+
<NotificationBadge style={{ borderRadius: 100 / 2 }} />
|
|
222
|
+
<Ionicons name='notifications-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
223
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('NOTIFICATIONS', 'Notifications')}
|
|
224
|
+
</OText>
|
|
225
|
+
<NotificationsWrapper>
|
|
226
|
+
<ToggleSwitch
|
|
227
|
+
isOn={user && (!!user?.settings?.notification?.newsletter ||
|
|
228
|
+
!!user?.settings?.sms?.newsletter ||
|
|
229
|
+
!!user?.settings?.email?.newsletter)}
|
|
230
|
+
onColor={theme.colors.primary}
|
|
231
|
+
size="small"
|
|
232
|
+
disabled={notificationsGroup?.loading}
|
|
233
|
+
offColor={theme.colors.disabled}
|
|
234
|
+
animationSpeed={400}
|
|
235
|
+
onToggle={() => handleChangePromotions(!(user && (!!user?.settings?.notification?.newsletter ||
|
|
236
|
+
!!user?.settings?.sms?.newsletter ||
|
|
237
|
+
!!user?.settings?.email?.newsletter)))}
|
|
238
|
+
/>
|
|
239
|
+
</NotificationsWrapper>
|
|
240
|
+
</ListItem>
|
|
218
241
|
<ListItem onPress={() => navigation.navigate('Sessions')} activeOpacity={0.7}>
|
|
219
242
|
<Ionicons name='md-list-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
220
243
|
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('SESSIONS', 'Sessions')}</OText>
|
|
@@ -237,13 +260,13 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
237
260
|
</Actions>
|
|
238
261
|
</ListWrap>
|
|
239
262
|
<OAlert
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
263
|
+
open={confirm.open}
|
|
264
|
+
title={confirm.title}
|
|
265
|
+
content={confirm.content}
|
|
266
|
+
onAccept={confirm.handleOnAccept}
|
|
267
|
+
onCancel={() => setConfirm({ ...confirm, open: false, title: null })}
|
|
268
|
+
onClose={() => setConfirm({ ...confirm, open: false, title: null })}
|
|
269
|
+
/>
|
|
247
270
|
</View>
|
|
248
271
|
);
|
|
249
272
|
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { useTheme } from 'styled-components';
|
|
1
2
|
import styled from 'styled-components/native'
|
|
2
3
|
|
|
4
|
+
const theme = useTheme();
|
|
5
|
+
|
|
3
6
|
export const CenterView = styled.View`
|
|
4
7
|
flex-direction: row;
|
|
5
8
|
justify-content: flex-start;
|
|
@@ -40,3 +43,17 @@ export const ListItem = styled.TouchableOpacity`
|
|
|
40
43
|
margin-bottom: 24px;
|
|
41
44
|
`
|
|
42
45
|
|
|
46
|
+
export const NotificationsWrapper = styled.View`
|
|
47
|
+
position: absolute;
|
|
48
|
+
right: 0;
|
|
49
|
+
`
|
|
50
|
+
|
|
51
|
+
export const NotificationBadge = styled.View`
|
|
52
|
+
width: 10px;
|
|
53
|
+
height: 10px;
|
|
54
|
+
z-index: 2000;
|
|
55
|
+
background-color: ${theme.colors.red};
|
|
56
|
+
position: absolute;
|
|
57
|
+
left: -2px;
|
|
58
|
+
top: 3px;
|
|
59
|
+
`;
|
|
@@ -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,17 +278,16 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
284
278
|
|
|
285
279
|
return (
|
|
286
280
|
<>
|
|
287
|
-
<
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
<
|
|
296
|
-
|
|
297
|
-
<CenterView style={styles.pagePadding}>
|
|
281
|
+
<Container>
|
|
282
|
+
<NavBar
|
|
283
|
+
title={t('ACCOUNT', 'Account')}
|
|
284
|
+
titleAlign={'center'}
|
|
285
|
+
onActionLeft={() => navigation.goBack()}
|
|
286
|
+
showCall={false}
|
|
287
|
+
btnStyle={{ paddingLeft: 0 }}
|
|
288
|
+
/>
|
|
289
|
+
<KeyboardAvoidingView behavior={Platform.OS == 'ios' ? 'padding' : 'height'} enabled style={{ flex: 1, flexDirection: 'column', justifyContent: 'center' }}>
|
|
290
|
+
<CenterView>
|
|
298
291
|
<View style={styles.photo}>
|
|
299
292
|
{user?.photo ? (
|
|
300
293
|
<FastImage
|
|
@@ -317,17 +310,15 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
317
310
|
onClick={() => handleImagePicker()}
|
|
318
311
|
/>
|
|
319
312
|
</CenterView>
|
|
320
|
-
<View style={{ height: 8,
|
|
313
|
+
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginVertical: 32, zIndex: 10 }} />
|
|
321
314
|
<Spinner visible={formState?.loading || verifyPhoneState?.loading} />
|
|
322
|
-
<
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
</Container>
|
|
330
|
-
</KeyboardAvoidingView>
|
|
315
|
+
<UserFormDetailsUI
|
|
316
|
+
{...props}
|
|
317
|
+
isEdit
|
|
318
|
+
setWillVerifyOtpState={setWillVerifyOtpState}
|
|
319
|
+
/>
|
|
320
|
+
</KeyboardAvoidingView>
|
|
321
|
+
</Container>
|
|
331
322
|
<OModal
|
|
332
323
|
open={isModalVisible}
|
|
333
324
|
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
|
+
paddingTop: 20px;
|
|
16
|
+
margin-bottom: 40px;
|
|
17
|
+
`
|
|
18
|
+
|
|
12
19
|
export const Names = styled.View`
|
|
13
20
|
flex-direction: row;
|
|
14
21
|
`
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { View } from 'react-native'
|
|
3
|
+
import { useLanguage } from 'ordering-components/native'
|
|
4
|
+
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
5
|
+
import { useTheme } from 'styled-components/native'
|
|
6
|
+
import { OText } from '../shared';
|
|
7
|
+
import { WalletTransactionItem } from '../WalletTransactionItem'
|
|
8
|
+
import { NotFoundSource } from '../NotFoundSource';
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
Container,
|
|
12
|
+
TransactionsWrapper
|
|
13
|
+
} from './styles'
|
|
14
|
+
|
|
15
|
+
export const WalletTransactions = (props: any) => {
|
|
16
|
+
const {
|
|
17
|
+
transactionsList,
|
|
18
|
+
currentWalletSelected
|
|
19
|
+
} = props
|
|
20
|
+
|
|
21
|
+
const theme = useTheme()
|
|
22
|
+
const [, t] = useLanguage()
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Container>
|
|
26
|
+
<View style={{ width: '100%', paddingHorizontal: 1, paddingBottom: 40 }}>
|
|
27
|
+
{!transactionsList?.loading &&
|
|
28
|
+
!transactionsList?.error &&
|
|
29
|
+
transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.length > 0 &&
|
|
30
|
+
(
|
|
31
|
+
<>
|
|
32
|
+
<OText style={{fontSize: 20, color: theme.colors.textNormal, marginBottom: 30}}>
|
|
33
|
+
{t('TRANSACTIONS_HISTORY', 'Transactions history')}
|
|
34
|
+
</OText>
|
|
35
|
+
<TransactionsWrapper>
|
|
36
|
+
{transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.map((transaction: any, i: number) =>(
|
|
37
|
+
<WalletTransactionItem
|
|
38
|
+
idx={i}
|
|
39
|
+
type={currentWalletSelected?.type}
|
|
40
|
+
key={transaction.id}
|
|
41
|
+
item={transaction}
|
|
42
|
+
withFormatPrice={currentWalletSelected?.type === 'cash'}
|
|
43
|
+
/>
|
|
44
|
+
))}
|
|
45
|
+
</TransactionsWrapper>
|
|
46
|
+
</>
|
|
47
|
+
)}
|
|
48
|
+
|
|
49
|
+
{(transactionsList?.loading || !transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]) && (
|
|
50
|
+
<View>
|
|
51
|
+
{[...Array(4).keys()].map(i => (
|
|
52
|
+
<View style={{ marginBottom: 10 }} key={i}>
|
|
53
|
+
<Placeholder Animation={Fade}>
|
|
54
|
+
<PlaceholderLine width={100} height={100} style={{ marginBottom: 0, borderRadius: 8 }} />
|
|
55
|
+
</Placeholder>
|
|
56
|
+
</View>
|
|
57
|
+
))}
|
|
58
|
+
</View>
|
|
59
|
+
)}
|
|
60
|
+
|
|
61
|
+
{!transactionsList?.loading &&
|
|
62
|
+
!(transactionsList?.loading && transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]) &&
|
|
63
|
+
(transactionsList?.error ||
|
|
64
|
+
!transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.length) &&
|
|
65
|
+
(
|
|
66
|
+
<NotFoundSource
|
|
67
|
+
content={transactionsList?.error
|
|
68
|
+
? t('ERROR_NOT_FOUND_TRANSACTIONS', 'Sorry, an error has occurred')
|
|
69
|
+
: t('NOT_FOUND_TRANSACTIONS', 'No transactions to show at this time.')
|
|
70
|
+
}
|
|
71
|
+
/>
|
|
72
|
+
)}
|
|
73
|
+
</View>
|
|
74
|
+
</Container>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import styled from 'styled-components/native'
|
|
2
|
+
|
|
3
|
+
export const Container = styled.View`
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
`
|
|
7
|
+
|
|
8
|
+
export const TransactionsWrapper = styled.View`
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
border-left-width: 2px;
|
|
12
|
+
border-left-color: ${(props: any) => props.theme.colors.disabled};
|
|
13
|
+
`
|