ordering-ui-react-native 0.15.25 → 0.15.26-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 (159) hide show
  1. package/package.json +3 -2
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessController/index.tsx +8 -2
  4. package/src/components/BusinessTypeFilter/index.tsx +4 -1
  5. package/src/components/BusinessesListing/index.tsx +1 -1
  6. package/src/components/Checkout/index.tsx +0 -1
  7. package/src/components/LanguageSelector/index.tsx +7 -2
  8. package/src/components/OrderDetails/index.tsx +2 -2
  9. package/src/components/PaymentOptions/index.tsx +9 -16
  10. package/src/components/PaymentOptionsWebView/index.tsx +123 -124
  11. package/src/components/SingleProductCard/index.tsx +16 -4
  12. package/src/components/StripeElementsForm/index.tsx +27 -48
  13. package/src/components/UserProfileForm/index.tsx +63 -6
  14. package/src/components/UserProfileForm/styles.tsx +8 -0
  15. package/src/components/VerifyPhone/styles.tsx +1 -2
  16. package/src/components/shared/OModal.tsx +1 -1
  17. package/src/config.json +0 -2
  18. package/src/hooks/useCountdownTimer.tsx +26 -0
  19. package/src/navigators/HomeNavigator.tsx +6 -0
  20. package/src/pages/BusinessProductsList.tsx +1 -0
  21. package/src/pages/BusinessesListing.tsx +1 -1
  22. package/src/pages/Checkout.tsx +1 -1
  23. package/src/pages/Sessions.tsx +22 -0
  24. package/src/types/index.tsx +5 -11
  25. package/src/utils/index.tsx +68 -1
  26. package/themes/business/index.tsx +2 -0
  27. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +103 -15
  28. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -0
  29. package/themes/business/src/components/Chat/index.tsx +38 -86
  30. package/themes/business/src/components/Home/index.tsx +128 -55
  31. package/themes/business/src/components/Home/styles.tsx +8 -1
  32. package/themes/business/src/components/LoginForm/index.tsx +89 -2
  33. package/themes/business/src/components/LoginForm/styles.tsx +6 -0
  34. package/themes/business/src/components/NewOrderNotification/index.tsx +61 -98
  35. package/themes/business/src/components/OrderDetails/Business.tsx +2 -1
  36. package/themes/business/src/components/OrderDetails/Delivery.tsx +32 -15
  37. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +151 -89
  38. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +91 -17
  39. package/themes/business/src/components/OrderDetails/styles.tsx +7 -0
  40. package/themes/business/src/components/OrdersListManager/index.tsx +874 -0
  41. package/themes/business/src/components/OrdersListManager/styles.tsx +123 -0
  42. package/themes/business/src/components/OrdersListManager/utils.tsx +216 -0
  43. package/themes/business/src/components/OrdersOption/index.tsx +54 -50
  44. package/themes/business/src/components/PreviousOrders/index.tsx +75 -22
  45. package/themes/business/src/components/shared/OModal.tsx +1 -1
  46. package/themes/business/src/types/index.tsx +5 -1
  47. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  48. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  49. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  50. package/themes/kiosk/src/components/Cart/index.tsx +98 -24
  51. package/themes/kiosk/src/components/Cart/styles.tsx +6 -0
  52. package/themes/kiosk/src/components/CartBottomSheet/index.tsx +1 -1
  53. package/themes/kiosk/src/components/CartBottomSheet/styles.tsx +1 -1
  54. package/themes/kiosk/src/components/CartContent/index.tsx +13 -3
  55. package/themes/kiosk/src/components/CartItem/index.tsx +20 -8
  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/NavBar/index.tsx +14 -14
  59. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  60. package/themes/kiosk/src/components/OrderDetails/index.tsx +136 -41
  61. package/themes/kiosk/src/components/OrderDetails/styles.tsx +5 -0
  62. package/themes/kiosk/src/components/OrderSummary/index.tsx +1 -1
  63. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +10 -12
  64. package/themes/kiosk/src/components/ProductForm/index.tsx +174 -125
  65. package/themes/kiosk/src/components/ProductForm/styles.tsx +1 -1
  66. package/themes/kiosk/src/components/ProductOption/index.tsx +1 -0
  67. package/themes/kiosk/src/components/ProductOption/styles.tsx +1 -0
  68. package/themes/kiosk/src/components/UpsellingProducts/index.tsx +48 -34
  69. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  70. package/themes/kiosk/src/types/index.d.ts +2 -0
  71. package/themes/original/index.tsx +178 -1
  72. package/themes/original/src/components/AddressForm/index.tsx +15 -10
  73. package/themes/original/src/components/AddressList/index.tsx +56 -18
  74. package/themes/original/src/components/AppleLogin/index.tsx +117 -78
  75. package/themes/original/src/components/BusinessBasicInformation/index.tsx +96 -45
  76. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +28 -1
  77. package/themes/original/src/components/BusinessController/index.tsx +52 -22
  78. package/themes/original/src/components/BusinessController/styles.tsx +22 -0
  79. package/themes/original/src/components/BusinessFeaturedController/index.tsx +20 -1
  80. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +23 -0
  81. package/themes/original/src/components/BusinessListingSearch/index.tsx +121 -7
  82. package/themes/original/src/components/BusinessListingSearch/styles.tsx +14 -1
  83. package/themes/original/src/components/BusinessMenuList/index.tsx +11 -4
  84. package/themes/original/src/components/BusinessPreorder/index.tsx +142 -122
  85. package/themes/original/src/components/BusinessProductsCategories/index.tsx +9 -7
  86. package/themes/original/src/components/BusinessProductsList/index.tsx +127 -20
  87. package/themes/original/src/components/BusinessProductsList/styles.tsx +29 -2
  88. package/themes/original/src/components/BusinessProductsListing/index.tsx +92 -37
  89. package/themes/original/src/components/BusinessProductsListing/styles.tsx +22 -0
  90. package/themes/original/src/components/BusinessReviews/index.tsx +4 -25
  91. package/themes/original/src/components/BusinessTypeFilter/index.tsx +1 -2
  92. package/themes/original/src/components/BusinessesListing/index.tsx +51 -58
  93. package/themes/original/src/components/Cart/index.tsx +19 -15
  94. package/themes/original/src/components/CartContent/index.tsx +2 -2
  95. package/themes/original/src/components/Checkout/index.tsx +42 -27
  96. package/themes/original/src/components/ForgotPasswordForm/index.tsx +84 -4
  97. package/themes/original/src/components/GoogleMap/index.tsx +1 -0
  98. package/themes/original/src/components/Help/index.tsx +21 -4
  99. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +97 -89
  100. package/themes/original/src/components/Home/index.tsx +1 -1
  101. package/themes/original/src/components/LastOrders/index.tsx +12 -1
  102. package/themes/original/src/components/LoginForm/Otp/index.tsx +90 -0
  103. package/themes/original/src/components/LoginForm/Otp/styles.tsx +7 -0
  104. package/themes/original/src/components/LoginForm/index.tsx +389 -156
  105. package/themes/original/src/components/LoginForm/styles.tsx +7 -4
  106. package/themes/original/src/components/LogoutButton/index.tsx +7 -1
  107. package/themes/original/src/components/MessageListing/index.tsx +10 -1
  108. package/themes/original/src/components/Messages/index.tsx +34 -25
  109. package/themes/original/src/components/Messages/styles.tsx +1 -3
  110. package/themes/original/src/components/MomentOption/index.tsx +10 -1
  111. package/themes/original/src/components/MomentOption/styles.tsx +1 -1
  112. package/themes/original/src/components/OrderDetails/index.tsx +35 -28
  113. package/themes/original/src/components/OrderDetails/styles.tsx +1 -2
  114. package/themes/original/src/components/OrderProgress/index.tsx +4 -4
  115. package/themes/original/src/components/OrderProgress/styles.tsx +1 -0
  116. package/themes/original/src/components/OrderSummary/index.tsx +3 -3
  117. package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -2
  118. package/themes/original/src/components/OrdersOption/index.tsx +25 -33
  119. package/themes/original/src/components/OrdersOption/styles.tsx +0 -6
  120. package/themes/original/src/components/PaymentOptionCash/index.tsx +2 -2
  121. package/themes/original/src/components/PaymentOptionWallet/index.tsx +22 -24
  122. package/themes/original/src/components/PaymentOptionWallet/styles.tsx +1 -1
  123. package/themes/original/src/components/PaymentOptions/index.tsx +9 -19
  124. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  125. package/themes/original/src/components/PreviousOrders/index.tsx +19 -13
  126. package/themes/original/src/components/ProductForm/index.tsx +76 -61
  127. package/themes/original/src/components/ProductForm/styles.tsx +2 -2
  128. package/themes/original/src/components/ProductItemAccordion/index.tsx +2 -2
  129. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -12
  130. package/themes/original/src/components/Promotions/index.tsx +250 -0
  131. package/themes/original/src/components/Promotions/styles.tsx +60 -0
  132. package/themes/original/src/components/ReviewOrder/index.tsx +10 -9
  133. package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
  134. package/themes/original/src/components/Sessions/index.tsx +160 -0
  135. package/themes/original/src/components/Sessions/styles.tsx +15 -0
  136. package/themes/original/src/components/SingleProductCard/index.tsx +47 -21
  137. package/themes/original/src/components/SingleProductCard/styles.tsx +28 -1
  138. package/themes/original/src/components/StripeElementsForm/index.tsx +55 -72
  139. package/themes/original/src/components/TaxInformation/index.tsx +10 -4
  140. package/themes/original/src/components/UpsellingProducts/index.tsx +87 -71
  141. package/themes/original/src/components/UserDetails/index.tsx +4 -95
  142. package/themes/original/src/components/UserFormDetails/index.tsx +32 -31
  143. package/themes/original/src/components/UserProfile/index.tsx +62 -14
  144. package/themes/original/src/components/UserProfileForm/index.tsx +20 -18
  145. package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
  146. package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
  147. package/themes/original/src/components/Wallets/index.tsx +76 -9
  148. package/themes/original/src/components/Wallets/styles.tsx +21 -0
  149. package/themes/original/src/components/shared/HeaderTitle.tsx +21 -0
  150. package/themes/original/src/components/shared/OModal.tsx +1 -1
  151. package/themes/original/src/components/shared/index.tsx +2 -0
  152. package/themes/original/src/config/constants.tsx +6 -6
  153. package/themes/original/src/types/index.tsx +62 -5
  154. package/themes/original/src/utils/index.tsx +28 -2
  155. package/themes/single-business/src/components/AddressList/index.tsx +1 -1
  156. package/themes/single-business/src/components/OrderTypeSelector/index.tsx +6 -6
  157. package/themes/single-business/src/components/UserProfile/index.tsx +1 -1
  158. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  159. package/src/components/StripeMethodForm/index.tsx +0 -168
