ordering-ui-react-native 0.16.20 → 0.16.22-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 (204) hide show
  1. package/package.json +7 -4
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/index.tsx +61 -63
  4. package/src/components/ActiveOrders/styles.tsx +8 -14
  5. package/src/components/AddressForm/index.tsx +18 -2
  6. package/src/components/BusinessBasicInformation/index.tsx +11 -19
  7. package/src/components/BusinessController/index.tsx +10 -8
  8. package/src/components/BusinessInformation/index.tsx +33 -4
  9. package/src/components/BusinessInformation/styles.tsx +2 -2
  10. package/src/components/BusinessProductsList/index.tsx +10 -10
  11. package/src/components/BusinessesListing/index.tsx +1 -1
  12. package/src/components/Checkout/index.tsx +2 -1
  13. package/src/components/LanguageSelector/index.tsx +21 -16
  14. package/src/components/LoginForm/index.tsx +118 -30
  15. package/src/components/LoginForm/styles.tsx +6 -0
  16. package/src/components/Messages/index.tsx +2 -2
  17. package/src/components/NotificationSetting/index.tsx +85 -0
  18. package/src/components/OrderDetails/index.tsx +2 -20
  19. package/src/components/OrdersOption/index.tsx +54 -56
  20. package/src/components/PaymentOptions/index.tsx +335 -365
  21. package/src/components/PaymentOptionsWebView/index.tsx +120 -121
  22. package/src/components/ReviewDriver/index.tsx +1 -1
  23. package/src/components/ReviewOrder/index.tsx +2 -1
  24. package/src/components/ReviewProducts/index.tsx +11 -0
  25. package/src/components/SignupForm/index.tsx +143 -61
  26. package/src/components/SingleProductReview/index.tsx +8 -5
  27. package/src/components/StripeElementsForm/index.tsx +25 -16
  28. package/src/components/VerifyPhone/styles.tsx +1 -2
  29. package/src/components/shared/OBottomPopup.tsx +6 -2
  30. package/src/index.tsx +2 -0
  31. package/src/pages/BusinessesListing.tsx +7 -6
  32. package/src/pages/OrderDetails.tsx +1 -1
  33. package/src/pages/ReviewDriver.tsx +2 -2
  34. package/src/pages/ReviewOrder.tsx +2 -2
  35. package/src/theme.json +0 -1
  36. package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
  37. package/src/types/index.tsx +13 -9
  38. package/src/utils/index.tsx +0 -1
  39. package/themes/business/index.tsx +4 -0
  40. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  41. package/themes/business/src/components/Chat/index.tsx +42 -34
  42. package/themes/business/src/components/DriverMap/index.tsx +7 -5
  43. package/themes/business/src/components/DriverSchedule/index.tsx +71 -0
  44. package/themes/business/src/components/DriverSchedule/styles.tsx +6 -0
  45. package/themes/business/src/components/LoginForm/index.tsx +111 -74
  46. package/themes/business/src/components/MapView/index.tsx +12 -1
  47. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  48. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  49. package/themes/business/src/components/OrderDetails/Delivery.tsx +3 -3
  50. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +25 -19
  51. package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
  52. package/themes/business/src/components/OrdersOption/index.tsx +65 -21
  53. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  54. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  55. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  56. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  57. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  58. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  59. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  60. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  61. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  62. package/themes/business/src/components/PreviousOrders/index.tsx +21 -23
  63. package/themes/business/src/components/ProductItemAccordion/index.tsx +5 -4
  64. package/themes/business/src/components/ReviewCustomer/index.tsx +1 -1
  65. package/themes/business/src/components/ScheduleBlocked/index.tsx +53 -0
  66. package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
  67. package/themes/business/src/components/UserProfileForm/index.tsx +28 -4
  68. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  69. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  70. package/themes/business/src/components/shared/OModal.tsx +40 -37
  71. package/themes/business/src/types/index.tsx +15 -9
  72. package/themes/business/src/utils/index.tsx +10 -0
  73. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  74. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  75. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  76. package/themes/kiosk/src/components/BusinessMenu/index.tsx +2 -1
  77. package/themes/kiosk/src/components/CartItem/index.tsx +4 -3
  78. package/themes/kiosk/src/components/CategoriesMenu/index.tsx +1 -0
  79. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  80. package/themes/kiosk/src/components/DrawerView/index.tsx +1 -0
  81. package/themes/kiosk/src/components/DrawerView/styles.tsx +2 -2
  82. package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
  83. package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
  84. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  85. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  86. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  87. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  88. package/themes/kiosk/src/types/index.d.ts +2 -0
  89. package/themes/original/index.tsx +12 -0
  90. package/themes/original/src/components/AddressForm/index.tsx +136 -133
  91. package/themes/original/src/components/AddressList/index.tsx +1 -1
  92. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  93. package/themes/original/src/components/BusinessBasicInformation/index.tsx +302 -160
  94. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +6 -2
  95. package/themes/original/src/components/BusinessController/index.tsx +173 -108
  96. package/themes/original/src/components/BusinessItemAccordion/index.tsx +8 -6
  97. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  98. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  99. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  100. package/themes/original/src/components/BusinessListingSearch/index.tsx +106 -126
  101. package/themes/original/src/components/BusinessListingSearch/styles.tsx +18 -13
  102. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  103. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  104. package/themes/original/src/components/BusinessProductsList/index.tsx +49 -52
  105. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  106. package/themes/original/src/components/BusinessProductsListing/index.tsx +287 -175
  107. package/themes/original/src/components/BusinessProductsListing/styles.tsx +22 -8
  108. package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
  109. package/themes/original/src/components/BusinessTypeFilter/index.tsx +109 -40
  110. package/themes/original/src/components/BusinessTypeFilter/styles.tsx +2 -0
  111. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +561 -0
  112. package/themes/original/src/components/BusinessesListing/{styles.tsx → Layout/Appointment/styles.tsx} +24 -10
  113. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +676 -0
  114. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +137 -0
  115. package/themes/original/src/components/BusinessesListing/index.tsx +105 -519
  116. package/themes/original/src/components/Cart/index.tsx +42 -10
  117. package/themes/original/src/components/Cart/styles.tsx +4 -0
  118. package/themes/original/src/components/CartContent/index.tsx +22 -16
  119. package/themes/original/src/components/Checkout/index.tsx +106 -66
  120. package/themes/original/src/components/Checkout/styles.tsx +0 -1
  121. package/themes/original/src/components/DriverTips/index.tsx +4 -4
  122. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  123. package/themes/original/src/components/Favorite/index.tsx +1 -0
  124. package/themes/original/src/components/Favorite/styles.tsx +1 -0
  125. package/themes/original/src/components/FavoriteList/index.tsx +142 -93
  126. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  127. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  128. package/themes/original/src/components/GoogleMap/index.tsx +20 -12
  129. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +8 -3
  130. package/themes/original/src/components/HelpGuide/index.tsx +8 -3
  131. package/themes/original/src/components/HelpOrder/index.tsx +8 -3
  132. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  133. package/themes/original/src/components/LoginForm/Otp/index.tsx +3 -2
  134. package/themes/original/src/components/LoginForm/index.tsx +82 -44
  135. package/themes/original/src/components/Messages/index.tsx +17 -17
  136. package/themes/original/src/components/MomentSelector/index.tsx +197 -0
  137. package/themes/original/src/components/MomentSelector/styles.tsx +6 -0
  138. package/themes/original/src/components/MultiCheckout/index.tsx +6 -0
  139. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -16
  140. package/themes/original/src/components/MyOrders/index.tsx +68 -6
  141. package/themes/original/src/components/NavBar/index.tsx +15 -9
  142. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  143. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  144. package/themes/original/src/components/Notifications/index.tsx +148 -0
  145. package/themes/original/src/components/Notifications/styles.tsx +17 -0
  146. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
  147. package/themes/original/src/components/OrderDetails/index.tsx +200 -42
  148. package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
  149. package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
  150. package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
  151. package/themes/original/src/components/OrderProgress/index.tsx +8 -2
  152. package/themes/original/src/components/OrderSummary/index.tsx +1 -34
  153. package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
  154. package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
  155. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +100 -106
  156. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +17 -12
  157. package/themes/original/src/components/OrdersOption/index.tsx +71 -55
  158. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  159. package/themes/original/src/components/PaymentOptions/index.tsx +57 -37
  160. package/themes/original/src/components/PhoneInputNumber/index.tsx +4 -10
  161. package/themes/original/src/components/PlaceSpot/index.tsx +243 -47
  162. package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
  163. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  164. package/themes/original/src/components/ProductForm/index.tsx +712 -655
  165. package/themes/original/src/components/ProductForm/styles.tsx +9 -7
  166. package/themes/original/src/components/ProductItemAccordion/index.tsx +198 -127
  167. package/themes/original/src/components/ProductOption/index.tsx +1 -1
  168. package/themes/original/src/components/ProfessionalFilter/index.tsx +129 -0
  169. package/themes/original/src/components/ProfessionalFilter/styles.tsx +0 -0
  170. package/themes/original/src/components/ProfessionalProfile/index.tsx +309 -0
  171. package/themes/original/src/components/ProfessionalProfile/styles.tsx +46 -0
  172. package/themes/original/src/components/ReviewDriver/index.tsx +6 -6
  173. package/themes/original/src/components/ReviewOrder/index.tsx +18 -3
  174. package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
  175. package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
  176. package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
  177. package/themes/original/src/components/SearchBar/index.tsx +5 -3
  178. package/themes/original/src/components/ServiceForm/index.tsx +631 -0
  179. package/themes/original/src/components/ServiceForm/styles.tsx +50 -0
  180. package/themes/original/src/components/SignupForm/index.tsx +350 -206
  181. package/themes/original/src/components/SingleOrderCard/index.tsx +214 -179
  182. package/themes/original/src/components/SingleProductCard/index.tsx +194 -108
  183. package/themes/original/src/components/SingleProductCard/styles.tsx +2 -2
  184. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  185. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  186. package/themes/original/src/components/StripeElementsForm/index.tsx +15 -7
  187. package/themes/original/src/components/UpsellingProducts/index.tsx +14 -4
  188. package/themes/original/src/components/UserDetails/index.tsx +31 -17
  189. package/themes/original/src/components/UserFormDetails/index.tsx +74 -81
  190. package/themes/original/src/components/UserProfile/index.tsx +57 -29
  191. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  192. package/themes/original/src/components/UserProfileForm/index.tsx +15 -10
  193. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  194. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  195. package/themes/original/src/components/Wallets/index.tsx +174 -162
  196. package/themes/original/src/components/Wallets/styles.tsx +10 -8
  197. package/themes/original/src/components/shared/OBottomPopup.tsx +47 -14
  198. package/themes/original/src/components/shared/OButton.tsx +10 -3
  199. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  200. package/themes/original/src/components/shared/OInput.tsx +3 -2
  201. package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
  202. package/themes/original/src/types/index.tsx +124 -30
  203. package/themes/original/src/utils/index.tsx +77 -0
  204. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -8,6 +8,7 @@ import {
8
8
  Dimensions
9
9
  } from 'react-native';
