ordering-ui-react-native 0.16.69 → 0.16.70-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.
Files changed (203) hide show
  1. package/package.json +6 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/styles.tsx +8 -14
  4. package/src/components/BusinessInformation/index.tsx +19 -4
  5. package/src/components/BusinessInformation/styles.tsx +2 -2
  6. package/src/components/BusinessProductsList/index.tsx +10 -10
  7. package/src/components/BusinessesListing/index.tsx +1 -1
  8. package/src/components/Checkout/index.tsx +2 -1
  9. package/src/components/LanguageSelector/index.tsx +21 -16
  10. package/src/components/Messages/index.tsx +2 -2
  11. package/src/components/OrdersOption/index.tsx +54 -56
  12. package/src/components/PaymentOptions/index.tsx +298 -345
  13. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  14. package/src/components/SingleProductReview/index.tsx +7 -4
  15. package/src/components/StripeElementsForm/index.tsx +25 -16
  16. package/src/components/VerifyPhone/styles.tsx +1 -2
  17. package/src/components/shared/OToast.tsx +4 -4
  18. package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
  19. package/src/utils/index.tsx +2 -1
  20. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +260 -238
  21. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  22. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  23. package/themes/business/src/components/Chat/index.tsx +31 -31
  24. package/themes/business/src/components/DriverMap/index.tsx +7 -5
  25. package/themes/business/src/components/LoginForm/index.tsx +111 -74
  26. package/themes/business/src/components/MapView/index.tsx +14 -3
  27. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  28. package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
  29. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +70 -43
  30. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
  31. package/themes/business/src/components/OrdersOption/index.tsx +63 -73
  32. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  33. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  34. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  35. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  36. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  37. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  38. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  39. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  40. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  41. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  42. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  43. package/themes/business/src/components/PreviousOrders/index.tsx +440 -245
  44. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  45. package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
  46. package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
  47. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  48. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  49. package/themes/business/src/components/shared/OLink.tsx +33 -13
  50. package/themes/business/src/components/shared/OText.tsx +8 -2
  51. package/themes/business/src/types/index.tsx +14 -3
  52. package/themes/business/src/utils/index.tsx +10 -0
  53. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  54. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  55. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  56. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  57. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  58. package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
  59. package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
  60. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  61. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  62. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  63. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  64. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  65. package/themes/kiosk/src/types/index.d.ts +2 -0
  66. package/themes/original/index.tsx +6 -0
  67. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  68. package/themes/original/src/components/AddressForm/index.tsx +153 -137
  69. package/themes/original/src/components/AddressList/index.tsx +18 -18
  70. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  71. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  72. package/themes/original/src/components/BusinessBasicInformation/index.tsx +49 -33
  73. package/themes/original/src/components/BusinessController/index.tsx +101 -70
  74. package/themes/original/src/components/BusinessController/styles.tsx +14 -9
  75. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  76. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
  77. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  78. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  79. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  80. package/themes/original/src/components/BusinessListingSearch/index.tsx +87 -142
  81. package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
  82. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  83. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  84. package/themes/original/src/components/BusinessProductsList/index.tsx +41 -62
  85. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  86. package/themes/original/src/components/BusinessProductsListing/index.tsx +561 -479
  87. package/themes/original/src/components/BusinessProductsListing/styles.tsx +13 -12
  88. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  89. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  90. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +93 -98
  91. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  92. package/themes/original/src/components/BusinessesListing/index.tsx +8 -8
  93. package/themes/original/src/components/Cart/index.tsx +75 -42
  94. package/themes/original/src/components/CartContent/index.tsx +80 -18
  95. package/themes/original/src/components/CartContent/styles.tsx +11 -1
  96. package/themes/original/src/components/Checkout/index.tsx +110 -114
  97. package/themes/original/src/components/Checkout/styles.tsx +4 -3
  98. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  99. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  100. package/themes/original/src/components/DriverTips/index.tsx +47 -37
  101. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  102. package/themes/original/src/components/Favorite/index.tsx +7 -4
  103. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  104. package/themes/original/src/components/FavoriteList/index.tsx +70 -80
  105. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  106. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  107. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  108. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  109. package/themes/original/src/components/GoogleMap/index.tsx +10 -1
  110. package/themes/original/src/components/Help/index.tsx +7 -7
  111. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +14 -20
  112. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  113. package/themes/original/src/components/HelpGuide/index.tsx +12 -11
  114. package/themes/original/src/components/HelpGuide/styles.tsx +5 -0
  115. package/themes/original/src/components/HelpOrder/index.tsx +12 -20
  116. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  117. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  118. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  119. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  120. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  121. package/themes/original/src/components/LoginForm/index.tsx +98 -41
  122. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  123. package/themes/original/src/components/MessageListing/index.tsx +7 -40
  124. package/themes/original/src/components/Messages/index.tsx +35 -20
  125. package/themes/original/src/components/MomentOption/index.tsx +17 -11
  126. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  127. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
  128. package/themes/original/src/components/MultiCheckout/index.tsx +158 -77
  129. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  130. package/themes/original/src/components/MultiOrdersDetails/index.tsx +85 -34
  131. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  132. package/themes/original/src/components/MyOrders/index.tsx +86 -20
  133. package/themes/original/src/components/NavBar/index.tsx +7 -6
  134. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  135. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  136. package/themes/original/src/components/Notifications/index.tsx +144 -0
  137. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  138. package/themes/original/src/components/OrderDetails/index.tsx +115 -215
  139. package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
  140. package/themes/original/src/components/OrderItAgain/index.tsx +46 -43
  141. package/themes/original/src/components/OrderProgress/index.tsx +79 -100
  142. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  143. package/themes/original/src/components/OrderSummary/index.tsx +3 -36
  144. package/themes/original/src/components/OrderTypeSelector/index.tsx +13 -6
  145. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +94 -98
  146. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  147. package/themes/original/src/components/OrdersOption/index.tsx +97 -88
  148. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  149. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  150. package/themes/original/src/components/PaymentOptions/index.tsx +1 -2
  151. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  152. package/themes/original/src/components/PlaceSpot/index.tsx +249 -47
  153. package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
  154. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  155. package/themes/original/src/components/ProductForm/index.tsx +212 -253
  156. package/themes/original/src/components/ProductForm/styles.tsx +5 -8
  157. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  158. package/themes/original/src/components/ProductOptionSubOption/index.tsx +17 -9
  159. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  160. package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
  161. package/themes/original/src/components/ProfessionalProfile/index.tsx +19 -8
  162. package/themes/original/src/components/Promotions/index.tsx +234 -220
  163. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  164. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  165. package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
  166. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  167. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  168. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  169. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  170. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  171. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  172. package/themes/original/src/components/ServiceForm/index.tsx +328 -264
  173. package/themes/original/src/components/SignupForm/index.tsx +134 -89
  174. package/themes/original/src/components/SingleOrderCard/index.tsx +129 -54
  175. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  176. package/themes/original/src/components/SingleProductCard/index.tsx +85 -82
  177. package/themes/original/src/components/SingleProductCard/styles.tsx +2 -9
  178. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  179. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  180. package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
  181. package/themes/original/src/components/StripeElementsForm/index.tsx +13 -2
  182. package/themes/original/src/components/UpsellingProducts/index.tsx +244 -215
  183. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  184. package/themes/original/src/components/UserDetails/index.tsx +5 -3
  185. package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
  186. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  187. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  188. package/themes/original/src/components/UserProfileForm/index.tsx +19 -28
  189. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  190. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  191. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  192. package/themes/original/src/components/Wallets/index.tsx +230 -164
  193. package/themes/original/src/components/Wallets/styles.tsx +12 -8
  194. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  195. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  196. package/themes/original/src/components/shared/OBottomPopup.tsx +6 -4
  197. package/themes/original/src/components/shared/OButton.tsx +9 -4
  198. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  199. package/themes/original/src/components/shared/OInput.tsx +10 -1
  200. package/themes/original/src/layouts/Container.tsx +13 -9
  201. package/themes/original/src/types/index.tsx +44 -6
  202. package/themes/original/src/utils/index.tsx +305 -58
  203. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import { Pressable, StyleSheet, View } 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'
