ordering-ui-react-native 0.14.87 → 0.14.89-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 (136) hide show
  1. package/package.json +6 -3
  2. package/src/DeliveryApp.tsx +34 -2
  3. package/src/assets/images/no-network.png +0 -0
  4. package/src/components/BusinessTypeFilter/index.tsx +9 -2
  5. package/src/components/BusinessTypeFilter/styles.tsx +1 -1
  6. package/src/components/BusinessesListing/index.tsx +1 -1
  7. package/src/components/Cart/index.tsx +1 -1
  8. package/src/components/Checkout/index.tsx +0 -1
  9. package/src/components/Home/index.tsx +3 -5
  10. package/src/components/LanguageSelector/index.tsx +65 -97
  11. package/src/components/LanguageSelector/styles.tsx +4 -17
  12. package/src/components/Messages/index.tsx +38 -30
  13. package/src/components/MomentOption/index.tsx +3 -1
  14. package/src/components/OrderDetails/index.tsx +26 -5
  15. package/src/components/PaymentOptions/index.tsx +7 -16
  16. package/src/components/PaymentOptionsWebView/index.tsx +123 -124
  17. package/src/components/ProductForm/index.tsx +1 -1
  18. package/src/components/ProductForm/styles.tsx +1 -0
  19. package/src/components/StripeElementsForm/index.tsx +27 -48
  20. package/src/components/UserProfileForm/index.tsx +35 -1
  21. package/src/components/VerifyPhone/styles.tsx +1 -2
  22. package/src/config.json +0 -2
  23. package/src/pages/Checkout.tsx +1 -1
  24. package/src/providers/AlertProvider.tsx +4 -1
  25. package/src/theme.json +2 -1
  26. package/src/types/index.tsx +2 -9
  27. package/src/utils/index.tsx +128 -1
  28. package/themes/business/index.tsx +4 -0
  29. package/themes/business/src/components/Chat/index.tsx +32 -31
  30. package/themes/business/src/components/NetworkError/index.tsx +61 -0
  31. package/themes/business/src/components/NetworkError/styles.tsx +11 -0
  32. package/themes/business/src/components/OrderDetails/Business.tsx +1 -0
  33. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +85 -17
  34. package/themes/business/src/components/OrdersListManager/index.tsx +871 -0
  35. package/themes/business/src/components/OrdersListManager/styles.tsx +123 -0
  36. package/themes/business/src/components/OrdersListManager/utils.tsx +216 -0
  37. package/themes/business/src/components/OrdersOption/index.tsx +351 -59
  38. package/themes/business/src/components/OrdersOption/styles.tsx +95 -7
  39. package/themes/business/src/components/PreviousOrders/index.tsx +65 -46
  40. package/themes/business/src/components/PreviousOrders/styles.tsx +5 -10
  41. package/themes/business/src/components/ReviewCustomer/index.tsx +5 -1
  42. package/themes/business/src/types/index.tsx +4 -0
  43. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  44. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  45. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  46. package/themes/kiosk/index.tsx +2 -0
  47. package/themes/kiosk/src/components/BusinessController/index.tsx +27 -6
  48. package/themes/kiosk/src/components/BusinessController/styles.tsx +1 -1
  49. package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +51 -24
  50. package/themes/kiosk/src/components/Cart/index.tsx +1 -1
  51. package/themes/kiosk/src/components/CartBottomSheet/index.tsx +1 -1
  52. package/themes/kiosk/src/components/CartBottomSheet/styles.tsx +1 -1
  53. package/themes/kiosk/src/components/CartContent/index.tsx +13 -3
  54. package/themes/kiosk/src/components/CartItem/index.tsx +20 -8
  55. package/themes/kiosk/src/components/CategoriesMenu/index.tsx +7 -5
  56. package/themes/kiosk/src/components/CustomerName/index.tsx +89 -88
  57. package/themes/kiosk/src/components/Intro/index.tsx +13 -13
  58. package/themes/kiosk/src/components/LanguageSelector/index.tsx +12 -8
  59. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  60. package/themes/kiosk/src/components/NetworkError/index.tsx +60 -0
  61. package/themes/kiosk/src/components/NetworkError/styles.tsx +11 -0
  62. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  63. package/themes/kiosk/src/components/OrderDetails/index.tsx +2 -2
  64. package/themes/kiosk/src/components/OrderSummary/index.tsx +1 -1
  65. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +10 -12
  66. package/themes/kiosk/src/components/ProductForm/index.tsx +172 -124
  67. package/themes/kiosk/src/components/ProductForm/styles.tsx +1 -1
  68. package/themes/kiosk/src/components/ProductOption/index.tsx +1 -0
  69. package/themes/kiosk/src/components/ProductOption/styles.tsx +1 -0
  70. package/themes/kiosk/src/components/UpsellingProducts/index.tsx +48 -34
  71. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  72. package/themes/kiosk/src/components/shared/OCard.tsx +112 -78
  73. package/themes/kiosk/src/types/index.d.ts +4 -0
  74. package/themes/original/index.tsx +24 -6
  75. package/themes/original/src/components/AddressForm/index.tsx +15 -10
  76. package/themes/original/src/components/AddressList/index.tsx +27 -1
  77. package/themes/original/src/components/AnalyticsSegment/index.tsx +127 -0
  78. package/themes/original/src/components/BusinessBasicInformation/index.tsx +11 -7
  79. package/themes/original/src/components/BusinessController/index.tsx +5 -4
  80. package/themes/original/src/components/BusinessMenuList/index.tsx +4 -2
  81. package/themes/original/src/components/BusinessPreorder/index.tsx +142 -121
  82. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
  83. package/themes/original/src/components/BusinessProductsList/index.tsx +50 -6
  84. package/themes/original/src/components/BusinessProductsListing/index.tsx +13 -10
  85. package/themes/original/src/components/BusinessReviews/index.tsx +4 -3
  86. package/themes/original/src/components/BusinessesListing/index.tsx +23 -22
  87. package/themes/original/src/components/Cart/index.tsx +43 -10
  88. package/themes/original/src/components/CartContent/index.tsx +2 -2
  89. package/themes/original/src/components/Checkout/index.tsx +54 -30
  90. package/themes/original/src/components/Checkout/styles.tsx +7 -0
  91. package/themes/original/src/components/CouponControl/index.tsx +1 -0
  92. package/themes/original/src/components/DriverTips/index.tsx +1 -1
  93. package/themes/original/src/components/ForgotPasswordForm/index.tsx +8 -12
  94. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +9 -2
  95. package/themes/original/src/components/LoginForm/index.tsx +83 -68
  96. package/themes/original/src/components/Messages/index.tsx +24 -21
  97. package/themes/original/src/components/Messages/styles.tsx +1 -3
  98. package/themes/original/src/components/MomentOption/index.tsx +127 -152
  99. package/themes/original/src/components/MomentOption/styles.tsx +42 -18
  100. package/themes/original/src/components/NetworkError/index.tsx +61 -0
  101. package/themes/original/src/components/NetworkError/styles.tsx +11 -0
  102. package/themes/original/src/components/OrderDetails/index.tsx +103 -124
  103. package/themes/original/src/components/OrderDetails/styles.tsx +3 -1
  104. package/themes/original/src/components/OrderProgress/index.tsx +2 -3
  105. package/themes/original/src/components/OrderSummary/index.tsx +35 -2
  106. package/themes/original/src/components/OrdersOption/index.tsx +16 -40
  107. package/themes/original/src/components/OrdersOption/styles.tsx +0 -5
  108. package/themes/original/src/components/PaymentOptionWallet/index.tsx +1 -1
  109. package/themes/original/src/components/PaymentOptions/index.tsx +21 -24
  110. package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -8
  111. package/themes/original/src/components/PlaceSpot/index.tsx +114 -0
  112. package/themes/original/src/components/PlaceSpot/styles.tsx +11 -0
  113. package/themes/original/src/components/PreviousOrders/index.tsx +4 -0
  114. package/themes/original/src/components/ProductForm/index.tsx +154 -105
  115. package/themes/original/src/components/ProductForm/styles.tsx +5 -3
  116. package/themes/original/src/components/ProductOptionSubOption/index.tsx +6 -1
  117. package/themes/original/src/components/ReviewDriver/index.tsx +9 -9
  118. package/themes/original/src/components/ReviewOrder/index.tsx +9 -27
  119. package/themes/original/src/components/SignupForm/index.tsx +173 -154
  120. package/themes/original/src/components/SingleProductCard/index.tsx +6 -13
  121. package/themes/original/src/components/SingleProductCard/styles.tsx +1 -1
  122. package/themes/original/src/components/SingleProductReview/index.tsx +8 -8
  123. package/themes/original/src/components/StripeElementsForm/index.tsx +55 -72
  124. package/themes/original/src/components/UpsellingProducts/index.tsx +6 -6
  125. package/themes/original/src/components/UserDetails/index.tsx +4 -95
  126. package/themes/original/src/components/UserFormDetails/index.tsx +2 -14
  127. package/themes/original/src/components/UserProfile/index.tsx +16 -9
  128. package/themes/original/src/components/UserProfileForm/index.tsx +16 -8
  129. package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
  130. package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
  131. package/themes/original/src/components/shared/HeaderTitle.tsx +20 -0
  132. package/themes/original/src/components/shared/index.tsx +2 -0
  133. package/themes/original/src/types/index.tsx +18 -8
  134. package/themes/single-business/src/components/OrderTypeSelector/index.tsx +5 -5
  135. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  136. package/src/components/StripeMethodForm/index.tsx +0 -163