10
10
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
11
+ import { OButton } from '../shared'
11
12
  import {
12
13
  BusinessTypeFilter as BusinessTypeFilterController,
13
14
  useLanguage,
@@ -17,6 +18,7 @@ import {
17
18
  BusinessCategories,
18
19
  Category,
19
20
  BCContainer,
21
+ ServiceWrapper
20
22
  } from './styles';
21
23
  import { OIcon, OText, OModal } from '../shared';
22
24
  import { BusinessTypeFilterParams } from '../../types';
@@ -28,13 +30,15 @@ export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
28
30
  typesState,
29
31
  currentTypeSelected,
30
32
  handleChangeBusinessType,
31
- setBusinessTypes
33
+ setBusinessTypes,
34
+ isAppoint
32
35
  } = props;
33
36
 
34
37
  const [, t] = useLanguage();
35
38
 
36
39
  const theme = useTheme();
37
40
  const [isOpenAllCategories, setIsOpenAllCategories] = useState(false)
41
+ const defaultImage = (name : string) => theme.images?.categories?.[name.toLowerCase().replace(' ', '')]
38
42
 
39
43
  useEffect(() => {
40
44
  if(typesState?.types?.length > 0){
@@ -42,6 +46,15 @@ export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
42
46
  }
43
47
  }, [typesState])