@@ -9,23 +9,25 @@ import {
9
9
  useUtils,
10
10
  useConfig
11
11
  } from 'ordering-components/native'
12
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
12
13
 
13
14
  import {
14
15
  Container,
16
+ Header,
15
17
  BalanceElement,
16
- TransactionsWrapper,
17
18
  OTabs,
18
19
  OTab,
19
20
  SectionContent,
20
21
  LoyaltyContent,
21
22
  LoyaltyWrapp,
22
- LoyaltyImg
23
+ LoyaltyImg,
24
+ WalletTransactionsWrapper
23
25
  } from './styles'
24
26
 
25
- import NavBar from '../NavBar'
26
- import { OText } from '../shared';
27
+ import { OButton, OIcon, OText, OModal } from '../shared';
27
28
  import { NotFoundSource } from '../NotFoundSource';
28
- import { WalletTransactionItem } from '../WalletTransactionItem'
29
+ import { WalletTransactions } from '../WalletTransactions'
30
+ import { GiftCardUI } from '../GiftCard/GiftCardUI'
29
31
 
30
32
  const WalletsUI = (props: any) => {
31
33
  const {
@@ -46,6 +48,7 @@ const WalletsUI = (props: any) => {
46
48
  const [{ parsePrice }] = useUtils()
47
49
  const [{ configs }] = useConfig()
48
50
 
51
+
49
52
  const styles = StyleSheet.create({
50
53
  logoStyle: {
51
54
  width: 120,
@@ -56,10 +59,20 @@ const WalletsUI = (props: any) => {
56
59
  flexDirection: 'column',
57
60
  justifyContent: 'center',
58
61
  alignItems: 'center',
62
+ },
63
+ dividerStyle: {
64
+ height: 8,
65
+ backgroundColor: theme.colors.backgroundGray100,
66
+ marginVertical: 25,
67
+ marginHorizontal: -40,
68
+ width: '100%'
59
69
  }
60
70
  });
61
71
 
62
72
  const [tabSelected, setTabSelected] = useState(isWalletCashEnabled ? 'cash' : 'credit_point')
73
+ const [openHistory, setOpenHistory] = useState(false)
74
+ const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
75
+ const hideWalletsTheme = theme?.bar_menu?.components?.wallets?.hidden
63
76
 
64
77
  const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletPointsEnabled)
65
78
 
@@ -74,7 +87,7 @@ const WalletsUI = (props: any) => {
74
87
  isActive: isWalletCashEnabled
75
88
  },
76
89
  credit_point: {
77
- name: t('CREDITS_POINTS_WALLET', 'Credit Points Wallet'),
90
+ name: t('POINTS_WALLET', 'Points Wallet'),
78
91
  value: 1,
79
92
  isActive: isWalletPointsEnabled
80
93
  }
@@ -98,180 +111,233 @@ const WalletsUI = (props: any) => {
98
111
  }, [configs])
99
112
 
100
113
  useEffect(() => {
101
- if(refreshWallets){
114
+ if (refreshWallets) {
102
115
  getWallets()
103
116
  setRefreshWallets && setRefreshWallets(false)
104
117
  }
105
118
  }, [refreshWallets])
106
119
 
107
120
  return (
108
- <Container>
109
- <NavBar
110
- title={t('WALLETS', 'Wallets')}
111
- titleAlign={'center'}
112
- onActionLeft={goToBack}
113
- showCall={false}
114
- paddingTop={10}
115
- btnStyle={{ paddingLeft: 0 }}
116
- />
121
+ <>
122
+ <Container>
123
+ <Header>
124
+ <View style={{
125
+ ...{
126
+ width: '100%',
127
+ display: 'flex',
128
+ flexDirection: 'row',
129
+ alignItems: 'center',
130
+ },
131
+ }}>
132
+ {(!props.hideBackBtn || !hideWalletsTheme) && !isChewLayout && (
133
+ <OButton
134
+ imgLeftStyle={{ width: 18 }}
135
+ imgRightSrc={null}
136
+ style={{
137
+ borderWidth: 0,
138
+ width: 26,
139
+ height: 26,
140
+ backgroundColor: '#FFF',
141
+ borderColor: '#FFF',
142
+ shadowColor: '#FFF',
143
+ paddingLeft: 0,
144
+ paddingRight: 0,
145
+ marginTop: 30,
146
+ }}
147
+ onClick={goToBack}
148
+ icon={AntDesignIcon}
149
+ iconProps={{
150
+ name: 'arrowleft',
151
+ size: 26
152
+ }}
153
+ />
154
+ )}
155
+ <OText
156
+ size={20}
157
+ style={{
158
+ marginTop: 30,
159
+ marginLeft: (!props.hideBackBtn || !hideWalletsTheme) && !isChewLayout ? 10 : 0,
160
+ color: theme.colors.textNormal,
161
+ }}
162
+ weight={Platform.OS === 'ios' ? '600' : 'bold'}
163
+ >{t('WALLETS', 'Wallets')}</OText>
164
+ </View>
165
+ {isChewLayout && (
166
+ <OButton
167
+ text={t('WALLET_HISTORY', 'Wallet history')}
168
+ bgColor={theme.colors.white}
169
+ borderColor={theme.colors.lightGray}
170
+ imgRightSrc={null}
171
+ textStyle={{ fontSize: 12, color: theme.colors.disabled }}
172
+ onClick={() => setOpenHistory(true)}
173
+ style={{ borderRadius: 8, height: 40 }}
174
+ />
175
+ )}
176
+ </Header>
117
177
 
118
- {!walletList.loading &&
119
- !userLoyaltyLevel.loading &&
120
- !walletList.error &&
121
- walletList.wallets?.length > 0 &&
122
- (
123
- <>
124
- <OTabs
125
- horizontal
126
- showsHorizontalScrollIndicator={false}
127
- >
128
- {walletList.wallets?.map((wallet: any) => walletName[wallet.type]?.isActive && (
129
- <Pressable
130
- key={wallet.id}
131
- onPress={() => handleChangeTab(wallet)}
178
+ {!walletList.loading &&
179
+ !userLoyaltyLevel.loading &&
180
+ !walletList.error &&
181
+ walletList.wallets?.length > 0 &&
182
+ (
183
+ <>
184
+ <OTabs
185
+ horizontal
186
+ showsHorizontalScrollIndicator={false}
132
187
  >
133
- <OTab isSelected={tabSelected === wallet.type}>
134
- <OText size={18}>
135
- {walletName[wallet.type]?.name}
136
- </OText>
137
- </OTab>
138
- </Pressable>
139
- ))}
140
- </OTabs>
188
+ {walletList.wallets?.map((wallet: any) => walletName[wallet.type]?.isActive && (
189
+ <TouchableOpacity
190
+ key={wallet.id}
191
+ onPress={() => handleChangeTab(wallet)}
192
+ >
193
+ <OTab
194
+ isSelected={tabSelected === wallet.type}
195
+ style={{
196
+ borderBottomWidth: 1,
197
+ borderBottomColor:
198
+ tabSelected === wallet.type
199
+ ? theme.colors.textNormal
200
+ : theme.colors.border
201
+ }}
202
+ >
203
+ <OText>
204
+ {walletName[wallet.type]?.name}
205
+ </OText>
206
+ </OTab>
207
+ </TouchableOpacity>
208
+ ))}
209
+ </OTabs>
141
210
 
142
- <SectionContent>
143
- {!!loyaltyLevel && tabSelected === 'credit_point' && (
144
- <LoyaltyContent>
145
- <LoyaltyWrapp>
146
- <OText size={20}>
147
- {`${t('LOYALTY_LEVEL_TITLE', 'Your level is')}:`}
211
+ <SectionContent>
212
+ {!!loyaltyLevel && tabSelected === 'credit_point' && (
213
+ <LoyaltyContent>
214
+ <LoyaltyWrapp>
215
+ <OText size={20}>
216
+ {`${t('LOYALTY_LEVEL_TITLE', 'Your level is')}:`}
217
+ </OText>
218
+ {/* {loyaltyLevel.image ? (
219
+ <FastImage
220
+ style={styles.logoStyle}
221
+ source={{
222
+ uri: loyaltyLevel.image,
223
+ priority: FastImage.priority.high,
224
+ cache: FastImage.cacheControl.web
225
+ }}
226
+ resizeMode={FastImage.resizeMode.contain}
227
+ />
228
+ ) : (
229
+ <LoyaltyImg
230
+ source={theme.images.dummies.loyaltyLevel}
231
+ resizeMode='contain'
232
+ />
233
+ )} */}
234
+ <OText
235
+ size={22}
236
+ weight='bold'
237
+ style={{ textTransform: 'uppercase' }}
238
+ color={theme.colors.primary}
239
+ >
240
+ {loyaltyLevel.name}
241
+ </OText>
242
+ </LoyaltyWrapp>
243
+ </LoyaltyContent>
244
+ )}
245
+ <BalanceElement>
246
+ <OText size={20} style={{ fontWeight: '600' }}>
247
+ {currentWalletSelected?.type === 'cash'
248
+ ? parsePrice(currentWalletSelected?.balance)
249
+ : currentWalletSelected?.balance
250
+ }
148
251
  </OText>
149
- {loyaltyLevel.image ? (
150
- <FastImage
151
- style={styles.logoStyle}
152
- source={{
153
- uri: loyaltyLevel.image,
154
- priority: FastImage.priority.high,
155
- cache:FastImage.cacheControl.web
156
- }}
157
- resizeMode={FastImage.resizeMode.contain}
158
- />
159
- ) : (
160
- <LoyaltyImg
161
- source={theme.images.dummies.loyaltyLevel}
162
- resizeMode='contain'
163
- />
164
- )}
165
- <OText
166
- size={22}
167
- weight='bold'
168
- style={{ textTransform: 'uppercase' }}
169
- color={theme.colors.primary}
170
- >
171
- {loyaltyLevel.name}
252
+ <OText style={{ paddingLeft: 5 }}>
253
+ {currentWalletSelected?.type === 'cash'
254
+ ? configs?.stripe_currency?.value
255
+ : t('POINTS', 'Points')}
172
256
  </OText>
173
- </LoyaltyWrapp>
174
- </LoyaltyContent>
175
- )}
176
- <BalanceElement>
177
- <OText size={20} style={{fontWeight: '600'}}>
178
- {currentWalletSelected?.type === 'cash'
179
- ? parsePrice(currentWalletSelected?.balance)
180
- : currentWalletSelected?.balance
181
- }
182
- </OText>
183
- <OText style={{ paddingLeft: 5 }}>
184
- {currentWalletSelected?.type === 'cash'
185
- ? configs?.stripe_currency?.value
186
- : t('POINTS', 'Points')}
187
- </OText>
188
- </BalanceElement>
257
+ </BalanceElement>
189
258
 
190
- <View style={{ marginTop: 20, width: '100%', paddingHorizontal: 1, paddingBottom: 40 }}>
191
- {!transactionsList?.loading &&
192
- !transactionsList?.error &&
193
- transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.length > 0 &&
194
- (
195
- <>
196
- <OText style={{fontSize: 20}}>
197
- {t('TRANSACTIONS_HISTORY', 'Transactions history')}
198
- </OText>
199
- <TransactionsWrapper>
200
- {transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.map((transaction: any, i: number) =>(
201
- <WalletTransactionItem
202
- idx={i}
203
- type={currentWalletSelected?.type}
204
- key={transaction.id}
205
- item={transaction}
206
- withFormatPrice={currentWalletSelected?.type === 'cash'}
207
- />
208
- ))}
209
- </TransactionsWrapper>
210
- </>
211
- )}
259
+ <View style={styles.dividerStyle} />
260
+ <GiftCardUI navigation={navigation} />
261
+ <View style={styles.dividerStyle} />
212
262
 
213
- {(transactionsList?.loading || !transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]) && (
214
- <View>
215
- {[...Array(4).keys()].map(i => (
216
- <View style={{ marginBottom: 10 }} key={i}>
217
- <Placeholder Animation={Fade}>
218
- <PlaceholderLine width={100} height={100} style={{ marginBottom: 0, borderRadius: 8 }} />
219
- </Placeholder>
220
- </View>
221
- ))}
222
- </View>
223
- )}
263
+ {!isChewLayout && (
264
+ <WalletTransactions
265
+ transactionsList={transactionsList}
266
+ currentWalletSelected={currentWalletSelected}
267
+ />
268
+ )}
269
+ </SectionContent>
270
+ </>
271
+ )}
224
272
 
225
- {!transactionsList?.loading &&
226
- !(transactionsList?.loading && transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]) &&
227
- (transactionsList?.error ||
228
- !transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.length) &&
229
- (
230
- <NotFoundSource
231
- content={transactionsList?.error
232
- ? t('ERROR_NOT_FOUND_TRANSACTIONS', 'Sorry, an error has occurred')
233
- : t('NOT_FOUND_TRANSACTIONS', 'No transactions to show at this time.')
234
- }
235
- />
236
- )}
273
+ {(walletList?.loading || userLoyaltyLevel.loading) && (
274
+ <>
275
+ <View>
276
+ <Placeholder Animation={Fade}>
277
+ <PlaceholderLine width={100} height={40} style={{ marginBottom: 0 }} />
278
+ </Placeholder>
279
+ </View>
280
+ <View style={{ marginTop: 10, marginBottom: 20 }}>
281
+ <Placeholder Animation={Fade}>
282
+ <PlaceholderLine width={100} height={40} style={{ marginBottom: 0 }} />
283
+ </Placeholder>
284
+ </View>
285
+ <View>
286
+ {[...Array(4).keys()].map(i => (
287
+ <View style={{ marginBottom: 10 }} key={i}>
288
+ <Placeholder Animation={Fade}>
289
+ <PlaceholderLine width={100} height={60} style={{ marginBottom: 0 }} />
290
+ </Placeholder>
291
+ </View>
292
+ ))}
237
293
  </View>
238
- </SectionContent>
239
- </>
240
- )}
294
+ </>
295
+ )}
241
296
 
242
- {(walletList?.loading || userLoyaltyLevel.loading) && (
243
- <>
244
- <View>
245
- <Placeholder Animation={Fade}>
246
- <PlaceholderLine width={100} height={40} style={{ marginBottom: 0 }} />
247
- </Placeholder>
248
- </View>
249
- <View style={{ marginTop: 10, marginBottom: 20 }}>
250
- <Placeholder Animation={Fade}>
251
- <PlaceholderLine width={100} height={40} style={{ marginBottom: 0 }} />
252
- </Placeholder>
253
- </View>
254
- <View>
255
- {[...Array(4).keys()].map(i => (
256
- <View style={{ marginBottom: 10 }} key={i}>
257
- <Placeholder Animation={Fade}>
258
- <PlaceholderLine width={100} height={60} style={{ marginBottom: 0 }} />
259
- </Placeholder>
260
- </View>
261
- ))}
262
- </View>
263
- </>
264
- )}
297
+ {!walletList?.loading && !userLoyaltyLevel.loading && (walletList?.error || !walletList?.wallets?.length) && (
298
+ <NotFoundSource
299
+ content={walletList?.error
300
+ ? t('ERROR_NOT_FOUND_WALLETS', 'Sorry, an error has occurred')
301
+ : t('NOT_FOUND_WALLETS', 'No wallets to show at this time.')
302
+ }
303
+ />
304
+ )}
305
+ </Container>
265
306
 
266
- {!walletList?.loading && !userLoyaltyLevel.loading && (walletList?.error || !walletList?.wallets?.length) && (
267
- <NotFoundSource
268
- content={walletList?.error
269
- ? t('ERROR_NOT_FOUND_WALLETS', 'Sorry, an error has occurred')
270
- : t('NOT_FOUND_WALLETS', 'No wallets to show at this time.')
271
- }
272
- />
273
- )}
274
- </Container>
307
+ <OModal
308
+ open={openHistory}
309
+ onClose={() => setOpenHistory(false)}
310
+ entireModal
311
+ customClose
312
+ >
313
+ <ScrollView>
314
+ <WalletTransactionsWrapper>
315
+ <OButton
316
+ imgRightSrc={null}
317
+ style={{
318
+ borderWidth: 0,
319
+ backgroundColor: theme.colors.white,
320
+ padding: 0,
321
+ paddingHorizontal: 0,
322
+ width: 30,
323
+ paddingLeft: 0,
324
+ paddingRight: 0
325
+ }}
326
+ onClick={() => setOpenHistory(false)}
327
+ icon={AntDesignIcon}
328
+ iconProps={{
329
+ name: 'arrowleft',
330
+ size: 26
331
+ }}
332
+ />
333
+ <WalletTransactions
334
+ transactionsList={transactionsList}
335
+ currentWalletSelected={currentWalletSelected}
336
+ />
337
+ </WalletTransactionsWrapper>
338
+ </ScrollView>
339
+ </OModal>
340
+ </>
275
341
  )
276
342
  }
