ordering-ui-react-native 0.21.21 → 0.21.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 (239) 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 +4 -4
  6. package/src/components/VerifyPhone/styles.tsx +1 -2
  7. package/src/types/index.tsx +2 -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 +4 -3
  19. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  20. package/themes/business/src/components/Home/index.tsx +5 -1
  21. package/themes/business/src/components/LanguageSelector/index.tsx +4 -2
  22. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  23. package/themes/business/src/components/MapView/index.tsx +11 -7
  24. package/themes/business/src/components/MessagesOption/index.tsx +2 -1
  25. package/themes/business/src/components/NewOrderNotification/index.tsx +163 -113
  26. package/themes/business/src/components/OrderDetails/Business.tsx +50 -2
  27. package/themes/business/src/components/OrderDetails/Delivery.tsx +23 -11
  28. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +60 -53
  29. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +54 -23
  30. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
  31. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
  32. package/themes/business/src/components/OrderSummary/index.tsx +240 -76
  33. package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
  34. package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
  35. package/themes/business/src/components/OrdersOption/index.tsx +125 -48
  36. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  37. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +33 -36
  38. package/themes/business/src/components/PreviousOrders/OrderList.tsx +18 -13
  39. package/themes/business/src/components/PreviousOrders/index.tsx +80 -66
  40. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  41. package/themes/business/src/components/PrinterSettings/index.tsx +279 -0
  42. package/themes/business/src/components/PrinterSettings/styles.tsx +17 -0
  43. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  44. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  45. package/themes/business/src/components/SearchBar/index.tsx +2 -1
  46. package/themes/business/src/components/Sessions/index.tsx +187 -0
  47. package/themes/business/src/components/Sessions/styles.tsx +20 -0
  48. package/themes/business/src/components/StoresList/index.tsx +5 -3
  49. package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
  50. package/themes/business/src/components/UserProfileForm/index.tsx +98 -44
  51. package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
  52. package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
  53. package/themes/business/src/components/shared/OInput.tsx +2 -0
  54. package/themes/business/src/hooks/useLocation.tsx +5 -4
  55. package/themes/business/src/types/index.tsx +15 -2
  56. package/themes/business/src/utils/index.tsx +5 -0
  57. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  58. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  59. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  60. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  61. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -4
  62. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  63. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  64. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  65. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  66. package/themes/original/index.tsx +9 -4
  67. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  68. package/themes/original/src/components/AddressForm/index.tsx +10 -6
  69. package/themes/original/src/components/AddressForm/styles.tsx +1 -1
  70. package/themes/original/src/components/AddressList/index.tsx +4 -7
  71. package/themes/original/src/components/AddressList/styles.tsx +4 -4
  72. package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
  73. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  74. package/themes/original/src/components/BusinessBasicInformation/index.tsx +4 -4
  75. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
  76. package/themes/original/src/components/BusinessController/index.tsx +20 -12
  77. package/themes/original/src/components/BusinessController/styles.tsx +8 -7
  78. package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
  79. package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
  80. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
  81. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
  82. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
  83. package/themes/original/src/components/BusinessListingSearch/index.tsx +56 -361
  84. package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
  85. package/themes/original/src/components/BusinessPreorder/index.tsx +2 -3
  86. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
  87. package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
  88. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  89. package/themes/original/src/components/BusinessProductsListing/index.tsx +51 -20
  90. package/themes/original/src/components/BusinessProductsListing/styles.tsx +3 -4
  91. package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
  92. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  93. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
  94. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  95. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  96. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  97. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +24 -404
  98. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  99. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  100. package/themes/original/src/components/Cart/index.tsx +32 -9
  101. package/themes/original/src/components/CartContent/index.tsx +96 -58
  102. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  103. package/themes/original/src/components/Checkout/index.tsx +190 -66
  104. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  105. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  106. package/themes/original/src/components/DatePicker/index.tsx +33 -0
  107. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  108. package/themes/original/src/components/Favorite/index.tsx +4 -9
  109. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  110. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  111. package/themes/original/src/components/GPSButton/index.tsx +1 -1
  112. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  113. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  114. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  115. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
  116. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
  117. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
  118. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  119. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
  120. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  121. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  122. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  123. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
  124. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  125. package/themes/original/src/components/GoogleMap/index.tsx +6 -5
  126. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
  127. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  128. package/themes/original/src/components/Home/index.tsx +2 -1
  129. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  130. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  131. package/themes/original/src/components/LoginForm/Otp/index.tsx +4 -16
  132. package/themes/original/src/components/Messages/index.tsx +9 -4
  133. package/themes/original/src/components/Messages/styles.tsx +1 -1
  134. package/themes/original/src/components/MomentOption/index.tsx +4 -3
  135. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  136. package/themes/original/src/components/MultiCheckout/index.tsx +208 -21
  137. package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
  138. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -15
  139. package/themes/original/src/components/MyOrders/index.tsx +24 -29
  140. package/themes/original/src/components/NavBar/index.tsx +3 -1
  141. package/themes/original/src/components/NetworkError/index.tsx +2 -3
  142. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  143. package/themes/original/src/components/Notifications/index.tsx +4 -8
  144. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  145. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +1 -1
  146. package/themes/original/src/components/OrderDetails/index.tsx +716 -668
  147. package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
  148. package/themes/original/src/components/OrderProgress/index.tsx +28 -6
  149. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  150. package/themes/original/src/components/OrderSummary/index.tsx +3 -1
  151. package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
  152. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  153. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  154. package/themes/original/src/components/OrdersOption/index.tsx +3 -5
  155. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  156. package/themes/original/src/components/PageBanner/index.tsx +3 -0
  157. package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
  158. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
  159. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  160. package/themes/original/src/components/PaymentOptions/index.tsx +72 -6
  161. package/themes/original/src/components/ProductForm/ActionButton.tsx +120 -0
  162. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  163. package/themes/original/src/components/ProductForm/index.tsx +74 -165
  164. package/themes/original/src/components/ProductItemAccordion/index.tsx +54 -44
  165. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
  166. package/themes/original/src/components/ProductOptionSubOption/index.tsx +123 -82
  167. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +6 -1
  168. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  169. package/themes/original/src/components/Promotions/index.tsx +4 -4
  170. package/themes/original/src/components/Promotions/styles.tsx +0 -2
  171. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  172. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  173. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  174. package/themes/original/src/components/ServiceForm/index.tsx +2 -2
  175. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  176. package/themes/original/src/components/SignupForm/index.tsx +60 -58
  177. package/themes/original/src/components/SingleOrderCard/index.tsx +3 -2
  178. package/themes/original/src/components/SingleProductCard/index.tsx +2 -2
  179. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  180. package/themes/original/src/components/StripeCardsList/index.tsx +17 -36
  181. package/themes/original/src/components/StripeElementsForm/index.tsx +72 -59
  182. package/themes/original/src/components/StripeElementsForm/naked.tsx +47 -0
  183. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  184. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
  185. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
  186. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  187. package/themes/original/src/components/UserFormDetails/index.tsx +125 -77
  188. package/themes/original/src/components/UserFormDetails/styles.tsx +7 -0
  189. package/themes/original/src/components/UserProfile/index.tsx +3 -2
  190. package/themes/original/src/components/UserProfileForm/index.tsx +30 -36
  191. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  192. package/themes/original/src/components/Wallets/index.tsx +8 -9
  193. package/themes/original/src/components/Wallets/styles.tsx +1 -1
  194. package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
  195. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  196. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  197. package/themes/original/src/components/shared/OButton.tsx +5 -5
  198. package/themes/original/src/components/shared/OInput.tsx +1 -4
  199. package/themes/original/src/components/shared/OModal.tsx +12 -14
  200. package/themes/original/src/layouts/Container.tsx +5 -3
  201. package/themes/original/src/types/index.tsx +1 -0
  202. package/themes/original/src/utils/index.tsx +125 -1
  203. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  204. package/src/navigators/BottomNavigator.tsx +0 -117
  205. package/src/navigators/CheckoutNavigator.tsx +0 -66
  206. package/src/navigators/HomeNavigator.tsx +0 -202
  207. package/src/navigators/NavigationRef.tsx +0 -7
  208. package/src/navigators/RootNavigator.tsx +0 -269
  209. package/src/pages/Account.tsx +0 -34
  210. package/src/pages/AddressForm.tsx +0 -62
  211. package/src/pages/AddressList.tsx +0 -24
  212. package/src/pages/BusinessProductsList.tsx +0 -81
  213. package/src/pages/BusinessesListing.tsx +0 -43
  214. package/src/pages/CartList.tsx +0 -49
  215. package/src/pages/Checkout.tsx +0 -101
  216. package/src/pages/ForgotPassword.tsx +0 -24
  217. package/src/pages/Help.tsx +0 -23
  218. package/src/pages/HelpAccountAndPayment.tsx +0 -23
  219. package/src/pages/HelpGuide.tsx +0 -23
  220. package/src/pages/HelpOrder.tsx +0 -23
  221. package/src/pages/Home.tsx +0 -36
  222. package/src/pages/IntroductoryTutorial.tsx +0 -170
  223. package/src/pages/Login.tsx +0 -47
  224. package/src/pages/MomentOption.tsx +0 -30
  225. package/src/pages/MultiCheckout.tsx +0 -31
  226. package/src/pages/MultiOrdersDetails.tsx +0 -27
  227. package/src/pages/MyOrders.tsx +0 -40
  228. package/src/pages/NetworkError.tsx +0 -24
  229. package/src/pages/NotFound.tsx +0 -22
  230. package/src/pages/OrderDetails.tsx +0 -25
  231. package/src/pages/ProductDetails.tsx +0 -55
  232. package/src/pages/Profile.tsx +0 -36
  233. package/src/pages/ReviewDriver.tsx +0 -30
  234. package/src/pages/ReviewOrder.tsx +0 -32
  235. package/src/pages/ReviewProducts.tsx +0 -30
  236. package/src/pages/Sessions.tsx +0 -22
  237. package/src/pages/Signup.tsx +0 -53
  238. package/src/pages/SpinnerLoader.tsx +0 -10
  239. package/src/pages/Splash.tsx +0 -21