@@ -1,110 +1,144 @@
1
1
  import React from 'react';
2
- import { TextStyle, ViewStyle, Platform } from 'react-native';
2
+ import { TextStyle, ImageBackground, StyleSheet } from 'react-native';
3
3
  import { useTheme } from 'styled-components/native';
4
+ import FastImage from 'react-native-fast-image'
4
5
 
5
- import styled from 'styled-components/native';
6
- import OImage from './OImage';
6
+ import styled, { css } from 'styled-components/native';
7
7
  import OText from './OText';
8
8
 
9
9
  const CardContainer = styled.TouchableOpacity`
10
- width: 21%;
11
- margin: 10px 20px;
12
- overflow: hidden;
10
+ position: relative;
11
+ flex-direction: column;
12
+ border-radius: 10px;
13
+ position: relative;
14
+ margin: 0 30px 30px 0;
15
+ align-self: flex-start;
13
16
  `
14
17
 
15
- const CardBody = styled.View`
16
- padding: 4%;
18
+ const WrapPrice = styled.View`
19
+ display: flex;
20
+ flex-direction: row;
21
+ align-items: center;
22
+ margin-top: 10px;
17
23
  `
18
24
 
19
- const CardBadge = styled.Text`
20
- padding: 2% 4%;
21
- position: absolute;
22
- background-color: ${(props: any) => props.theme.theme.colors.primary};
23
- z-index: 100;
24
- border-radius: 5px;
25
- color: #fff;
26
- font-weight: bold;
27
- margin: 10px 0;
25
+ const WrapImage = styled.View`
26
+ width: 100%;
27
+ height: 120px;
28
+ `
29
+
30
+ const WrapContent = styled.View`
31
+ display: flex;
32
+ flex-direction: column;
33
+ ${(props: any) => props.isCentered && css`
34
+ align-items: center;
35
+ `}
28
36
  `