277
343
 
@@ -4,7 +4,11 @@ export const Container = styled.View`
4
4
  display: flex;
5
5
  flex-direction: column;
6
6
  `
7
-
7
+ export const Header = styled.View`
8
+ flex-direction: row;
9
+ align-items: center;
10
+ justify-content: space-between;
11
+ `
8
12
  export const SectionContent = styled.View`
9
13
  width: 100%;
10
14
  display: flex;
@@ -14,13 +18,6 @@ export const SectionContent = styled.View`
14
18
  margin-top: 20px;
15
19
  `
16
20
 
17
- export const TransactionsWrapper = styled.View`
18
- display: flex;
19
- flex-direction: column;
20
- border-left-width: 2px;
21
- border-left-color: ${(props: any) => props.theme.colors.disabled};
22
- `
23
-
24
21
  export const BalanceElement = styled.View`
25
22
  width: 100%;
26
23
  padding: 10px 0;
@@ -30,16 +27,19 @@ export const BalanceElement = styled.View`
30
27
  align-items: center;
31
28
  background-color: ${(props: any) => props.theme.colors.backgroundGray100};
32
29
  border-radius: 8px;
30
+ margin-bottom: 20px;
33
31
  `
34
32
 
35
33
  export const OTabs = styled.View`
36
34
  flex-direction: row;
37
35
  width: 100%;
38
36
  flex-wrap: wrap;
37
+ padding-vertical: 5px;
39
38
  `;
