ordering-ui-react-native 0.21.31-testing → 0.21.32-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 (215) hide show
  1. package/package.json +7 -6
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/PaymentOptionsWebView/index.tsx +1 -0
  5. package/src/components/StripeMethodForm/index.tsx +6 -4
  6. package/src/components/VerifyPhone/styles.tsx +1 -2
  7. package/src/types/index.tsx +3 -1
  8. package/src/utils/index.tsx +2 -2
  9. package/themes/business/index.tsx +4 -0
  10. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
  11. package/themes/business/src/components/BusinessController/index.tsx +19 -17
  12. package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
  13. package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
  14. package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
  15. package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
  16. package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
  17. package/themes/business/src/components/Chat/index.tsx +23 -14
  18. package/themes/business/src/components/DriverMap/index.tsx +36 -23
  19. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  20. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  21. package/themes/business/src/components/Home/index.tsx +5 -1
  22. package/themes/business/src/components/LanguageSelector/index.tsx +1 -2
  23. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  24. package/themes/business/src/components/MapView/index.tsx +16 -9
  25. package/themes/business/src/components/MessagesOption/index.tsx +2 -1
  26. package/themes/business/src/components/NewOrderNotification/index.tsx +163 -115
  27. package/themes/business/src/components/OrderDetails/Business.tsx +50 -2
  28. package/themes/business/src/components/OrderDetails/Delivery.tsx +23 -11
  29. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +61 -54
  30. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +52 -20
  31. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
  32. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
  33. package/themes/business/src/components/OrderSummary/index.tsx +240 -76
  34. package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
  35. package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
  36. package/themes/business/src/components/OrdersOption/index.tsx +125 -130
  37. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  38. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +36 -38
  39. package/themes/business/src/components/PreviousOrders/OrderList.tsx +18 -13
  40. package/themes/business/src/components/PreviousOrders/index.tsx +80 -66
  41. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  42. package/themes/business/src/components/PrinterSettings/index.tsx +279 -0
  43. package/themes/business/src/components/PrinterSettings/styles.tsx +17 -0
  44. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  45. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  46. package/themes/business/src/components/SearchBar/index.tsx +2 -1
  47. package/themes/business/src/components/Sessions/index.tsx +187 -0
  48. package/themes/business/src/components/Sessions/styles.tsx +20 -0
  49. package/themes/business/src/components/StoresList/index.tsx +5 -3
  50. package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
  51. package/themes/business/src/components/UserProfileForm/index.tsx +107 -53
  52. package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
  53. package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
  54. package/themes/business/src/components/shared/OInput.tsx +2 -0
  55. package/themes/business/src/hooks/useLocation.tsx +5 -4
  56. package/themes/business/src/types/index.tsx +15 -2
  57. package/themes/business/src/utils/index.tsx +5 -0
  58. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  59. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  60. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  61. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  62. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -4
  63. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  64. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  65. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  66. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  67. package/themes/original/index.tsx +9 -4
  68. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  69. package/themes/original/src/components/AddressForm/index.tsx +27 -12
  70. package/themes/original/src/components/AddressForm/styles.tsx +1 -1
  71. package/themes/original/src/components/AddressList/index.tsx +18 -4
  72. package/themes/original/src/components/AddressList/styles.tsx +4 -4
  73. package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
  74. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  75. package/themes/original/src/components/BusinessBasicInformation/index.tsx +7 -10
  76. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
  77. package/themes/original/src/components/BusinessController/index.tsx +18 -10
  78. package/themes/original/src/components/BusinessController/styles.tsx +8 -7
  79. package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
  80. package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
  81. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
  82. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
  83. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
  84. package/themes/original/src/components/BusinessListingSearch/index.tsx +47 -358
  85. package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
  86. package/themes/original/src/components/BusinessPreorder/index.tsx +2 -3
  87. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
  88. package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
  89. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  90. package/themes/original/src/components/BusinessProductsListing/index.tsx +35 -19
  91. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
  92. package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
  93. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  94. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
  95. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  96. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  97. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  98. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +24 -404
  99. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  100. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  101. package/themes/original/src/components/Cart/index.tsx +32 -9
  102. package/themes/original/src/components/CartContent/index.tsx +96 -58
  103. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  104. package/themes/original/src/components/Checkout/index.tsx +160 -63
  105. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  106. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  107. package/themes/original/src/components/DatePicker/index.tsx +33 -0
  108. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  109. package/themes/original/src/components/Favorite/index.tsx +9 -9
  110. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  111. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  112. package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -0
  113. package/themes/original/src/components/GPSButton/index.tsx +1 -1
  114. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  115. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  116. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  117. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
  118. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
  119. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
  120. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  121. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
  122. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  123. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  124. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  125. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
  126. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  127. package/themes/original/src/components/GoogleMap/index.tsx +6 -5
  128. package/themes/original/src/components/Help/index.tsx +7 -0
  129. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +5 -0
  130. package/themes/original/src/components/HelpGuide/index.tsx +5 -0
  131. package/themes/original/src/components/HelpOrder/index.tsx +5 -0
  132. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
  133. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  134. package/themes/original/src/components/Home/index.tsx +2 -1
  135. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  136. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  137. package/themes/original/src/components/LoginForm/Otp/index.tsx +4 -16
  138. package/themes/original/src/components/LoginForm/index.tsx +8 -3
  139. package/themes/original/src/components/MessageListing/index.tsx +6 -0
  140. package/themes/original/src/components/Messages/index.tsx +9 -7
  141. package/themes/original/src/components/Messages/styles.tsx +1 -1
  142. package/themes/original/src/components/MomentOption/index.tsx +19 -4
  143. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  144. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +1 -0
  145. package/themes/original/src/components/MultiCheckout/index.tsx +208 -21
  146. package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
  147. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -15
  148. package/themes/original/src/components/MyOrders/index.tsx +28 -28
  149. package/themes/original/src/components/NavBar/index.tsx +5 -1
  150. package/themes/original/src/components/NetworkError/index.tsx +2 -3
  151. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  152. package/themes/original/src/components/Notifications/index.tsx +9 -8
  153. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  154. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +1 -1
  155. package/themes/original/src/components/OrderDetails/index.tsx +709 -665
  156. package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
  157. package/themes/original/src/components/OrderProgress/index.tsx +24 -4
  158. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  159. package/themes/original/src/components/OrderSummary/index.tsx +3 -1
  160. package/themes/original/src/components/OrderTypeSelector/index.tsx +10 -6
  161. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  162. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  163. package/themes/original/src/components/OrdersOption/index.tsx +3 -5
  164. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  165. package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
  166. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
  167. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  168. package/themes/original/src/components/PaymentOptions/index.tsx +51 -6
  169. package/themes/original/src/components/PreviousOrders/index.tsx +2 -0
  170. package/themes/original/src/components/ProductForm/ActionButton.tsx +122 -0
  171. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  172. package/themes/original/src/components/ProductForm/index.tsx +67 -155
  173. package/themes/original/src/components/ProductItemAccordion/index.tsx +54 -44
  174. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
  175. package/themes/original/src/components/ProductOptionSubOption/index.tsx +105 -91
  176. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  177. package/themes/original/src/components/Promotions/index.tsx +13 -11
  178. package/themes/original/src/components/Promotions/styles.tsx +0 -2
  179. package/themes/original/src/components/ReviewDriver/index.tsx +5 -0
  180. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  181. package/themes/original/src/components/ReviewOrder/index.tsx +5 -0
  182. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  183. package/themes/original/src/components/ReviewProducts/index.tsx +5 -0
  184. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  185. package/themes/original/src/components/ServiceForm/index.tsx +2 -2
  186. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  187. package/themes/original/src/components/Sessions/index.tsx +5 -0
  188. package/themes/original/src/components/SignupForm/index.tsx +66 -59
  189. package/themes/original/src/components/SingleOrderCard/index.tsx +3 -2
  190. package/themes/original/src/components/SingleProductCard/index.tsx +2 -2
  191. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  192. package/themes/original/src/components/StripeCardsList/index.tsx +17 -36
  193. package/themes/original/src/components/StripeElementsForm/index.tsx +74 -59
  194. package/themes/original/src/components/StripeElementsForm/naked.tsx +47 -0
  195. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  196. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
  197. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
  198. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  199. package/themes/original/src/components/UserFormDetails/index.tsx +123 -75
  200. package/themes/original/src/components/UserFormDetails/styles.tsx +7 -0
  201. package/themes/original/src/components/UserProfile/index.tsx +3 -2
  202. package/themes/original/src/components/UserProfileForm/index.tsx +5 -0
  203. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  204. package/themes/original/src/components/Wallets/index.tsx +8 -4
  205. package/themes/original/src/components/Wallets/styles.tsx +1 -1
  206. package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
  207. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  208. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  209. package/themes/original/src/components/shared/OButton.tsx +5 -5
  210. package/themes/original/src/components/shared/OInput.tsx +1 -4
  211. package/themes/original/src/components/shared/OModal.tsx +12 -14
  212. package/themes/original/src/layouts/Container.tsx +5 -3
  213. package/themes/original/src/types/index.tsx +1 -0
  214. package/themes/original/src/utils/index.tsx +12 -1
  215. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -4,6 +4,7 @@ import { OIcon, OButton, OText } from '../shared'