29
37
 
30
38
  const OCard = (props: Props): React.ReactElement => {
31
39
  const theme = useTheme()
32
40
 
41
+ const styles = StyleSheet.create({
42
+ textStyle: {
43
+ marginTop: 10
44
+ },
45
+ image: {
46
+ width: '100%',
47
+ height: '100%',
48
+ borderBottomLeftRadius: 0,
49
+ borderBottomRightRadius: 0,
50
+ }
51
+ })
52
+
33
53
  return (
34
54
  <CardContainer
35
- style={{...props.style}}
36
- onPress={props?.onPress}
37
- disabled={!props?.onPress}
38
- activeOpacity={1}
39
- >
40
- {props?.badgeText && (
41
- <CardBadge>
42
- {props?.badgeText}
43
- </CardBadge>
44
- )}
45
- <OImage
46
- source={props.image}
47
- height={120}
48
- resizeMode="cover"
49
- borderRadius={16}
50
- />
51
- <CardBody>
52
- <OText
53
- mLeft={0}
54
- size={18}
55
- numberOfLines={2}
56
- mBottom={8}
57
- style={{...props?.titleStyle}}
58
- >
59
- {props.title}
60
- </OText>
61
-
62
- {props?.description && (
63
- <OText
64
- color={theme.colors.mediumGray}
65
- numberOfLines={3}
66
- mBottom={8}
67
- style={{...props?.descriptionStyle}}
68
- >
69
- {props.description}
70
- </OText>
55
+ activeOpacity={1}
56
+ style={props.style}
57
+ onPress={props?.onPress}
58
+ disabled={!props?.onPress}
59
+ >
60
+ <WrapImage>
61
+ {props.isUri ? (
62
+ <FastImage
63
+ style={[styles.image, props.style]}
64
+ source={{
65
+ uri: props.image?.uri,
66
+ priority: FastImage.priority.normal,
67
+ // cache:FastImage.cacheControl.web
68
+ }}
69
+ resizeMode={FastImage.resizeMode.cover}
70
+ />
71
+ ) : (
72
+ <ImageBackground
73
+ style={[styles.image, props.style]}
74
+ source={props.image}
75
+ imageStyle={{
76
+ borderBottomLeftRadius: 0,
77
+ borderBottomRightRadius: 0,
78
+ borderRadius: 10
79
+ }}
80
+ resizeMode='cover'
81
+ />
71
82
  )}
72
-
73
- {props?.price && (
74
- <OText>
75
- <OText
76
- color={theme.colors.primary}
77
- weight="bold"
78
- >
79
- {props.price}
80
- </OText>
81
-
82
- <OText
83
- color={theme.colors.mediumGray}
84
- size={12}
85
- style={{textDecorationLine: 'line-through', textDecorationStyle: 'solid'}}
86
- >
87
- {props?.prevPrice ? ` ${props?.prevPrice} ` : ''}
88
- </OText>
89
- </OText>
90
- )}
91
-
92
- </CardBody>
93
- </CardContainer>
94
- );
83
+ </WrapImage>
84
+ <WrapContent isCentered={props.isCentered}>
85
+ <OText
86
+ size={18}
87
+ numberOfLines={1}
88
+ ellipsizeMode='tail'
89
+ style={styles.textStyle}
90
+ >
91
+ {props.title}
92
+ </OText>
93
+ {!!props?.description && (
94
+ <OText
95
+ color={theme.colors.mediumGray}
96
+ size={18}
97
+ numberOfLines={3}
98
+ ellipsizeMode='tail'
99
+ style={styles.textStyle}
100
+ >
101
+ {props?.description}
102
+ </OText>
103
+ )}
104
+ <WrapPrice>
105
+ <OText
106
+ size={18}
107
+ >
108
+ {props.price}
109
+ </OText>
110
+ {props?.prevPrice && (
111
+ <OText
112
+ size={18}
113
+ color={theme.colors.mediumGray}
114
+ style={{
115
+ textDecorationLine: 'line-through',
116
+ textDecorationStyle: 'solid',
117
+ marginLeft: 20,
118
+ }}
119
+ >
120
+ {props?.prevPrice}
121
+ </OText>
122
+ )}
123
+ </WrapPrice>
124
+ </WrapContent>
125
+ </CardContainer>
126
+ )
95
127
  }
96
128
 
97
129
  interface Props {
98
130
  badgeText?: string;
131
+ isUri?: boolean;
99
132
  onPress?(): void;
100
- image: string | { uri: string };
133
+ image: any;
134
+ isCentered?: any;
101
135
  title: string;
102
136
  titleStyle?: TextStyle;
103
137
  description?: string;
104
138
  descriptionStyle?: TextStyle;
105
139
  price?: string;
106
140
  prevPrice?: string;
107
- style?: ViewStyle;
141
+ style?: any;
108
142
  }
109
143
 
110
144
  export default OCard;
@@ -473,3 +473,7 @@ export interface Cart {
473
473
  total: number;
474
474
  clearInactivityTimeout: any;
475
475
  }
476
+
477
+ export interface NoNetworkParams {
478
+ image?: any;
479
+ }
@@ -1,16 +1,21 @@
1
1
  import { AddressForm } from './src/components/AddressForm';
2
2
  import { AddressDetails } from './src/components/AddressDetails';
3
+ import { AnalyticsSegment } from './src/components/AnalyticsSegment';
3
4
  import { Home } from './src/components/Home';
4
5
  import { LoginForm } from './src/components/LoginForm';
5
6
  import { SignupForm } from './src/components/SignupForm';
6
7
  import { ActiveOrders } from './src/components/ActiveOrders';
7
8
  import { AddressList } from './src/components/AddressList';
8
9
  import { AppleLogin } from './src/components/AppleLogin';
10
+ import { BusinessBasicInformation } from './src/components/BusinessBasicInformation';
11
+ import { BusinessProductsCategories } from './src/components/BusinessProductsCategories';
12
+ import { BusinessProductsList } from './src/components/BusinessProductsList';
9
13
  import { BusinessesListing } from './src/components/BusinessesListing';
10
14
  import { BusinessProductsListing } from './src/components/BusinessProductsListing';
11
15
  import { CartContent } from './src/components/CartContent';
12
16
  import { BusinessCart } from './src/components/BusinessCart';
13
17
  import { Checkout } from './src/components/Checkout';
18
+ import { FloatingButton } from './src/components/FloatingButton';
14
19
  import { ForgotPasswordForm } from './src/components/ForgotPasswordForm';
15
20
  import { MomentOption } from './src/components/MomentOption';
16
21
  import { OrdersOption } from './src/components/OrdersOption';
@@ -24,12 +29,15 @@ import { ReviewProducts } from './src/components/ReviewProducts';
24
29
  import { ReviewDriver } from './src/components/ReviewDriver';
25
30
  import { UserProfile } from './src/components/UserProfile';
26
31
  import { MessageListing } from './src/components/MessageListing';
32
+ import { Messages } from './src/components/Messages';
27
33
  import { Help } from './src/components/Help';
28
34
  import { HelpAccountAndPayment } from './src/components/HelpAccountAndPayment';
29
35
  import { HelpGuide } from './src/components/HelpGuide';
30
36
  import { HelpOrder } from './src/components/HelpOrder';
37
+ import { NetworkError } from './src/components/NetworkError';
31
38
  import { NotFoundSource } from './src/components/NotFoundSource';
32
39
  import { OrderTypeSelector } from './src/components/OrderTypeSelector';
40
+ import { SearchBar } from './src/components/SearchBar';
33
41
  import { Wallets } from './src/components/Wallets';
34
42
  import { PaymentOptionWallet } from './src/components/PaymentOptionWallet';
35
43
  import { ProductForm } from './src/components/ProductForm';
@@ -51,6 +59,7 @@ import {
51
59
  OAlert,
52
60
  OModal,
53
61
  OBottomPopup,
62
+ HeaderTitle
54
63
  } from './src/components/shared';
55
64
 
56
65
  import { Container } from './src/layouts/Container';
@@ -65,6 +74,7 @@ import {
65
74
  export {
66
75
  AddressForm,
67
76
  AddressDetails,
77
+ AnalyticsSegment,
68
78
  Home as HomeView,
69
79
  SignupForm,
70
80
  LoginForm,
@@ -74,7 +84,7 @@ export {
74
84
  BusinessesListing,
75
85
  BusinessProductsListing,
76
86
  CartContent,
77
- BusinessCart,
87
+ BusinessCart,
78
88
  Checkout,
79
89
  ForgotPasswordForm,
80
90
  MomentOption,
@@ -89,17 +99,24 @@ export {
89
99
  BusinessMenuList,
90
100
  UserProfile,
91
101
  MessageListing,
102
+ Messages,
92
103
  Help,
93
104
  HelpAccountAndPayment,
94
105
  HelpGuide,
95
106
  HelpOrder,
107
+ NetworkError,
96
108
  NotFoundSource,
97
109
  OrderTypeSelector,
98
- Wallets,
99
- PaymentOptionWallet,
100
- ProductForm,
101
- UpsellingProducts,
102
- UserVerification,
110
+ Wallets,
111
+ PaymentOptionWallet,
112
+ ProductForm,
113
+ UpsellingProducts,
114
+ UserVerification,
115
+ BusinessBasicInformation,
116
+ BusinessProductsCategories,
117
+ BusinessProductsList,
118
+ FloatingButton,
119
+ SearchBar,
103
120
 
104
121
  // OComponents
105
122
  Toast,
@@ -116,6 +133,7 @@ export {
116
133
  OAlert,
117
134
  OModal,
118
135
  OBottomPopup,
136
+ HeaderTitle,
119
137
 
120
138
  // layout
121
139
  Container,
@@ -108,6 +108,9 @@ const AddressFormUI = (props: AddressFormParams) => {
108
108
  top: 12,
109
109
  zIndex: 1002,
110
110
  },
111
+ wrapperNavbar: Platform.OS === 'ios'
112
+ ? { paddingVertical: 0, paddingHorizontal: 40 }
113
+ : { paddingVertical: 20, paddingHorizontal: 40 }
111
114
  });
112
115
 
113
116
  const [, t] = useLanguage();
@@ -500,16 +503,18 @@ const AddressFormUI = (props: AddressFormParams) => {
500
503
  keyboardShouldPersistTaps='always'
501
504
  listViewDisplayed={false}
502
505
  >
503
- <NavBar
504
- title={t('WHERE_DO_WE_DELIVERY', 'Where do we delivery?')}
505
- titleAlign={'center'}
506
- onActionLeft={goToBack}
507
- showCall={false}
508
- paddingTop={20}
509
- btnStyle={{ paddingLeft: 40 }}
510
- titleStyle={{ fontSize: 14 }}
511
- titleWrapStyle={{ paddingHorizontal: 0 }}
512
- />
506
+ <View style={styles.wrapperNavbar}>
507
+ <NavBar
508
+ title={t('WHERE_DO_WE_DELIVERY', 'Where do we delivery?')}
509
+ titleAlign={'center'}
510
+ onActionLeft={goToBack}
511
+ showCall={false}
512
+ btnStyle={{ paddingLeft: 0 }}
513
+ style={{ flexDirection: 'column', alignItems: 'flex-start' }}
514
+ titleWrapStyle={{ paddingHorizontal: 0 }}
515
+ titleStyle={{ marginRight: 0, marginLeft: 0 }}
516
+ />
517
+ </View>
513
518
  <TouchableWithoutFeedback onPress={Keyboard.dismiss}>
514
519
  <AddressFormContainer style={{ height: 600, overflow: 'scroll' }}>
515
520
  <View>
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect } from 'react'
2
2
  import { AddressList as AddressListController, useLanguage, useOrder, useSession } from 'ordering-components/native'
3
3
  import { AddressListContainer, AddressItem } from './styles'
4
- import { StyleSheet, View } from 'react-native'
4
+ import { Platform, StyleSheet, View } from 'react-native'
5
5
  import { OButton, OText, OAlert, OModal, OIcon } from '../shared'
6
6
  import { Container } from '../../layouts/Container'
7
7
  import { AddressListParams } from '../../types'
@@ -261,6 +261,32 @@ const AddressListUI = (props: AddressListParams) => {
261
261
  )}
262
262
  {!addressList.loading && !addressList.error && (
263
263
  <>
264
+ {addressList?.addresses?.length === 0 && (
265
+ <View
266
+ style={{
267
+ flexDirection: 'column',
268
+ paddingHorizontal: 10,
269
+ paddingTop: 20
270
+ }}
271
+ >
272
+ <OText
273
+ size={24}
274
+ lineHeight={36}
275
+ weight={Platform.OS === 'ios' ? '600' : 'bold'}
276
+ style={{
277
+ textAlign: 'center',
278
+ marginRight: 40,
279
+ color: theme.colors.textNormal,
280
+ paddingHorizontal: 0,
281
+ width: '100%',
282
+ marginLeft: 0
283
+ }}
284
+ >
285
+ {t('ADDRESS_LIST', 'Address List')}
286
+ </OText>
287
+ </View>
288
+ )}
289
+
264
290
  <OButton
265
291
  text={t('ADD_NEW_ADDRESS', 'Add new Address')}
266
292
  imgRightSrc=''
@@ -0,0 +1,127 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { createClient, AnalyticsProvider } from '@segment/analytics-react-native';
3
+ import { useEvent, useConfig } from 'ordering-components/native';
4
+
5
+ export const AnalyticsSegment = (props: any) => {
6
+ const { children } = props
7
+
8
+ const [events] = useEvent()
9
+ const [configState] = useConfig()
10
+ const [segmentClient, setSegmentClient] = useState<any>({})
11
+
12
+ const handleClickProduct = (product: any) => {
13
+ segmentClient.track('Product Clicked', {
14
+ id: product.id,
15
+ name: product.name,
16
+ category: product.category_id,
17
+ price: product.price
18
+ })
19
+ }
20
+
21
+ const handleProductAdded = (product: any) => {
22
+ segmentClient.track('Product Added', {
23
+ id: product.id,
24
+ name: product.name,
25
+ category: product.category_id,
26
+ price: product.price,
27
+ quantity: product.quantity
28
+ })
29
+ }
30
+
31
+ const handleProductRemoved = (product: any) => {
32
+ segmentClient.track('Product Removed', {
33
+ id: product.id,
34
+ name: product.name,
35
+ category: product.category_id,
36
+ price: product.price,
37
+ quantity: product.quantity
38
+ })
39
+ }
40
+
41
+ const handleOrderPlaced = (order: any) => {
42
+ segmentClient.track('Order Placed', {
43
+ id: order.id,
44
+ affiliation: order.business?.name,
45
+ revenue: order.total,
46
+ tax: order.tax_total,
47
+ shipping: order.delivery_zone_price
48
+ })
49
+ segmentClient.track('Payment Info Entered', {
50
+ order: order.id,
51
+ business: order.business?.name,
52
+ business_id: order.business_id,
53
+ total: order.total,
54
+ tax: order.tax_total,
55
+ delivery: order.delivery_zone_price,
56
+ paymethod: order.paymethod
57
+ })
58
+ }
59
+
60
+ const handleUpdateOrder = (order: any) => {
61
+ segmentClient.track('Order Updated', {
62
+ id: order.id,
63
+ affiliation: order.business?.name,
64
+ revenue: order.total,
65
+ tax: order.tax_total,
66
+ shipping: order.delivery_zone_price
67
+ })
68
+ }
69
+
70
+ const handleAddOrder = (order: any) => {
71
+ segmentClient.track('Order Added', {
72
+ id: order.id,
73
+ affiliation: order.business?.name,
74
+ revenue: order.total,
75
+ tax: order.tax_total,
76
+ shipping: order.delivery_zone_price
77
+ })
78
+ }
79
+
80
+ const handleLogin = (data: any) => {
81
+ segmentClient.identify(data.id, {
82
+ email: data.email,
83
+ name: data.name
84
+ })
85
+ }
86
+
87
+ useEffect(() => {
88
+ if (segmentClient?.config?.writeKey) {
89
+ events.on('product_clicked', handleClickProduct)
90
+ events.on('userLogin', handleLogin)
91
+ events.on('product_added', handleProductAdded)
92
+ events.on('order_placed', handleOrderPlaced)
93
+ events.on('order_updated', handleUpdateOrder)
94
+ events.on('order_added', handleAddOrder)
95
+ events.on('cart_product_removed', handleProductRemoved)
96
+ }
97
+ return () => {
98
+ if (segmentClient?.config?.writeKey) {
99
+ events.off('product_clicked', handleClickProduct)
100
+ events.off('userLogin', handleLogin)
101
+ events.off('product_added', handleProductAdded)
102
+ events.off('order_placed', handleOrderPlaced)
103
+ events.off('order_updated', handleUpdateOrder)
104
+ events.off('order_added', handleAddOrder)
105
+ events.off('cart_product_removed', handleProductRemoved)
106
+ }
107
+ }
108
+ }, [segmentClient])
109
+
110
+ useEffect(() => {
111
+ if (configState?.configs?.segment_track_id?.value) {
112
+ const _segmentClient: any = createClient({
113
+ writeKey: configState?.configs?.segment_track_id?.value
114
+ });
115
+ setSegmentClient(_segmentClient)
116
+ }
117
+ }, [configState])
118
+
119
+ return (
120
+ <>
121
+ <AnalyticsProvider client={segmentClient}>
122
+ {children}
123
+ </AnalyticsProvider>
124
+ </>
125
+
126
+ )
127
+ }
@@ -29,7 +29,7 @@ const types = ['food', 'laundry', 'alcohol', 'groceries'];
29
29
  export const BusinessBasicInformation = (
30
30
  props: BusinessBasicInformationParams,
31
31
  ) => {
32
- const { navigation, businessState, isBusinessInfoShow, logo, header } = props;
32
+ const { navigation, businessState, isBusinessInfoShow, logo, header, isPreOrder } = props;
33
33
  const { business, loading } = businessState;
34
34
 
35
35
  const theme = useTheme();
@@ -181,12 +181,16 @@ export const BusinessBasicInformation = (
181
181
  <WrapReviews>
182
182
  {!isBusinessInfoShow && (
183
183
  <>
184
- <TouchableOpacity onPress={() => navigation.navigate('BusinessPreorder', { business: businessState?.business, handleBusinessClick: () => navigation?.goBack() })}>
185
- <OText color={theme.colors.textSecondary} style={{ textDecorationLine: 'underline' }}>
186
- {t('PRE_ORDER', 'Preorder')}
187
- </OText>
188
- </TouchableOpacity>
189
- <OText size={12} color={theme.colors.textSecondary}>{' \u2022 '}</OText>
184
+ { isPreOrder && (
185
+ <>
186
+ <TouchableOpacity onPress={() => navigation.navigate('BusinessPreorder', { business: businessState?.business, handleBusinessClick: () => navigation?.goBack() })}>
187
+ <OText color={theme.colors.textSecondary} style={{ textDecorationLine: 'underline' }}>
188
+ {t('PRE_ORDER', 'Preorder')}
189
+ </OText>
190
+ </TouchableOpacity>
191
+ <OText size={12} color={theme.colors.textSecondary}>{' \u2022 '}</OText>
192
+ </>
193
+ )}
190
194
  <TouchableOpacity onPress={() => setOpenBusinessReviews(true)}>
191
195
  <OText color={theme.colors.textSecondary} style={{ textDecorationLine: 'underline' }}>
192
196
  {t('REVIEWS', 'Reviews')}
@@ -4,6 +4,7 @@ import {
4
4
  useUtils,
5
5
  useOrder,
6
6
  useLanguage,
7
+ useConfig
7
8
  } from 'ordering-components/native';
8
9
  import { OIcon, OText } from '../shared';
9
10
  import { StyleSheet, View } from 'react-native';
@@ -29,9 +30,9 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
29
30
  const [{ parsePrice, parseDistance, parseNumber, optimizeImage }] =
30
31
  useUtils();
31
32
  const [orderState] = useOrder();
33
+ const [configState] = useConfig();
32
34
  const [, t] = useLanguage();
33
35
  const theme = useTheme()
34
-
35
36
  const styles = StyleSheet.create({
36
37
  headerStyle: {
37
38
  borderTopLeftRadius: 7.6,
@@ -111,7 +112,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
111
112
  <FastImage
112
113
  style={{ height: 120 }}
113
114
  source={{
114
- uri: optimizeImage(business?.header, 'h_120,c_limit'),
115
+ uri: optimizeImage(business?.header, 'h_500,c_limit'),
115
116
  priority: FastImage.priority.normal,
116
117
  }}
117
118
  resizeMode={FastImage.resizeMode.cover}
@@ -122,7 +123,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
122
123
  </View>
123
124
  )}
124
125
  <BusinessState>
125
- {!isBusinessOpen && (
126
+ {!isBusinessOpen && (configState?.configs?.preorder_status_enabled?.value === '1') && (
126
127
  <View style={styles.businessStateView}>
127
128
  <OText
128
129
  color={theme.colors.textThird}
@@ -140,7 +141,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
140
141
  <FastImage
141
142
  style={{ width: 56, height: 56 }}
142
143
  source={{
143
- uri: optimizeImage(business?.logo, 'h_60,c_limit'),
144
+ uri: optimizeImage(business?.logo, 'h_150,c_limit'),
144
145
  priority: FastImage.priority.normal,
145
146
  }}
146
147
  resizeMode={FastImage.resizeMode.cover}
@@ -7,6 +7,7 @@ import { useTheme } from 'styled-components/native'
7
7
  import IconAntDesign from 'react-native-vector-icons/AntDesign'
8
8
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
9
9
  import SelectDropdown from 'react-native-select-dropdown'
10
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
10
11
 
11
12
  const windowHeight = Dimensions.get('window').height;
12
13
 
@@ -18,6 +19,7 @@ const BusinessMenuListUI = (props: BusinessMenuListParams) => {
18
19
 
19
20
  const [, t] = useLanguage()
20
21
  const theme = useTheme()
22
+ const {top} = useSafeAreaInsets()
21
23
 
22
24
  const styles = StyleSheet.create({
23
25
  container: {
@@ -81,7 +83,7 @@ const BusinessMenuListUI = (props: BusinessMenuListParams) => {
81
83
  dropdownStyle={{
82
84
  borderRadius: 8,
83
85
  borderColor: theme.colors.lightGray,
84
- marginTop: Platform.OS === 'ios' ? 12 : -15,
86
+ marginTop: Platform.OS === 'ios' ? 12 : -top,
85
87
  maxHeight: 160
86
88
  }}
87
89
  rowStyle={{
@@ -123,4 +125,4 @@ export const BusinessMenuList = (props: any) => {
123
125
  };
124
126
 
125
127
  return <BusinessMenuListing {...businessMenuListProps} />;
126
- };
128
+ };