40
39
 
41
40
  export const OTab = styled.View`
42
41
  padding-horizontal: 10px;
42
+ padding-vertical: 10px;
43
43
  `;
44
44
 
45
45
  export const LoyaltyContent = styled.View`
@@ -62,3 +62,7 @@ export const LoyaltyImg = styled.ImageBackground`
62
62
  justify-content: center;
63
63
  align-items: center;
64
64
  `
65
+ export const WalletTransactionsWrapper = styled.View`
66
+ padding-horizontal: 40px;
67
+ padding-top: 20px;
68
+ `
@@ -0,0 +1,47 @@
1
+ import React, { useState } from 'react'
2
+ import { StyleSheet, ViewStyle } from 'react-native'
3
+ import styled from 'styled-components/native'
4
+
5
+ const CardContainerTouchable = styled.TouchableOpacity``
6
+
7
+ interface Props {
8
+ children: React.ReactChildren | Element,
9
+ style?: Array<ViewStyle> | any,
10
+ onClick: any
11
+ }
12
+
13
+ export const CardAnimation = (props: Props) => {
14
+ const {
15
+ children,
16
+ onClick,
17
+ style
18
+ } = props
19
+ const [isPressed, setIsPressed] = useState(false)
20
+ const styles = StyleSheet.create({
21
+ cardAnimation: {
22
+ elevation: isPressed ? 2 : 0,
23
+ shadowColor: '#888',
24
+ shadowOffset: { width: 0, height: 0 },
25
+ shadowRadius: 0,
26
+ shadowOpacity: isPressed ? 0.8 : 0,
27
+ borderRadius: 12,
28
+ }
29
+ })
30
+
31
+ const styleProvided = style || []
32
+ return (
33
+ <CardContainerTouchable
34
+ onPress={onClick}
35
+ activeOpacity={0.8}
36
+ delayPressIn={20}
37
+ onPressIn={() => setIsPressed(true)}
38
+ onPressOut={() => setIsPressed(false)}
39
+ style={[
40
+ ...styleProvided,
41
+ styles.cardAnimation
42
+ ]}
43
+ >
44
+ {children}
45
+ </CardContainerTouchable>
46
+ )
47
+ }
@@ -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={24}
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}
@@ -14,6 +14,7 @@ interface Props {
14
14
  bottomContainerStyle?: any;
15
15
  titleStyle?: any;
16
16
  closeIcon?: any;
17
+ presentationStyle?: "fullScreen" | "pageSheet" | "formSheet" | "overFullScreen" | undefined
17
18
  }
18
19
  const OBottomPopup = (props: Props) => {
19
20
  const {
@@ -25,17 +26,18 @@ const OBottomPopup = (props: Props) => {
25
26
  isStatusBar,
26
27
  titleStyle,
27
28
  bottomContainerStyle,
28
- closeIcon
29
+ closeIcon,
30
+ presentationStyle
29
31
  } = props
30
32
  const { top, bottom } = useSafeAreaInsets();
31
-
33
+
32
34
  return (
33
35
  <Modal
34
- animationType='slide'
36
+ animationType='fade'
35
37
  transparent={transparent}
36
38
  visible={open}
37
39
  onRequestClose={() => onClose()}
38
- presentationStyle={'fullScreen'}
40
+ presentationStyle={presentationStyle || 'fullScreen'}
39
41
  >
40
42
  {isStatusBar && <StatusBar translucent={false} />}
41
43
  <View style={styles.container}>
@@ -79,6 +79,8 @@ interface Props {
79
79
  loadingStyle?: ViewStyle;
80
80
  showNextIcon?: boolean;
81
81
  isDisabledWithSameStyles?: boolean;
82
+ icon?: any;
83
+ iconProps?: any
82
84
  }
83
85
 
84
86
  const OButton = (props: Props): React.ReactElement => {
@@ -114,17 +116,20 @@ const OButton = (props: Props): React.ReactElement => {
114
116
  disabled={props.isDisabledWithSameStyles}
115
117
  >
116
118
  <StyledButton style={props.bgColor ? { ...props.style, backgroundColor: props.bgColor, borderColor: props.borderColor } : props.style}>
119
+ {props.icon ? (
120
+ <props.icon {...props.iconProps} />
121
+ ) : null}
117
122
  {props.imgLeftSrc ? (
118
- <OIcon style={props.imgLeftStyle} src={props.imgLeftSrc} />
123
+ <OIcon style={props.imgLeftStyle} src={props.imgLeftSrc} color={theme.colors.textNormal} />
119
124
  ) : null}
120
125
  {props.text ? (
121
126
  <StyledText style={props.textStyle}>{props.text}</StyledText>
122
127
  ) : null}
123
128
  {props.imgRightSrc ? (
124
129
  <EndImage style={props.imgRightStyle} source={props.imgRightSrc} />
125
- ) : props.showNextIcon ?
126
- <EndImage source={theme.images.general.arrow_left}
127
- style={{width: 16, tintColor: 'white', transform: [{rotate: I18nManager.isRTL ? '0deg' : '180deg'}]}} /> : null }
130
+ ) : props.showNextIcon ?
131
+ <EndImage source={theme.images.general.arrow_left}
132
+ style={{ width: 16, tintColor: 'white', transform: [{ rotate: I18nManager.isRTL ? '0deg' : '180deg' }] }} /> : null}
128
133
  </StyledButton>
129
134
  </TouchableOpacity>
130
135
  );
@@ -26,7 +26,14 @@ const OImage = (props: Props): React.ReactElement => {
26
26
  return (
27
27
  <Wrapper style={{ borderRadius: props.style?.borderRadius, overflow: 'hidden', marginHorizontal: props.style?.marginHorizontal }}>
28
28
  <SImage
29
- source={props.src ? props.src : props.url ? { uri: props.url } : props.dummy}
29
+ source={
30
+ props.src
31
+ ? props.src
32
+ : props.url
33
+ ? typeof props.url === 'number'
34
+ ? props.url
35
+ : { uri: props.url }
36
+ : props.dummy}
30
37
  style={{
31
38
  tintColor: props.color,
32
39
  flex: props.isWrap ? 1 : 0,