@@ -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={{
@@ -122,8 +122,8 @@ const AddressFormUI = (props: AddressFormParams) => {
122
122
  width: 16
123
123
  },
124
124
  wrapperNavbar: Platform.OS === 'ios'
125
- ? { paddingVertical: 0, paddingLeft: 40, paddingRight: 20 }
126
- : { paddingVertical: 10, paddingLeft: 40, paddingRight: 20 }
125
+ ? { paddingVertical: 0, paddingLeft: 20, paddingRight: 20 }
126
+ : { paddingVertical: 10, paddingLeft: 20, paddingRight: 20 }
127
127
  });
128
128
 
129
129
  const [, t] = useLanguage();
@@ -371,6 +371,10 @@ const AddressFormUI = (props: AddressFormParams) => {
371
371
  setToggleMap(!toggleMap);
372
372
  };
373
373
 
374
+ const showFieldWithTheme = (name) => {
375
+ return !theme?.address?.components?.[name]?.hidden
376
+ }
377
+
374
378
  useEffect(() => {
375
379
  if (
376
380
  orderState.loading &&
@@ -672,7 +676,7 @@ const AddressFormUI = (props: AddressFormParams) => {
672
676
  )}
673
677
 
674
678
  <View style={{ flexDirection: 'row', flexBasis: '50%' }}>
675
- {showField && showField('internal_number') && (
679
+ {((isRequiredField && isRequiredField('internal_number')) || showFieldWithTheme('internal_number')) && (
676
680
  <Controller
677
681
  control={control}
678
682
  name="internal_number"
@@ -708,7 +712,7 @@ const AddressFormUI = (props: AddressFormParams) => {
708
712
  isFocusHighlight
709
713
  style={{
710
714
  ...styles.inputsStyle,
711
- marginRight: showField('internal_number') && showField('zipcode') ? 24 : 0
715
+ marginRight: showField?.('internal_number') && showField?.('zipcode') ? 24 : 0
712
716
  }}
713
717
  forwardRef={internalNumberRef}
714
718
  returnKeyType="next"
@@ -719,7 +723,7 @@ const AddressFormUI = (props: AddressFormParams) => {
719
723
  />
720
724
  )}
721
725
 
722
- {showField && showField('zipcode') && (
726
+ {((isRequiredField && isRequiredField('zipcode')) || showFieldWithTheme('zipcode')) && (
723
727
  <Controller
724
728
  control={control}
725
729
  name="zipcode"
@@ -764,7 +768,7 @@ const AddressFormUI = (props: AddressFormParams) => {
764
768
  )}
765
769
  </View>
766
770
 
767
- {showField && showField('address_notes') && (
771
+ {((isRequiredField && isRequiredField('address_notes')) || showFieldWithTheme('address_notes')) && (
768
772
  <Controller
769
773
  control={control}
770
774
  name="address_notes"
@@ -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
  `
@@ -1,8 +1,8 @@
1
1
  import React, { useEffect } from 'react'
2
- import { AddressList as AddressListController, useLanguage, useOrder, useSession } from 'ordering-components/native'
2
+ import { AddressList as AddressListController, useLanguage, useOrder } from 'ordering-components/native'
3
3
  import { AddressItem, Container } from './styles'
4
4
  import { Platform, RefreshControl, StyleSheet, View } from 'react-native'
5
- import { OButton, OText, OAlert, OModal, OIcon } from '../shared'
5
+ import { OButton, OText, OAlert, OIcon } from '../shared'
6
6
  import { AddressListParams } from '../../types'
7
7
  import { NotFoundSource } from '../NotFoundSource'
8
8
  import NavBar from '../NavBar'
@@ -18,12 +18,10 @@ const AddressListUI = (props: AddressListParams) => {
18
18
  route,
19
19
  addressList,
20
20
  isFromProfile,
21
- nopadding,
22
21
  handleSetDefault,
23
22
  handleDelete,
24
23
  setAddressList,
25
24
  isGoBack,
26
- actionStatus,
27
25
  isFromBusinesses,
28
26
  isFromProductsList,
29
27
  afterSignup,
@@ -34,7 +32,6 @@ const AddressListUI = (props: AddressListParams) => {
34
32
 
35
33
  const [orderState] = useOrder()
36
34
  const [, t] = useLanguage()
37
- const [{ auth }] = useSession()
38
35
  const [refreshing] = useState(false);
39
36
 
40
37
  const [isProfile, setIsProfile] = useState(isFromProfile || route?.params?.isFromProfile);
@@ -296,8 +293,8 @@ const AddressListUI = (props: AddressListParams) => {
296
293
  <OButton
297
294
  text={t('ADD_NEW_ADDRESS', 'Add new Address')}
298
295
  imgRightSrc=''
299
- bgColor={theme.colors.white}
300
- textStyle={{ color: theme.colors.primary }}
296
+ bgColor={theme.colors.primary}
297
+ textStyle={{ color: theme.colors.white }}
301
298
  style={styles.button}
302
299
  borderColor={theme.colors.primary}
303
300
  onClick={() => !afterSignup ? onNavigationRedirect(
@@ -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 =>
@@ -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,
@@ -217,7 +217,7 @@ export const BusinessBasicInformation = (
217
217
  <Placeholder Animation={Fade}>
218
218
  <View style={{ flexDirection: 'row' }}>
219
219
  {[...Array(5).keys()].map(i => (
220
- <View style={styles.socialIcon} key={i}>
220
+ <View style={{ ...styles.socialIcon, borderWidth: 0 }} key={i}>
221
221
  <PlaceholderLine width={100} height={20} style={{ marginBottom: 0 }} />
222
222
  </View>
223
223
  ))}
@@ -247,7 +247,7 @@ export const BusinessBasicInformation = (
247
247
  <View style={styles.tiktokIcon}>
248
248
  <OIcon
249
249
  src={theme.images.general.tiktok}
250
- style={{ width: 10, height: 12 }}
250
+ style={{ width: 10, height: 12, bottom: 1 }}
251
251
  cover
252
252
  />
253
253
  </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'};
@@ -35,7 +35,12 @@ import FastImage from 'react-native-fast-image'
35
35
  import { LottieAnimation } from '../LottieAnimation';
36
36
  import { CardAnimation } from '../shared/CardAnimation';
37
37
 
38
- export const BusinessControllerUI = (props: BusinessControllerParams) => {
38
+ function BusinessControllerPropsAreEqual(prevProps: any, nextProps: any) {
39
+ return JSON.stringify(prevProps.business) === JSON.stringify(nextProps.business) &&
40
+ prevProps.isBusinessOpen === nextProps.isBusinessOpen
41
+ }
42
+
43
+ export const BusinessControllerUI = React.memo((props: BusinessControllerParams) => {
39
44
  const {
40
45
  business,
41
46
  handleClick,
@@ -76,7 +81,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
76
81
  const hideBusinessFavoriteBadge = theme?.business_listing_view?.components?.business?.components?.featured_badge?.hidden
77
82
 
78
83
  const textSize = 12
79
- const cardHeight = windowHeight * 0.3
84
+ const cardHeight = windowHeight * 0.34
80
85
 
81
86
  const styles = StyleSheet.create({
82
87
  container: {
@@ -184,7 +189,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
184
189
  }
185
190
 
186
191
  return (
187
- <InView style={{ minHeight: 200 }} triggerOnce={true} onChange={(inView: boolean) => handleChangeInterSection(inView)}>
192
+ <View style={{ minHeight: 200 }}>
188
193
  {isIntersectionObserver ? (
189
194
  <CardAnimation
190
195
  style={[style, styles.container]}
@@ -227,7 +232,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
227
232
  </View>
228
233
  )}
229
234
  {!hideBusinessOffer && (
230
- getBusinessOffer((business?.offers)) &&
235
+ !!getBusinessOffer((business?.offers)) &&
231
236
  <OfferBox
232
237
  isClosed={!isBusinessOpen && (configState?.configs?.preorder_status_enabled?.value === '1')}
233
238
  isRibbon={business?.ribbon?.enabled && !!business?.ribbon?.text}
@@ -239,7 +244,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
239
244
  numberOfLines={2}
240
245
  ellipsizeMode='tail'
241
246
  lineHeight={13}
242
- >{getBusinessOffer((business?.offers)) || parsePrice(0)}</OText>
247
+ >{t('DISCOUNT', 'Discount')}{' '}{getBusinessOffer((business?.offers))}</OText>
243
248
  </OfferBox>
244
249
  )}
245
250
  <BusinessState isRibbon={business?.ribbon?.enabled && !!business?.ribbon?.text}>
@@ -256,7 +261,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
256
261
  </BusinessState>
257
262
  </BusinessHero>
258
263
  <BusinessContent>
259
- <BusinessInfo style={{ position: 'absolute', bottom: 85, left: 15 }}>
264
+ <BusinessInfo style={{ position: 'absolute', top: -26, left: 15 }}>
260
265
  {!hideBusinessLogo && (
261
266
  <BusinessLogo style={styles.businessLogo}>
262
267
  <FastImage
@@ -270,11 +275,14 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
270
275
  </BusinessLogo>
271
276
  )}
272
277
  </BusinessInfo>
273
- <View style={{ width: '100%', flexDirection: 'row', justifyContent: 'space-between', marginTop: 5 }}>
278
+ <View style={{ width: '100%', flexDirection: 'row', justifyContent: 'space-between', marginTop: 5, alignItems: 'flex-start' }}>
274
279
  <OText
275
280
  size={textSize + 2}
276
- style={{ lineHeight: 18, marginBottom: 6 }}
277
- weight={'500'}>
281
+ style={{ lineHeight: 18, marginBottom: 6, width: '90%' }}
282
+ weight={'500'}
283
+ numberOfLines={1}
284
+ ellipsizeMode='tail'
285
+ >
278
286
  {business?.name}
279
287
  </OText>
280
288
  {(!hideBusinessFavorite || !hideBusinessReviews) && (
@@ -301,7 +309,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
301
309
  </ReviewAndFavorite>
302
310
  )}
303
311
  </View>
304
- <OText size={textSize} style={{ lineHeight: 15, marginBottom: 3 }} numberOfLines={1}>
312
+ <OText size={textSize} style={{ lineHeight: 15, marginBottom: 3, fontFamily: '' }} numberOfLines={1}>
305
313
  {business?.address}
306
314
  </OText>
307
315
  <Metadata>
@@ -373,9 +381,9 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
373
381
  </View>
374
382
  </Placeholder>
375
383
  )}
376
- </InView>
384
+ </View>
377
385
  );
378
- };
386
+ }, BusinessControllerPropsAreEqual);
379
387
 
380
388
  export const BusinessController = (props: BusinessControllerParams) => {
381
389
  const BusinessControllerProps = {
@@ -8,13 +8,14 @@ export const BusinessHero = styled.View`
8
8
  `
9
9
 
10
10
  export const BusinessContent = styled.View`
11
- padding-horizontal: 18px;
12
- padding-bottom: 10px;
13
- border-bottom-left-radius: 7.6px;
14
- border-bottom-right-radius: 7.6px;
15
- border-width: 1px;
16
- border-color: ${(props: any) => props.theme.colors.border};
17
- overflow: visible;
11
+ position: relative;
12
+ padding-horizontal: 18px;
13
+ padding-bottom: 10px;
14
+ border-bottom-left-radius: 7.6px;
15
+ border-bottom-right-radius: 7.6px;
16
+ border-width: 1px;
17
+ border-color: ${(props: any) => props.theme.colors.border};
18
+ overflow: visible;
18
19
  `;
19
20
 
20
21
  export const BusinessInfo = styled.View`
@@ -17,7 +17,7 @@ export const MediaWrapper = styled.ScrollView`
17
17
  height: 127px;
18
18
  `
19
19
  export const InnerContent = styled.View`
20
- padding: 20px 40px;
20
+ padding: 20px;
21
21
  `
22
22
  export const WrapScheduleBlock = styled.View`
23
23
  margin: 20px 0;
@@ -36,4 +36,4 @@ export const DivideView = styled.View`
36
36
  height: 8px;
37
37
  background-color: ${(props: any) => props.theme.colors.backgroundGray100};
38
38
  margin-horizontal: -40px;
39
- `;
39
+ `;