@@ -7,11 +7,10 @@ import {
7
7
  useConfirmSetupIntent,
8
8
  createPaymentMethod
9
9
  } from '@stripe/stripe-react-native';
10
- import configs from '../../config.json'
10
+
11
11
  import { ErrorMessage } from './styles';
12
12
 
13
13
  import { StripeElementsForm as StripeFormController } from './naked';
14
- import { StripeMethodForm } from '../StripeMethodForm';
15
14
  import { OButton, OText } from '../shared';
16
15
  import { useTheme } from 'styled-components/native';
17
16
 
@@ -23,10 +22,6 @@ const StripeElementsFormUI = (props: any) => {
23
22
  businessId,
24
23
  requirements,
25
24
  stripeTokenHandler,
26
- methodsPay,
27
- paymethod,
28
- onCancel,
29
- cart
30
25
  } = props;
31
26
 
32
27
  const theme = useTheme();
@@ -126,49 +121,33 @@ const StripeElementsFormUI = (props: any) => {
126
121
  <View style={styles.container}>
127
122
  {publicKey ? (
128
123
  <View style={{ flex: 1 }}>
129
- <StripeProvider
130
- publishableKey={publicKey}
131
- merchantIdentifier={`merchant.${configs.apple_app_id}`}
132
- >
133
- {methodsPay?.includes(paymethod) ? (
134
- <StripeMethodForm
135
- handleSource={handleSource}
136
- onCancel={onCancel}
137
- cart={cart}
138
- setErrors={setErrors}
139
- paymethod={paymethod}
140
- devMode={publicKey?.includes('test')}
141
- />
142
- ) : (
143
- <CardField
144
- postalCodeEnabled={true}
145
- cardStyle={{
146
- backgroundColor: '#FFFFFF',
147
- textColor: '#000000',
148
- }}
149
- style={{
150
- width: '100%',
151
- height: 50,
152
- marginVertical: 30,
153
- zIndex: 9999,
154
- }}
155
- onCardChange={(cardDetails: any) => setCard(cardDetails)}
156
- />
157
- )}
158
- </StripeProvider>
159
- {!methodsPay?.includes(paymethod) && (
160
- <OButton
161
- text={t('SAVE_CARD', 'Save card')}
162
- bgColor={isCompleted ? theme.colors.primary : theme.colors.backgroundGray}
163
- borderColor={isCompleted ? theme.colors.primary :theme.colors.backgroundGray}
164
- style={styles.btnAddStyle}
165
- textStyle={{color: 'white'}}
166
- imgRightSrc={null}
167
- onClick={() => handleSaveCard()}
168
- isDisabled={!isCompleted}
169
- isLoading={confirmSetupLoading || values.loadingAdd || createPmLoading}
124
+ <StripeProvider publishableKey={publicKey}>
125
+ <CardField
126
+ postalCodeEnabled={true}
127
+ cardStyle={{
128
+ backgroundColor: '#FFFFFF',
129
+ textColor: '#000000',
130
+ }}
131
+ style={{
132
+ width: '100%',
133
+ height: 50,
134
+ marginVertical: 30,
135
+ zIndex: 9999,
136
+ }}
137
+ onCardChange={(cardDetails: any) => setCard(cardDetails)}
170
138
  />
171
- )}
139
+ </StripeProvider>
140
+ <OButton
141
+ text={t('SAVE_CARD', 'Save card')}
142
+ bgColor={isCompleted ? theme.colors.primary : theme.colors.backgroundGray}
143
+ borderColor={isCompleted ? theme.colors.primary :theme.colors.backgroundGray}
144
+ style={styles.btnAddStyle}
145
+ textStyle={{color: 'white'}}
146
+ imgRightSrc={null}
147
+ onClick={() => handleSaveCard()}
148
+ isDisabled={!isCompleted}
149
+ isLoading={confirmSetupLoading || values.loadingAdd || createPmLoading}
150
+ />
172
151
  {!!errors && (
173
152
  <ErrorMessage>
174
153
  <OText
@@ -1,5 +1,6 @@
1
- import React from 'react';
1
+ import React, { useEffect, useState } from 'react';
2
2
  import {
3
+ UserFormDetails as UserProfileController,
3
4
  useSession,
4
5
  useLanguage,
5
6
  } from 'ordering-components/native';
@@ -13,6 +14,7 @@ import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityI
13
14
  import Ionicons from 'react-native-vector-icons/Ionicons'
14
15
 
15
16
  import {
17
+ OAlert,
16
18
  OIcon,
17
19
  OText
18
20
  } from '../shared';
@@ -20,18 +22,24 @@ import {
20
22
  Container,
21
23
  Names,
22
24
  UserInfoContainer,
23
- LanguageContainer
25
+ LanguageContainer,
26
+ RemoveAccountContainer
24
27
  } from './styles';
25
28
 
26
- export const UserProfileForm = (props: ProfileParams) => {
29
+ export const UserProfileFormUI = (props: ProfileParams) => {
27
30
  const {
28
- navigation
31
+ navigation,
32
+ handleRemoveAccount,
33
+ removeAccountState
29
34
  } = props;
30
35
 
31
36
  const theme = useTheme();
32
- const [{ user }] = useSession();
37
+ const [{ user }, { logout }] = useSession();
33
38
  const [, t] = useLanguage();
34
39
 
40
+ const isAdmin = user?.level === 0
41
+ const [confirm, setConfirm] = useState<any>({ open: false, content: null, handleOnAccept: null, id: null, title: null })
42
+
35
43
  const styles = StyleSheet.create({
36
44
  linkStyle: {
37
45
  color: theme.colors.primary,
@@ -44,6 +52,9 @@ export const UserProfileForm = (props: ProfileParams) => {
44
52
  },
45
53
  iconStyle: {
46
54
  fontSize: 24
55
+ },
56
+ removeAccount: {
57
+ flexDirection: 'row'
47
58
  }
48
59
  });
49
60
 
@@ -78,13 +89,31 @@ export const UserProfileForm = (props: ProfileParams) => {
78
89
  },
79
90
  chevronUp: {
80
91
  display: 'none'
81
- }
92
+ },
82
93
  })
83
94
 
84
95
  const onRedirect = (route: string, params?: any) => {
85
96
  navigation.navigate(route, params)
86
97
  }
87
98
 
99
+ const onRemoveAccount = () => {
100
+ setConfirm({
101
+ open: true,
102
+ content: [t('QUESTION_REMOVE_ACCOUNT', 'Are you sure that you want to remove your account?')],
103
+ title: t('ACCOUNT_ALERT', 'Account alert'),
104
+ handleOnAccept: () => {
105
+ setConfirm({ ...confirm, open: false })
106
+ handleRemoveAccount && handleRemoveAccount(user?.id)
107
+ }
108
+ })
109
+ }
110
+
111
+ useEffect(() => {
112
+ if (removeAccountState?.result === 'OK') {
113
+ logout()
114
+ }
115
+ }, [removeAccountState])
116
+
88
117
  return (
89
118
  <Container>
90
119
  <View>
@@ -134,7 +163,35 @@ export const UserProfileForm = (props: ProfileParams) => {
134
163
  <LanguageSelector pickerStyle={_pickerStyle} />
135
164
  </LanguageContainer>
136
165
  <LogoutButton />
166
+ <RemoveAccountContainer>
167
+ <TouchableOpacity
168
+ disabled={isAdmin}
169
+ style={styles.removeAccount}
170
+ onPress={() => onRemoveAccount()}
171
+ activeOpacity={0.7}
172
+ >
173
+ <OIcon src={theme.images.general.user} width={20} color={theme.colors.black} style={{ marginEnd: 14 }} />
174
+ <OText size={14} weight={'400'} style={{ opacity: isAdmin ? 0.5 : 1, top: 1 }} color={theme.colors.red}>{t('REMOVE_ACCOUNT', 'Remove account')}</OText>
175
+ </TouchableOpacity>
176
+ </RemoveAccountContainer>
137
177
  </View>
178
+ <OAlert
179
+ open={confirm.open}
180
+ title={confirm.title}
181
+ content={confirm.content}
182
+ onAccept={confirm.handleOnAccept}
183
+ onCancel={() => setConfirm({ ...confirm, open: false, title: null })}
184
+ onClose={() => setConfirm({ ...confirm, open: false, title: null })}
185
+ />
138
186
  </Container>
139
187
  );
140
188
  };
189
+
190
+ export const UserProfileForm = (props: any) => {
191
+ const profileProps = {
192
+ ...props,
193
+ UIComponent: UserProfileFormUI,
194
+ useSessionUser: true
195
+ };
196
+ return <UserProfileController {...profileProps} />;
197
+ };
@@ -35,3 +35,11 @@ export const LanguageContainer = styled.View`
35
35
  align-items: center;
36
36
  margin-bottom: 10px;
37
37
  `
38
+
39
+ export const RemoveAccountContainer = styled.View`
40
+ flex-direction: row;
41
+ justify-content: flex-start;
42
+ align-items: center;
43
+ margin-bottom: 10px;
44
+ margin-top: 15px;
45
+ `
@@ -2,7 +2,7 @@ import styled from 'styled-components/native';
2
2
 
3
3
  export const Container = styled.View`
4
4
  width: 100%;
5
- padding: 0 43px;
5
+ padding: 0 30px;
6
6
  `
7
7
 
8
8
  export const CountDownContainer = styled.View`
@@ -20,7 +20,6 @@ export const ResendSection = styled.View`
20
20
  display: flex;
21
21
  flex-direction: row;
22
22
  justify-content: center;
23
- flex-wrap: wrap;
24
23
  `
25
24
 
26
25
  export const WrappCountdown = styled.View`
@@ -78,7 +78,7 @@ const OModal = (props: Props): React.ReactElement => {
78
78
  animationType="slide"
79
79
  transparent={isTransparent}
80
80
  visible={open}
81
- onRequestClose={() => { onClose() }}
81
+ onRequestClose={() => { onClose && onClose() }}
82
82
  style={{ height: '100%', flex: 1, position: 'absolute', ...style, zIndex: 9999 }}
83
83
  >
84
84
  {isAvoidKeyBoardView ? (
package/src/config.json CHANGED
@@ -3,8 +3,6 @@
3
3
  "notification_app": "orderingapp",
4
4
  "app_name": "Ordering",
5
5
  "project": "reactdemo",
6
- "apple_app_id": "com.delivery",
7
- "android_app_id": "com.delivery",
8
6
  "api": {
9
7
  "url": "https://apiv4.ordering.co",
10
8
  "language": "en",
@@ -0,0 +1,26 @@
1
+ import { useEffect, useState } from 'react'
2
+
3
+ /**
4
+ * Hook for countdown seconds
5
+ * @param {int} initialCount
6
+ * @param {boolean} start
7
+ */
8
+ export function useCountdownTimer (initialCount : number, start : boolean) {
9
+ const [count, setCount] = useState(initialCount)
10
+
11
+ useEffect(() => {
12
+ if (start) {
13
+ const secondsLeft = setInterval(() => {
14
+ setCount(c => c - (c === 0 ? 0 : 1))
15
+ }, 1000)
16
+ return () => clearInterval(secondsLeft)
17
+ }
18
+ }, [start])
19
+
20
+ return [
21
+ count,
22
+ setCount,
23
+ /** reset */
24
+ () => { setCount(initialCount) }
25
+ ]
26
+ }
@@ -20,6 +20,7 @@ import Help from '../pages/Help'
20
20
  import HelpOrder from '../pages/HelpOrder'
21
21
  import HelpGuide from '../pages/HelpGuide'
22
22
  import HelpAccountAndPayment from '../pages/HelpAccountAndPayment'
23
+ import Sessions from '../pages/Sessions';
23
24
  import Splash from '../pages/Splash';
24
25
  import ProductDetails from '../pages/ProductDetails';
25
26
  const Stack = createStackNavigator();
@@ -164,6 +165,11 @@ const HomeNavigator = (e : any) => {
164
165
  component={HelpAccountAndPayment}
165
166
  options={{ headerShown: false }}
166
167
  />
168
+ <Stack.Screen
169
+ name="Sessions"
170
+ component={Sessions}
171
+ options={{ headerShown: false }}
172
+ />
167
173
  </>
168
174
  )}
169
175
  </>
@@ -31,6 +31,7 @@ const BusinessProductsList = (props: any) => {
31
31
  'open',
32
32
  'about',
33
33
  'description',
34
+ 'ribbon',
34
35
  'address',
35
36
  'location',
36
37
  'schedule',
@@ -21,7 +21,7 @@ const BusinessesListing = (props: any) => {
21
21
  ...props,
22
22
  isSearchByName: true,
23
23
  isSearchByDescription: true,
24
- propsToFetch: ['id', 'name', 'header', 'logo', 'location', 'schedule', 'open', 'delivery_price', 'distance', 'delivery_time', 'pickup_time', 'reviews', 'featured', 'offers', 'food', 'laundry', 'alcohol', 'groceries', 'slug'],
24
+ propsToFetch: ['id', 'name', 'header', 'logo', 'ribbon', 'location', 'schedule', 'open', 'delivery_price', 'distance', 'delivery_time', 'pickup_time', 'reviews', 'featured', 'offers', 'food', 'laundry', 'alcohol', 'groceries', 'slug'],
25
25
  onBusinessClick: (business: any) => {
26
26
  props.navigation.navigate('Business', { store: store || business.slug, header: business.header, logo: business.logo })
27
27
  }
@@ -7,7 +7,7 @@ import styled from 'styled-components/native';
7
7
 
8
8
  import { useOrder, useLanguage, ToastType, useToast } from 'ordering-components/native';
9
9
 
10
- const stripePaymentOptions = ['stripe', 'stripe_direct', 'stripe_connect', 'google_pay', 'apple_pay'];
10
+ const stripePaymentOptions = ['stripe', 'stripe_direct', 'stripe_connect'];
11
11
 
12
12
  const KeyboardView = styled.KeyboardAvoidingView`
13
13
  flex: 1;
@@ -0,0 +1,22 @@
1
+ import React from 'react'
2
+ import { Container } from '../../themes/original/src/layouts/Container'
3
+ import { Sessions as SessionsController } from '../../themes/original/src/components/Sessions'
4
+
5
+ interface Props {
6
+ navigation: any;
7
+ route: any;
8
+ }
9
+
10
+ const Sessions = (props: Props) => {
11
+ const sessionsProps = {
12
+ ...props
13
+ }
14
+
15
+ return (
16
+ <Container>
17
+ <SessionsController {...sessionsProps} />
18
+ </Container>
19
+ )
20
+ }
21
+
22
+ export default Sessions
@@ -31,6 +31,8 @@ export interface ProfileParams {
31
31
  validationFields?: any;
32
32
  showField?: any;
33
33
  isRequiredField?: any;
34
+ handleRemoveAccount?: any,
35
+ removeAccountState?: any
34
36
  }
35
37
 
36
38
  export interface AddressListParams {
@@ -143,8 +145,9 @@ export interface BusinessControllerParams {
143
145
  orderType?: any;
144
146
  handleClick?: any;
145
147
  isBusinessOpen?: boolean;
146
- businessWillCloseSoonMinutes?: number
147
- isBusinessClose?: number
148
+ businessWillCloseSoonMinutes?: number;
149
+ isBusinessClose?: number;
150
+ getBusinessOffer: any;
148
151
  }
149
152
  export interface BusinessProductsListingParams {
150
153
  navigation?: any;
@@ -475,12 +478,3 @@ export interface HelpGuideParams {
475
478
  export interface HelpAccountAndPaymentParams {
476
479
  navigation: any;
477
480
  }
478
-
479
- export interface StripeMethodFormParams {
480
- cart: any;
481
- handleSource: ({id, card} : {id : string, card : any}) => void;
482
- onCancel: () => void;
483
- setErrors: (error: string) => void;
484
- paymethod: string;
485
- devMode?: boolean;
486
- }
@@ -200,7 +200,7 @@ export const transformCountryCode = (countryCode : number) => {
200
200
  */
201
201
  export const reviewCommentList = (type: string) => {
202
202
  const [, t] = useLanguage()
203
-
203
+ // TODO: improve this function
204
204
  const reviews: any = {
205
205
  order: {
206
206
  1: {
@@ -386,3 +386,70 @@ export const transformCountryCode = (countryCode : number) => {
386
386
 
387
387
  return reviews[type]
388
388
  }
389
+
390
+ /**
391
+ * function to manage order comment list
392
+ * @param {string} param0 type of orders to return
393
+ * @returns object with orders dictionary
394
+ */
395
+ export const orderCommentList = (value: string) => {
396
+ const [, t] = useLanguage()
397
+ const dictionary: any = {
398
+ reject: 6,
399
+ forcePickUp: 9,
400
+ pickupFailed: 10,
401
+ forceDelivery: 11,
402
+ deliveryFailed: 12,
403
+ notReady: 14
404
+ }
405
+
406
+ const status = dictionary[value]
407
+
408
+ const messages: any = {
409
+ 6: [// on reject order
410
+ 'very_far_away',
411
+ 'driver_vehicle_incident',
412
+ 'destination_unreacheable',
413
+ 'unavailable_driver',
414
+ 'other'
415
+ ],
416
+ 9: [// on force pickup status
417
+ 'forgot_complete_location',
418
+ 'not_internet_conection',
419
+ 'other'
420
+ ],
421
+ 10: [// on pickup failed by driver
422
+ 'very_far_away',
423
+ 'driver_vehicle_incident',
424
+ 'destination_unreacheable',
425
+ 'store_closed',
426
+ 'unavailable_driver',
427
+ 'other'
428
+ ],
429
+ 11: [// on force delivery status
430
+ 'forgot_complete_location',
431
+ 'not_internet_conection',
432
+ 'other'
433
+ ],
434
+ 12: [// on delivery failed by driver
435
+ 'very_far_away',
436
+ 'driver_vehicle_incident',
437
+ 'destination_unreacheable',
438
+ 'recipient_unavailable',
439
+ 'incorrect_missing_items',
440
+ 'refused_damage',
441
+ 'other'
442
+ ],
443
+ 14: [// on order not ready
444
+ 'store_recieve_order_late',
445
+ 'store_busy',
446
+ 'other'
447
+ ]
448
+ }
449
+
450
+ if (!messages[status]) return null
451
+
452
+ const list = messages[status].map((val: any, i: number) => ({ key: i, value: val, content: t(`REJECT_REASON_${val.toUpperCase()}`, val.replace(/_/g, ' ')) }))
453
+
454
+ return { list }
455
+ }
@@ -16,6 +16,7 @@ import { OrderMessage } from './src/components/OrderMessage';
16
16
  import { OrderDetailsBusiness } from './src/components/OrderDetails/Business';
17
17
  import { OrderDetailsDelivery } from './src/components/OrderDetails/Delivery';
18
18
  import { OrdersOption } from './src/components/OrdersOption';
19
+ import { OrdersListManager } from './src/components/OrdersListManager';
19
20
  import { OrdersOptionStatus } from './src/components/OrdersOptionStatus';
20
21
  import { OrdersOptionBusiness } from './src/components/OrdersOptionBusiness';
21
22
  import { OrdersOptionCity } from './src/components/OrdersOptionCity';
@@ -84,6 +85,7 @@ export {
84
85
  OrderDetailsDelivery,
85
86
  OrderMessage,
86
87
  OrdersOption,
88
+ OrdersListManager,
87
89
  OrdersOptionStatus,
88
90
  OrdersOptionBusiness,
89
91
  OrdersOptionCity,