4
4
  import { ImageStyle, TextStyle, View, Platform, TouchableOpacity } from 'react-native'
5
5
  import { useConfig, useLanguage, useOrder } from 'ordering-components/native'
6
6
  import { useTheme } from 'styled-components/native'
7
+
7
8
  const Wrapper = styled.View`
8
9
  background-color: ${(props: any) => props.theme.colors.white};
9
10
  padding: 10px 0px 20px 0px;
@@ -65,28 +66,27 @@ const NavBar = (props: Props) => {
65
66
 
66
67
  return (
67
68
  <Wrapper style={{ paddingTop: props.paddingTop, ...props.style }}>
68
- {(props?.onActionLeft) && (
69
+ {(props?.onActionLeft || props?.leftImg) && (
69
70
  <OButton
70
- imgLeftSrc={props.leftImg}
71
+ imgLeftSrc={props.leftImg || theme.images.general.arrow_left}
71
72
  imgRightSrc={null}
72
73
  style={{ ...btnBackArrow, ...props.btnStyle }}
73
74
  onClick={props.onActionLeft}
74
- imgLeftStyle={props.imgLeftStyle}
75
- {...(!props.leftImg && { iconProps: { name: 'arrowleft', size: 28, color: props.btnStyle?.color } })}
75
+ imgLeftStyle= {props.imgLeftStyle}
76
76
  />)
77
77
  }
78
78
  <TitleTopWrapper>
79
79
  {props.withIcon
80
80
  ? (
81
- <OIcon
82
- url={props.icon}
83
- style={{
84
- borderColor: theme.colors.lightGray,
85
- borderRadius: 20,
86
- }}
87
- width={60}
88
- height={60}
89
- />
81
+ <OIcon
82
+ url={props.icon}
83
+ style={{
84
+ borderColor: theme.colors.lightGray,
85
+ borderRadius: 20,
86
+ }}
87
+ width={60}
88
+ height={60}
89
+ />
90
90
  )
91
91
  : null
92
92
  }
@@ -134,7 +134,7 @@ const NavBar = (props: Props) => {
134
134
  </View>
135
135
  )}
136
136
 
137
- {props.rightComponent}
137
+ { props.rightComponent }
138
138
  </Wrapper>
139
139
  )
140
140
  }
@@ -95,7 +95,7 @@ interface Props {
95
95
  style?: ViewStyle;
96
96
  bgImage: ImageSourcePropType;
97
97
  innerStyle?: ViewStyle;
98
- icon?: ImageSourcePropType;
98
+ icon: ImageSourcePropType;
99
99
  iconStyle?: ImageStyle;
100
100
  callToActionText: string;
101
101
  callToActionTextStyle?: TextStyle;
@@ -15,8 +15,6 @@ import { Container } from '../../layouts/Container'
15
15
  import NavBar from '../NavBar'
16
16
  import { LANDSCAPE, PORTRAIT, useDeviceOrientation } from '../../../../../src/hooks/DeviceOrientation'
17
17
  import GridContainer from '../../layouts/GridContainer'
18
- import AntDesignIcon from 'react-native-vector-icons/AntDesign'
19
- import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons'
20
18
 
21
19
  const OrderTypeSelectorCardUI = (props: OrderTypeSelectParams) => {
22
20
  const {
@@ -29,7 +27,7 @@ const OrderTypeSelectorCardUI = (props: OrderTypeSelectParams) => {
29
27
  callback
30
28
  } = props
31
29
 
32
- const theme = useTheme();
30
+ const theme = useTheme();
33
31
  const [, t] = useLanguage();
34
32
  const [orientationState] = useDeviceOrientation();
35
33
  const [orderState] = useOrder()
@@ -47,7 +45,7 @@ const OrderTypeSelectorCardUI = (props: OrderTypeSelectParams) => {
47
45
  }
48
46
 
49
47
  useEffect(() => {
50
- if (isCardCliked) {
48
+ if(isCardCliked){
51
49
  callback?.()
52
50
  setIsCardClicked(false)
53
51
  setIsLoadingCard(null)
@@ -85,13 +83,13 @@ const OrderTypeSelectorCardUI = (props: OrderTypeSelectParams) => {
85
83
  style={cardStyle}
86
84
  isDisabled={isCardCliked}
87
85
  isLoading={isLoadingCard === 'Eat In'}
88
- title={t('EAT_IN', 'Eat In')}
86
+ title={t('EAT_IN','Eat In')}
89
87
  description={t('EAT_IN_DESCRIPTION', 'We are very glad to have you here. Bon appetit!')}
90
88
  bgImage={theme.images.general.eatIn}
91
- VectorIcon={() => <MaterialIcon name='pin-outline' size={28} color='white' style={{ marginBottom: 10 }} />}
89
+ icon={theme.images.general.pushPin}
92
90
  callToActionText={t('START_MY_ORDER', 'Start my order')}
93
91
  onClick={() => {
94
- if (_eatIn?.value !== orderState?.options?.type) {
92
+ if(_eatIn?.value !== orderState?.options?.type){
95
93
  handleChangeOrderType(_eatIn?.value);
96
94
  setIsCardClicked(true)
97
95
  setIsLoadingCard('Eat In')
@@ -108,15 +106,15 @@ const OrderTypeSelectorCardUI = (props: OrderTypeSelectParams) => {
108
106
 
109
107
  <OptionCard
110
108
  style={cardStyle}
111
- title={t('TAKE_OUT', 'Take out')}
109
+ title={t('TAKE_OUT','Take out')}
112
110
  isDisabled={isCardCliked}
113
111
  isLoading={isLoadingCard === 'Take out'}
114
112
  description={t('TAKE_OUT_DESCRIPTION', 'You are very welcome anytime you visit us!')}
115
113
  bgImage={theme.images.general.takeOut}
116
- VectorIcon={() => <AntDesignIcon name='shoppingcart' size={28} color='white' style={{ marginBottom: 10 }} />}
114
+ icon={theme.images.general.shoppingCart}
117
115
  callToActionText={t('START_MY_ORDER', 'Start my order')}
118
116
  onClick={() => {
119
- if (_takeOut?.value !== orderState?.options?.type) {
117
+ if(_takeOut?.value !== orderState?.options?.type){
120
118
  handleChangeOrderType(_takeOut?.value);
121
119
  setIsCardClicked(true)
122
120
  setIsLoadingCard('Take out')
@@ -10,8 +10,6 @@ import {
10
10
 
11
11
  import * as React from 'react';
12
12
  import styled from 'styled-components/native';
13
- import AntDesignIcon from 'react-native-vector-icons/AntDesign'
14
- import { Icon, IconProps } from 'react-native-vector-icons/Icon';
15
13
 
16
14
  const StyledButton = styled.View<Props>`