44
48
 
49
+ const handleChangeServiceType = (serviceId: any) => {
50
+ if (serviceId === currentTypeSelected) {
51
+ handleChangeBusinessType(null)
52
+ return
53
+ }
54
+ handleChangeBusinessType(serviceId)
55
+ isOpenAllCategories && setIsOpenAllCategories(false)
56
+ }
57
+
45
58
  const renderTypes = ({ item }: any) => {
46
59
  return (
47
60
  <TouchableOpacity
@@ -72,48 +85,95 @@ export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
72
85
 
73
86
  return (
74
87
  <>
75
- <BCContainer>
76
- {typesState?.loading && (
77
- <View>
78
- <Placeholder style={{ marginVertical: 10 }} Animation={Fade}>
79
- <ScrollView
80
- horizontal
88
+ {isAppoint ? (
89
+ <>
90
+ {typesState?.loading && (
91
+ <View>
92
+ <Placeholder Animation={Fade}>
93
+ <ScrollView
94
+ horizontal
95
+ showsVerticalScrollIndicator={false}
96
+ showsHorizontalScrollIndicator={false}>
97
+ {[...Array(4)].map((_, i) => (
98
+ <View
99
+ key={i}
100
+ style={{ width: 80, borderRadius: 50, marginRight: 10 }}>
101
+ <PlaceholderLine height={25} noMargin />
102
+ </View>
103
+ ))}
104
+ </ScrollView>
105
+ </Placeholder>
106
+ </View>
107
+ )}
108
+ {
109
+ !typesState?.loading &&
110
+ !typesState?.error &&
111
+ typesState?.types &&
112
+ typesState?.types.length > 0 && (
113
+ <ServiceWrapper
81
114
  showsVerticalScrollIndicator={false}
82
- showsHorizontalScrollIndicator={false}>
83
- {[...Array(4)].map((_, i) => (
84
- <View
115
+ showsHorizontalScrollIndicator={false}
116
+ horizontal
117
+ >
118
+ {typesState?.types.length > 0 && typesState?.types.map((businessType: any, i: number) => (
119
+ <OButton
85
120
  key={i}
86
- style={{ width: 80, borderRadius: 10, marginRight: 15 }}>
87
- <PlaceholderLine height={80} noMargin />
88
- </View>
121
+ bgColor={(currentTypeSelected === businessType?.id) ? theme.colors.primary : theme.colors.backgroundGray200}
122
+ onClick={() => handleChangeServiceType(businessType?.id)}
123
+ text={`${businessType?.name} ${(currentTypeSelected === businessType?.id) ? ' X' : ''}`}
124
+ style={styles.businessType}
125
+ textStyle={{ fontSize: 10, color: (currentTypeSelected === businessType?.id) ? theme.colors.backgroundLight : theme.colors.textNormal }}
126
+ />
89
127
  ))}
90
- </ScrollView>
91
- </Placeholder>
92
- </View>
93
- )}
94
- {!typesState?.loading &&
95
- !typesState?.error &&
96
- typesState?.types &&
97
- typesState?.types.length > 0 && (
98
- <>
99
- <BusinessCategories>
100
- <FlatList
128
+ </ServiceWrapper>
129
+ )
130
+ }
131
+ </>
132
+ ) : (
133
+ <BCContainer>
134
+ {typesState?.loading && (
135
+ <View>
136
+ <Placeholder style={{ marginVertical: 10 }} Animation={Fade}>
137
+ <ScrollView
101
138
  horizontal
102
- showsHorizontalScrollIndicator={false}
103
- data={typesState?.types}
104
- renderItem={renderTypes}
105
- keyExtractor={(type, index) => `${type.name}_${index}`}
106
- />
107
- <TouchableOpacity
108
- style={{ marginLeft: 15 }}
109
- onPress={() => setIsOpenAllCategories(true)}
110
- >
111
- <OText size={12} color={theme.colors.primary}>{t('SEE_ALL', 'See All')}</OText>
112
- </TouchableOpacity>
113
- </BusinessCategories>
114
- </>
139
+ showsVerticalScrollIndicator={false}
140
+ showsHorizontalScrollIndicator={false}>
141
+ {[...Array(4)].map((_, i) => (
142
+ <View
143
+ key={i}
144
+ style={{ width: 80, borderRadius: 10, marginRight: 15 }}>
145
+ <PlaceholderLine height={80} noMargin />
146
+ </View>
147
+ ))}
148
+ </ScrollView>
149
+ </Placeholder>
150
+ </View>
115
151
  )}
116
- </BCContainer>
152
+ {!typesState?.loading &&
153
+ !typesState?.error &&
154
+ typesState?.types &&
155
+ typesState?.types.length > 0 && (
156
+ <>
157
+ <BusinessCategories>
158
+ <FlatList
159
+ horizontal
160
+ showsHorizontalScrollIndicator={false}
161
+ data={typesState?.types}
162
+ renderItem={renderTypes}
163
+ keyExtractor={(type, index) => `${type.name}_${index}`}
164
+ />
165
+ <TouchableOpacity
166
+ style={{ marginLeft: 15 }}
167
+ onPress={() => setIsOpenAllCategories(true)}
168
+ >
169
+ <OText size={12} color={theme.colors.primary}>{t('SEE_ALL', 'See All')}</OText>
170
+ </TouchableOpacity>
171
+ </BusinessCategories>
172
+ </>
173
+ )}
174
+ </BCContainer>
175
+ )}
176
+
117
177
  <OModal
118
178
  open={isOpenAllCategories}
119
179
  onClose={() => setIsOpenAllCategories(false)}
@@ -138,9 +198,9 @@ export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
138
198
  isOpenAllCategories && setIsOpenAllCategories(false)
139
199
  }}
140
200
  >
141
- {item.image ? (
201
+ {(defaultImage(item.name) || item.image) ? (
142
202
  <OIcon
143
- url={item.image}
203
+ url={typeof item.name === 'number' ? item.image || defaultImage(item.name) : defaultImage(item.name) || item.image}
144
204
  style={styles.logo}
145
205
  />
146
206
  ) : (
@@ -195,6 +255,15 @@ const styles = StyleSheet.create({
195
255
  allCategoriesWrapper: {
196
256
  flexDirection: 'row',
197
257
  flexWrap: 'wrap',
258
+ },
259
+ businessType: {
260
+ marginRight: 10,
261
+ borderRadius: 50,
262
+ paddingVertical: 4,
263
+ paddingLeft: 5,
264
+ paddingRight: 5,
265
+ height: 27,
266
+ borderWidth: 0
198
267
  }
199
268
  });
200
269
 
@@ -39,3 +39,5 @@ export const IconContainer = styled.View`
39
39
  border-radius: 10px;
40
40
  height: 60px;
41
41
  `
42
+
43
+ export const ServiceWrapper = styled.ScrollView``