17
15
  background-color: ${(props: any) => props.theme.colors.primary};
@@ -79,19 +77,17 @@ interface Props {
79
77
  isCircle?: boolean;
80
78
  bgColor?: string;
81
79
  borderColor?: string;
82
- iconProps?: IconProps;
83
- IconCustom?: React.FunctionComponent
84
80
  }
85
81
 
86
82
  const OButton = (props: Props): React.ReactElement => {
87
83
  if (props.isDisabled) {
88
84
  return (
89
85
  <View style={props.parentStyle}>
90
- <StyledButtonDisabled style={props.style}>
91
- <StyledTextDisabled style={props.disabledTextStyle ? props.disabledTextStyle : props.textStyle}>
92
- {props.text}
93
- </StyledTextDisabled>
94
- </StyledButtonDisabled>
86
+ <StyledButtonDisabled style={props.style}>
87
+ <StyledTextDisabled style={props.disabledTextStyle ? props.disabledTextStyle : props.textStyle}>
88
+ {props.text}
89
+ </StyledTextDisabled>
90
+ </StyledButtonDisabled>
95
91
  </View>
96
92
  );
97
93
  }
@@ -115,15 +111,6 @@ const OButton = (props: Props): React.ReactElement => {
115
111
  {props.imgLeftSrc ? (
116
112
  <StyledImage style={props.imgLeftStyle} source={props.imgLeftSrc} />
117
113
  ) : null}
118
- {props.iconProps ? (
119
- <>
120
- {props?.IconCustom ? (
121
- <props.IconCustom {...props.iconProps} />
122
- ) : (
123
- <AntDesignIcon {...props.iconProps} />
124
- )}
125
- </>
126
- ) : null}
127
114
  {props.text ? (
128
115
  <StyledText style={props.textStyle}>{props.text}</StyledText>
129
116
  ) : null}
@@ -96,10 +96,11 @@ import { LogoutButton } from './src/components/LogoutButton';
96
96
  import { UserFormDetailsUI } from './src/components/UserFormDetails';
97
97
  import { WalletTransactionItem } from './src/components/WalletTransactionItem';
98
98
  import { Promotions } from './src/components/Promotions'
99
- import { PageBanner } from './src/components/PageBanner'
100
99
  import { MultiCart } from './src/components/MultiCart'
100
+ import { PageBanner } from './src/components/PageBanner'
101
101
  import { USER_TYPE, ORDER_TYPES } from './src/config/constants'
102
-
102
+ import { DatePickerUI } from './src/components/DatePicker'
103
+ import { WebsocketStatus } from './src/components/WebsocketStatus';
103
104
  import { OSBill, OSTable, OSCoupon, OSTotal, OSRow } from './src/components/OrderSummary/styles';
104
105
 
105
106
  import { FormInput, FormSide, ButtonsWrapper, LoginWith, OTab, OTabs } from './src/components/LoginForm/styles';
@@ -263,7 +264,8 @@ export {
263
264
  Promotions,
264
265
  PageBanner,
265
266
  MyOrders,
266
- MultiCart,
267
+ MultiCart,
268
+ WebsocketStatus,
267
269
  ORDER_TYPES,
268
270
  USER_TYPE,
269
271
 
@@ -340,5 +342,8 @@ export {
340
342
  _retrieveStoreData,
341
343
  _setStoreData,
342
344
  _removeStoreData,
343
- _clearStoreData
345
+ _clearStoreData,
346
+
347
+ // Date Picker
348
+ DatePickerUI
344
349
  }
@@ -1,30 +1,40 @@
1
1
  import React from 'react';
2
2
  import FastImage from 'react-native-fast-image'
3
- import { StyleSheet, TouchableOpacity, View } from 'react-native';
3
+ import { StyleSheet, TouchableOpacity, useWindowDimensions } from 'react-native';
4
4
  import {
5
5
  AddressDetails as AddressDetailsController,
6
6
  useOrder,
7
7
  useLanguage,
8
8
  } from 'ordering-components/native';
9
+ import { useTheme } from 'styled-components/native';
9
10
 
10
11
  import { ADContainer, ADHeader, ADAddress, ADMap } from './styles';
11
-
12
- import { useTheme } from 'styled-components/native';
13
- import { OText, OIcon } from '../shared';
14
- import { useWindowDimensions } from 'react-native';
12
+ import { OText } from '../shared';
13
+ import { getTypesText } from '../../utils';
15
14
 
16
15
  const AddressDetailsUI = (props: any) => {
17
- const { navigation, addressToShow, isCartPending, googleMapsUrl, apiKey } =
18
- props;
16
+ const {
17
+ navigation,
18
+ addressToShow,
19
+ isCartPending,
20
+ googleMapsUrl,
21
+ apiKey
22
+ } = props;
19
23
 
20
24
  const theme = useTheme();
21
25
  const [orderState] = useOrder();
26
+ const [{ options }] = useOrder();
22
27
  const [, t] = useLanguage();
23
28
  const { width } = useWindowDimensions();
24
29
 
30
+ const orderTypeText = {
31
+ key: getTypesText(options?.type || 1),
32
+ value: t(getTypesText(options?.type || 1), 'Delivery')
33
+ }
34
+
25
35
  const styles = StyleSheet.create({
26
36
  productStyle: {
27
- width: width,
37
+ width,
28
38
  height: 151,
29
39
  marginVertical: 10
30
40
  }
@@ -39,13 +49,13 @@ const AddressDetailsUI = (props: any) => {
39
49
  lineHeight={24}
40
50
  color={theme.colors.textNormal}
41
51
  >
42
- {t('DELIVERY_ADDRESS', 'Delivery address')}
52
+ {t(`${orderTypeText.key}_ADDRESS`, `${orderTypeText.value} address`)}
43
53
  </OText>
44
54
  )}
45
55
  </ADHeader>
46
56
  {!!apiKey && googleMapsUrl && (
47
57
  <ADMap
48
- style={{ marginStart: -40, marginEnd: -40, width: width, flex: 1 }}>
58
+ style={{ width, flex: 1, marginStart: -20, marginEnd: -20, }}>
49
59
  <FastImage
50
60
  style={styles.productStyle}
51
61
  source={{
@@ -66,7 +66,8 @@ const AddressFormUI = (props: AddressFormParams) => {
66
66
  isFromProductsList,
67
67
  hasAddressDefault,
68
68
  afterSignup,
69
- businessSlug
69
+ businessSlug,
70
+ isFromCheckout
70
71
  } = props;
71
72
 
72
73
  const theme = useTheme();
@@ -122,8 +123,8 @@ const AddressFormUI = (props: AddressFormParams) => {
122
123
  width: 16
123
124
  },
124
125
  wrapperNavbar: Platform.OS === 'ios'
125
- ? { paddingVertical: 0, paddingLeft: 40, paddingRight: 20 }
126
- : { paddingVertical: 10, paddingLeft: 40, paddingRight: 20 }
126
+ ? { paddingVertical: 0, paddingLeft: 20, paddingRight: 20 }
127
+ : { paddingVertical: 10, paddingLeft: 20, paddingRight: 20 }
127
128
  });
128
129
 
129
130
  const [, t] = useLanguage();
@@ -371,6 +372,10 @@ const AddressFormUI = (props: AddressFormParams) => {
371
372
  setToggleMap(!toggleMap);
372
373
  };
373
374
 
375
+ const showFieldWithTheme = (name) => {
376
+ return !theme?.address?.components?.[name]?.hidden
377
+ }
378
+
374
379
  useEffect(() => {
375
380
  if (
376
381
  orderState.loading &&
@@ -379,9 +384,11 @@ const AddressFormUI = (props: AddressFormParams) => {
379
384
  auth &&
380
385
  !afterSignup
381
386
  ) {
382
- !isFromProductsList
383
- ? navigation.navigate('BottomTab')
384
- : navigation.navigate('Business');
387
+ isFromCheckout
388
+ ? navigation.goBack()
389
+ : !isFromProductsList
390
+ ? navigation.navigate('BottomTab')
391
+ : navigation.navigate('Business');
385
392
  }
386
393
  }, [orderState?.options?.address]);
387
394
 
@@ -535,6 +542,11 @@ const AddressFormUI = (props: AddressFormParams) => {
535
542
  style={{ marginTop: Platform.OS === 'ios' ? 0 : 10 }}
536
543
  titleWrapStyle={{ paddingHorizontal: 0, width: '100%' }}
537
544
  titleStyle={{ marginRight: 0, marginLeft: 0, paddingRight: 5 }}
545
+ buttonProps={{
546
+ bgColor: theme.colors.white,
547
+ borderColor: theme.colors.white,
548
+ textStyle: { color: theme.colors.btnFont }
549
+ }}
538
550
  />
539
551
  </View>
540
552
  <TouchableWithoutFeedback onPress={Keyboard.dismiss}>
@@ -672,7 +684,7 @@ const AddressFormUI = (props: AddressFormParams) => {
672
684
  )}
673
685
 
674
686
  <View style={{ flexDirection: 'row', flexBasis: '50%' }}>
675
- {showField && showField('internal_number') && (
687
+ {((isRequiredField && isRequiredField('internal_number')) || showFieldWithTheme('internal_number')) && (
676
688
  <Controller
677
689
  control={control}
678
690
  name="internal_number"
@@ -708,7 +720,7 @@ const AddressFormUI = (props: AddressFormParams) => {
708
720
  isFocusHighlight
709
721
  style={{
710
722
  ...styles.inputsStyle,
711
- marginRight: showField('internal_number') && showField('zipcode') ? 24 : 0
723
+ marginRight: showField?.('internal_number') && showField?.('zipcode') ? 24 : 0
712
724
  }}
713
725
  forwardRef={internalNumberRef}
714
726
  returnKeyType="next"
@@ -719,7 +731,7 @@ const AddressFormUI = (props: AddressFormParams) => {
719
731
  />
720
732
  )}
721
733
 
722
- {showField && showField('zipcode') && (
734
+ {((isRequiredField && isRequiredField('zipcode')) || showFieldWithTheme('zipcode')) && (
723
735
  <Controller
724
736
  control={control}
725
737
  name="zipcode"
@@ -764,7 +776,7 @@ const AddressFormUI = (props: AddressFormParams) => {
764
776
  )}
765
777
  </View>
766
778
 
767
- {showField && showField('address_notes') && (
779
+ {((isRequiredField && isRequiredField('address_notes')) || showFieldWithTheme('address_notes')) && (
768
780
  <Controller
769
781
  control={control}
770
782
  name="address_notes"
@@ -855,8 +867,9 @@ const AddressFormUI = (props: AddressFormParams) => {
855
867
  ) : (
856
868
  <OButton
857
869
  text={t('CANCEL', 'Cancel')}
858
- bgColor={theme.colors.white}
859
- borderColor={theme.colors.primary}
870
+ bgColor={theme.colors.secundary}
871
+ borderColor={theme.colors.secundary}
872
+ textStyle={{ color: theme.colors.black }}
860
873
  style={{ borderRadius: 7.6, borderWidth: 1, shadowOpacity: 0 }}
861
874
  onClick={() => navigation?.canGoBack() && navigation.goBack()}
862
875
  />
@@ -883,6 +896,8 @@ const AddressFormUI = (props: AddressFormParams) => {
883
896
  <OButton
884
897
  text={t('SAVE', 'Save')}
885
898
  textStyle={{ color: theme.colors.white }}
899
+ bgColor={theme.colors.primary}
900
+ borderColor={theme.colors.primary}
886
901
  imgRightSrc={null}
887
902
  style={{ marginHorizontal: 30, marginBottom: 10 }}
888
903
  onClick={() => setSaveMapLocation(true)}
@@ -2,7 +2,7 @@ import styled from 'styled-components/native'
2
2
 
3
3
  export const AddressFormContainer = styled.View`
4
4
  flex: 1;
5
- padding: 0px 40px 20px;
5
+ padding: 0px 20px 20px;
6
6
  background-color: ${(props: any) => props.theme.colors.backgroundPage};
7
7
  justify-content: space-between;
8
8
  `
@@ -152,6 +152,11 @@ const AddressListUI = (props: AddressListParams) => {
152
152
  showCall={false}
153
153
  paddingTop={10}
154
154
  btnStyle={{ paddingLeft: 0 }}
155
+ buttonProps={{
156
+ bgColor: theme.colors.white,
157
+ borderColor: theme.colors.white,
158
+ textStyle: { color: theme.colors.btnFont }
159
+ }}
155
160
  />
156
161
  )}
157
162
  {
@@ -173,6 +178,11 @@ const AddressListUI = (props: AddressListParams) => {
173
178
  style={{ marginTop: 0 }}
174
179
  titleWrapStyle={{ paddingHorizontal: 0 }}
175
180
  titleStyle={{ marginLeft: 0, marginRight: 0 }}
181
+ buttonProps={{
182
+ bgColor: theme.colors.white,
183
+ borderColor: theme.colors.white,
184
+ textStyle: { color: theme.colors.btnFont }
185
+ }}
176
186
  />
177
187
  )}
178
188
  {addressList.loading && addressList?.addresses?.length === 0 && (
@@ -217,7 +227,8 @@ const AddressListUI = (props: AddressListParams) => {
217
227
  onSaveAddress: handleSaveAddress,
218
228
  isSelectedAfterAdd: true,
219
229
  isFromProductsList: isFromProductsList,
220
- hasAddressDefault: !!orderState.options?.address?.location
230
+ hasAddressDefault: !!orderState.options?.address?.location,
231
+ isFromCheckout: route?.params?.isFromCheckout
221
232
  }
222
233
  ) : onNavigationRedirect(
223
234
  'AddressFormInitial',
@@ -228,7 +239,8 @@ const AddressListUI = (props: AddressListParams) => {
228
239
  onSaveAddress: handleSaveAddress,
229
240
  isSelectedAfterAdd: true,
230
241
  isFromProductsList: isFromProductsList,
231
- hasAddressDefault: !!orderState.options?.address?.location
242
+ hasAddressDefault: !!orderState.options?.address?.location,
243
+ isFromCheckout: route?.params?.isFromCheckout
232
244
  })}
233
245
  >
234
246
  <OIcon src={theme.images.general.pencil} width={16} style={{ marginHorizontal: 4 }} />
@@ -305,7 +317,8 @@ const AddressListUI = (props: AddressListParams) => {
305
317
  addressesList: addressList?.addresses,
306
318
  nopadding: true,
307
319
  isSelectedAfterAdd: true,
308
- hasAddressDefault: !!orderState.options?.address?.location
320
+ hasAddressDefault: !!orderState.options?.address?.location,
321
+ isFromCheckout: route?.params?.isFromCheckout
309
322
  }) : onNavigationRedirect(
310
323
  'AddressFormInitial',
311
324
  {
@@ -314,7 +327,8 @@ const AddressListUI = (props: AddressListParams) => {
314
327
  addressesList: addressList?.addresses,
315
328
  nopadding: true,
316
329
  isSelectedAfterAdd: true,
317
- hasAddressDefault: !!orderState.options?.address?.location
330
+ hasAddressDefault: !!orderState.options?.address?.location,
331
+ isFormCheckout: route?.params?.isFromCheckout
318
332
  })}
319
333
  />
320
334
  </>
@@ -3,10 +3,10 @@ import styled from 'styled-components/native'
3
3
  export const Container = styled.ScrollView`
4
4
  position: relative;
5
5
  flex: 1;
6
- paddingLeft: 40px;
7
- paddingRight: 40px;
8
- margin-bottom: 40px;
9
- padding-top: 10px;
6
+ paddingLeft: 20px;
7
+ paddingRight: 20px;
8
+ margin-bottom: 40px;
9
+ padding-top: 10px;
10
10
  `
11
11
 
12
12
  export const AddressItem = styled.TouchableOpacity`
@@ -23,8 +23,7 @@ export const AnalyticsSegment = (props: any) => {
23
23
  segmentClient.track('Product List Viewed', {
24
24
  business_id: category?.business_id,
25
25
  category_id: category?.id,
26
- category: category?.name,
27
- products: category?.products
26
+ category: category?.name
28
27
  })
29
28
  }
30
29
 
@@ -62,11 +61,12 @@ export const AnalyticsSegment = (props: any) => {
62
61
  })
63
62
  }
64
63
 
65
- const handleProductAdded = (product: any) => {
64
+ const handleProductAdded = (product: any, result: any) => {
66
65
  segmentClient.track('Product Added', {
67
- id: product.id,
66
+ cart_id: result.uuid,
67
+ product_id: product.id,
68
68
  name: product.name,
69
- category: product.category_id,
69
+ category: product.category_id || product?.categoryId,
70
70
  price: product.price,
71
71
  quantity: product.quantity
72
72
  })
@@ -101,7 +101,7 @@ export const AnalyticsSegment = (props: any) => {
101
101
 
102
102
  const handleOrderPlaced = (order: any) => {
103
103
  segmentClient.track('Order Placed', {
104
- id: order.id,
104
+ order_id: order.id,
105
105
  affiliation: order.business?.name,
106
106
  revenue: order.total,
107
107
  tax: order.tax_total,
@@ -21,7 +21,7 @@ export const AppleLogin = (props: any) => {
21
21
  const [{ configs }] = useConfig();
22
22
  const [credentialStateForUser, updateCredentialStateForUser] = useState<any>(-1);
23
23
 
24
- let user : any= null
24
+ let user: any = null
25
25
 
26
26
  const buttonText = auth
27
27
  ? t('CONTINUE_WITH_APPLE', 'Logout with Apple')
@@ -53,7 +53,7 @@ export const AppleLogin = (props: any) => {
53
53
  }
54
54
  }
55
55
 
56
- const fetchAndUpdateCredentialState = async (updateCredentialStateForUser : any) => {
56
+ const fetchAndUpdateCredentialState = async (updateCredentialStateForUser: any) => {
57
57
  if (user === null) {
58
58
  updateCredentialStateForUser('N/A');
59
59
  } else {
@@ -66,7 +66,7 @@ export const AppleLogin = (props: any) => {
66
66
  }
67
67
  }
68
68
 
69
- const onIOSButtonPress = async (updateCredentialStateForUser : any) => {
69
+ const onIOSButtonPress = async (updateCredentialStateForUser: any) => {
70
70
  try {
71
71
  const appleAuthRequestResponse = await appleAuth.performRequest({
72
72
  requestedOperation: appleAuth.Operation.LOGIN,
@@ -79,7 +79,7 @@ export const AppleLogin = (props: any) => {
79
79
  identityToken,
80
80
  authorizationCode
81
81
  } = appleAuthRequestResponse;
82
-
82
+
83
83
  user = newUser;
84
84
 
85
85
  fetchAndUpdateCredentialState(updateCredentialStateForUser).catch(error =>
@@ -26,7 +26,6 @@ import {
26
26
  SocialListWrapper
27
27
  } from './styles';
28
28
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
29
- const types = ['food', 'laundry', 'alcohol', 'groceries'];
30
29
 
31
30
  let BusinessInformation: null | React.ElementType = null
32
31
  let BusinessReviews: null | React.ElementType = null
@@ -36,6 +35,7 @@ export const BusinessBasicInformation = (
36
35
  ) => {
37
36
  const { navigation, businessState, isBusinessInfoShow, logo, header, isPreOrder } = props;
38
37
  const { business, loading } = businessState;
38
+ const types = business?.types && business?.types?.filter(({ enabled }) => (enabled)).map(({ name }) => (name))
39
39
 
40
40
  const theme = useTheme();
41
41
  const [orderState] = useOrder();
@@ -72,7 +72,7 @@ export const BusinessBasicInformation = (
72
72
  alignItems: 'flex-start'
73
73
  },
74
74
  businessInfo: {
75
- paddingHorizontal: 40,
75
+ paddingHorizontal: 20,
76
76
  paddingTop: isChewLayout ? 0 : 56,
77
77
  },
78
78
  bullet: {
@@ -95,7 +95,7 @@ export const BusinessBasicInformation = (
95
95
  width: '100%',
96
96
  top: 0,
97
97
  zIndex: 100,
98
- left: 40
98
+ left: 20
99
99
  },
100
100
  socialIcon: {
101
101
  borderRadius: 3,
@@ -146,14 +146,11 @@ export const BusinessBasicInformation = (
146
146
  }
147
147
 
148
148
  const getBusinessType = () => {
149
- if (Object.keys(business || {}).length <= 0) return t('GENERAL', 'General');
149
+ if (!types) return t('GENERAL', 'General');
150
150
  const _types: any = [];
151
151
  types.forEach(
152
- (type) =>
153
- business[type] &&
154
- _types.push(
155
- t(`BUSINESS_TYPE_${type?.replace(/\s/g, '_')?.toUpperCase()}`, type),
156
- ),
152
+ (type: any) =>
153
+ _types.push(type)
157
154
  );
158
155
  return _types.join(', ');
159
156
  };
@@ -247,7 +244,7 @@ export const BusinessBasicInformation = (
247
244
  <View style={styles.tiktokIcon}>
248
245
  <OIcon
249
246
  src={theme.images.general.tiktok}
250
- style={{ width: 10, height: 12 }}
247
+ style={{ width: 10, height: 12, bottom: 1 }}
251
248
  cover
252
249
  />
253
250
  </View>
@@ -11,7 +11,7 @@ export const BusinessHeader = styled.ImageBackground`
11
11
  `;
12
12
  export const BusinessLogo = styled.View`
13
13
  position: absolute;
14
- start: 40px;
14
+ start: 20px;
15
15
  top: -36px;
16
16
  z-index: 50;
17
17
  box-shadow: 0 0 2px ${Platform.OS == 'android' ? '#000000DD' : '#0000001A'};