ordering-ui-react-native 0.21.99 → 0.22.0-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 (163) hide show
  1. package/package.json +6 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/StripeMethodForm/index.tsx +4 -2
  5. package/src/components/VerifyPhone/styles.tsx +1 -2
  6. package/src/context/OfflineActions/index.tsx +236 -0
  7. package/src/types/index.tsx +2 -1
  8. package/themes/business/index.tsx +2 -0
  9. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -6
  10. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +1 -0
  11. package/themes/business/src/components/BusinessController/index.tsx +8 -3
  12. package/themes/business/src/components/BusinessProductList/index.tsx +2 -1
  13. package/themes/business/src/components/Chat/index.tsx +15 -3
  14. package/themes/business/src/components/DriverMap/index.tsx +49 -27
  15. package/themes/business/src/components/FloatingButton/index.tsx +3 -2
  16. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  17. package/themes/business/src/components/LanguageSelector/index.tsx +2 -3
  18. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  19. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  20. package/themes/business/src/components/MapView/index.tsx +36 -17
  21. package/themes/business/src/components/NewOrderNotification/index.tsx +40 -27
  22. package/themes/business/src/components/OrderDetails/Business.tsx +74 -9
  23. package/themes/business/src/components/OrderDetails/Delivery.tsx +138 -55
  24. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +125 -43
  25. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +62 -24
  26. package/themes/business/src/components/OrderDetails/styles.tsx +39 -3
  27. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +221 -0
  28. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +3 -2
  29. package/themes/business/src/components/OrderSummary/index.tsx +210 -65
  30. package/themes/business/src/components/OrdersListManager/index.tsx +13 -1
  31. package/themes/business/src/components/OrdersOption/index.tsx +217 -156
  32. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  33. package/themes/business/src/components/PreviousMessages/index.tsx +26 -3
  34. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +39 -16
  35. package/themes/business/src/components/PreviousOrders/index.tsx +76 -66
  36. package/themes/business/src/components/PrinterEdition/MessageAlert.tsx +33 -0
  37. package/themes/business/src/components/PrinterEdition/index.tsx +431 -0
  38. package/themes/business/src/components/PrinterEdition/printerList.tsx +23 -0
  39. package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
  40. package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
  41. package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
  42. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  43. package/themes/business/src/components/StoresList/index.tsx +2 -2
  44. package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
  45. package/themes/business/src/components/UserProfileForm/index.tsx +43 -25
  46. package/themes/business/src/components/WebsocketStatus/index.tsx +2 -2
  47. package/themes/business/src/components/shared/OTextarea.tsx +8 -9
  48. package/themes/business/src/hooks/useLocation.tsx +2 -2
  49. package/themes/business/src/layouts/SafeAreaContainer.tsx +35 -19
  50. package/themes/business/src/types/index.tsx +15 -5
  51. package/themes/business/src/utils/index.tsx +25 -1
  52. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  53. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  54. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  55. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  56. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  57. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  58. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  59. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  60. package/themes/original/index.tsx +11 -0
  61. package/themes/original/src/components/AddressForm/index.tsx +32 -17
  62. package/themes/original/src/components/AddressList/index.tsx +8 -7
  63. package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
  64. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  65. package/themes/original/src/components/BusinessBasicInformation/index.tsx +5 -8
  66. package/themes/original/src/components/BusinessController/index.tsx +5 -5
  67. package/themes/original/src/components/BusinessItemAccordion/index.tsx +13 -5
  68. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +2 -3
  69. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +1 -3
  70. package/themes/original/src/components/BusinessListingSearch/index.tsx +1 -2
  71. package/themes/original/src/components/BusinessPreorder/index.tsx +44 -32
  72. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +73 -70
  73. package/themes/original/src/components/BusinessProductsList/index.tsx +6 -7
  74. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  75. package/themes/original/src/components/BusinessProductsListing/index.tsx +18 -6
  76. package/themes/original/src/components/BusinessTypeFilter/index.tsx +9 -8
  77. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  78. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +1 -1
  79. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  80. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  81. package/themes/original/src/components/Cart/index.tsx +38 -14
  82. package/themes/original/src/components/CartContent/index.tsx +2 -4
  83. package/themes/original/src/components/Checkout/index.tsx +100 -58
  84. package/themes/original/src/components/CitiesControl/index.tsx +0 -3
  85. package/themes/original/src/components/CouponControl/index.tsx +1 -3
  86. package/themes/original/src/components/DriverTips/index.tsx +1 -3
  87. package/themes/original/src/components/Favorite/index.tsx +1 -5
  88. package/themes/original/src/components/FavoriteList/index.tsx +0 -1
  89. package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -7
  90. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +15 -17
  91. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +3 -7
  92. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +24 -32
  93. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +7 -9
  94. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +11 -12
  95. package/themes/original/src/components/GoogleMap/index.tsx +39 -18
  96. package/themes/original/src/components/Help/index.tsx +2 -0
  97. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
  98. package/themes/original/src/components/Home/index.tsx +3 -11
  99. package/themes/original/src/components/LoginForm/Otp/index.tsx +0 -3
  100. package/themes/original/src/components/LoginForm/index.tsx +4 -7
  101. package/themes/original/src/components/MessageListing/index.tsx +2 -1
  102. package/themes/original/src/components/Messages/index.tsx +29 -17
  103. package/themes/original/src/components/MomentOption/TimeListItem.tsx +56 -0
  104. package/themes/original/src/components/MomentOption/index.tsx +79 -56
  105. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  106. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
  107. package/themes/original/src/components/MultiCheckout/index.tsx +55 -27
  108. package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -0
  109. package/themes/original/src/components/MyOrders/index.tsx +2 -2
  110. package/themes/original/src/components/NavBar/index.tsx +7 -4
  111. package/themes/original/src/components/NetworkError/index.tsx +0 -5
  112. package/themes/original/src/components/NotFoundSource/index.tsx +0 -3
  113. package/themes/original/src/components/OrderDetails/OrderEta.tsx +4 -3
  114. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +13 -10
  115. package/themes/original/src/components/OrderDetails/index.tsx +42 -19
  116. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  117. package/themes/original/src/components/OrderProgress/index.tsx +5 -4
  118. package/themes/original/src/components/OrderSummary/index.tsx +29 -10
  119. package/themes/original/src/components/OrderTypeSelector/index.tsx +7 -6
  120. package/themes/original/src/components/OrdersOption/index.tsx +3 -6
  121. package/themes/original/src/components/PaymentOptionStripe/index.tsx +0 -5
  122. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  123. package/themes/original/src/components/PaymentOptions/index.tsx +10 -8
  124. package/themes/original/src/components/PlaceSpot/index.tsx +1 -3
  125. package/themes/original/src/components/PreviousOrders/index.tsx +1 -2
  126. package/themes/original/src/components/ProductForm/ActionButton.tsx +17 -20
  127. package/themes/original/src/components/ProductForm/index.tsx +107 -102
  128. package/themes/original/src/components/ProductItemAccordion/index.tsx +51 -44
  129. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
  130. package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
  131. package/themes/original/src/components/ProfessionalProfile/index.tsx +4 -5
  132. package/themes/original/src/components/Promotions/index.tsx +6 -9
  133. package/themes/original/src/components/ReviewDriver/index.tsx +1 -1
  134. package/themes/original/src/components/ReviewOrder/index.tsx +2 -2
  135. package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
  136. package/themes/original/src/components/ReviewTrigger/index.tsx +2 -2
  137. package/themes/original/src/components/ServiceForm/index.tsx +52 -54
  138. package/themes/original/src/components/Sessions/index.tsx +3 -3
  139. package/themes/original/src/components/SignupForm/index.tsx +86 -78
  140. package/themes/original/src/components/SingleOrderCard/index.tsx +6 -4
  141. package/themes/original/src/components/SingleProductCard/index.tsx +3 -4
  142. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  143. package/themes/original/src/components/StripeCardForm/index.tsx +0 -3
  144. package/themes/original/src/components/StripeCardsList/index.tsx +10 -3
  145. package/themes/original/src/components/StripeElementsForm/index.tsx +76 -62
  146. package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
  147. package/themes/original/src/components/StripeRedirectForm/index.tsx +0 -3
  148. package/themes/original/src/components/TaxInformation/index.tsx +3 -2
  149. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +10 -7
  150. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +8 -3
  151. package/themes/original/src/components/UserDetails/index.tsx +3 -2
  152. package/themes/original/src/components/UserFormDetails/index.tsx +154 -130
  153. package/themes/original/src/components/UserProfile/index.tsx +9 -1
  154. package/themes/original/src/components/UserVerification/index.tsx +14 -4
  155. package/themes/original/src/components/Wallets/index.tsx +6 -3
  156. package/themes/original/src/components/WebsocketStatus/index.tsx +1 -4
  157. package/themes/original/src/components/shared/OAlert.tsx +2 -1
  158. package/themes/original/src/components/shared/OButton.tsx +5 -4
  159. package/themes/original/src/components/shared/OInput.tsx +4 -8
  160. package/themes/original/src/components/shared/OModal.tsx +7 -2
  161. package/themes/original/src/types/index.tsx +5 -1
  162. package/themes/original/src/utils/index.tsx +30 -1
  163. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -0,0 +1,267 @@
1
+ import React, { useEffect, useState } from 'react'
2
+ import { StyleSheet, TouchableOpacity, View, Dimensions } from 'react-native'
3
+ import SimpleLineIcons from 'react-native-vector-icons/SimpleLineIcons'
4
+ import FeatherIcon from 'react-native-vector-icons/Feather'
5
+ import { useTheme } from 'styled-components/native'
6
+ import ToggleSwitch from 'toggle-switch-react-native';
7
+ import { useLanguage } from 'ordering-components/native'
8
+
9
+ import { _setStoreData, _retrieveStoreData } from '../../providers/StoreUtil'
10
+ import { Container, ContainerList, EnabledAutoPrint, NoPrintersContainer } from './styles'
11
+ import { OText, OIcon, OModal, OButton } from '../shared'
12
+ import { PrinterEdition } from '../PrinterEdition'
13
+
14
+ export const PrinterSettings = (props: any) => {
15
+ const { navigation, onClose } = props
16
+
17
+ const [printers, setPrinters] = useState<any>({ list: [] })
18
+ const [autoPrintEnabled, setAutoPrintEnabled] = useState<boolean>(false)
19
+ const [openModal, setOpenModal] = useState<any>({ open: false, data: null })
20
+
21
+ const WIDTH_SCREEN = Dimensions.get('window').width
22
+ const HEIGHT_SCREEN = Dimensions.get('window').height
23
+
24
+ const [, t] = useLanguage()
25
+ const theme = useTheme()
26
+
27
+ const styles = StyleSheet.create({
28
+ icons: {
29
+ maxWidth: 40,
30
+ height: 40,
31
+ padding: 10,
32
+ alignItems: 'flex-end'
33
+ },
34
+ optionIcons: {
35
+ padding: 8,
36
+ borderWidth: 1,
37
+ marginRight: 10,
38
+ borderRadius: 8,
39
+ },
40
+ wIconContainer: {
41
+ flexDirection: 'row',
42
+ alignItems: 'center',
43
+ width: WIDTH_SCREEN - 40 - 22 - 22 - 10, // screen - margin - icon - icon - marginIcon
44
+ },
45
+ wrapperContainer: {
46
+ flexDirection: 'column',
47
+ },
48
+ wrapperIcons: {
49
+ flexDirection: 'row',
50
+ justifyContent: 'flex-start',
51
+ marginBottom: 5,
52
+ },
53
+ inputStyle: {
54
+ height: 40,
55
+ borderWidth: 1,
56
+ borderRadius: 8,
57
+ },
58
+ btnBackArrow: {
59
+ borderWidth: 0,
60
+ width: 32,
61
+ height: 32,
62
+ tintColor: theme.colors.textGray,
63
+ backgroundColor: theme.colors.clear,
64
+ borderColor: theme.colors.clear,
65
+ shadowColor: theme.colors.clear,
66
+ paddingLeft: 0,
67
+ paddingRight: 0,
68
+ },
69
+ titleGroups: {
70
+ alignItems: 'center',
71
+ flexDirection: 'row',
72
+ minHeight: 33,
73
+ },
74
+ addButtonText: {
75
+ color: theme.colors.inputTextColor,
76
+ fontSize: 16,
77
+ },
78
+ addButton: {
79
+ height: 40,
80
+ marginTop: 10,
81
+ borderRadius: 8,
82
+ marginRight: 10,
83
+ marginBottom: 10,
84
+ },
85
+ })
86
+
87
+ const goToBack = () => navigation?.canGoBack() && navigation.goBack()
88
+
89
+ const handleClick = async ({ item, type, ip, edit, isAdd, index }: any) => {
90
+ let _item = item
91
+ const action = edit || isAdd
92
+ let _printers = printers.list
93
+ const idx = index ?? _printers.findIndex((p: any) => p.model === _item.model)
94
+
95
+ if (idx !== -1 && !action) {
96
+ _printers.splice(idx, 1);
97
+ } else {
98
+ const _currentPrinter = _printers.find((p: any) => p.model === _item?.model)
99
+ _item = {
100
+ ..._currentPrinter,
101
+ ...item,
102
+ type: type ?? _currentPrinter?.type ?? 1,
103
+ ip: ip ?? _currentPrinter?.ip ?? '',
104
+ portName: (type ?? _currentPrinter?.type) === 1 || !ip
105
+ ? item?.bt ?? item.portName1 ?? _currentPrinter?.portName1
106
+ : `TCP:${ip}`
107
+ }
108
+ edit ? (_printers[idx] = _item) : _printers.push(_item)
109
+ }
110
+
111
+ setPrinters({ list: _printers })
112
+ await _setStoreData('printers', _printers)
113
+ type === 1 && onClose && onClose()
114
+ }
115
+
116
+ const handleAutoPrint = async () => {
117
+ setAutoPrintEnabled(!autoPrintEnabled)
118
+ await _setStoreData('auto_print_after_accept_order', !autoPrintEnabled)
119
+ }
120
+
121
+ useEffect(() => {
122
+ const getStorageData = async () => {
123
+ const printers = await _retrieveStoreData('printers')
124
+ const autoPrint = await _retrieveStoreData('auto_print_after_accept_order')
125
+ setPrinters({ list: printers ?? [] })
126
+ setAutoPrintEnabled(!!autoPrint)
127
+ }
128
+
129
+ getStorageData()
130
+ }, [])
131
+
132
+ return (
133
+ <Container>
134
+ <View style={styles.titleGroups}>
135
+ <TouchableOpacity onPress={() => goToBack()} style={styles.btnBackArrow}>
136
+ <OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
137
+ </TouchableOpacity>
138
+ </View>
139
+ <OText size={24} style={{ paddingTop: 0 }}>
140
+ {t('PRINTER_SETTINGS', 'Printer Settings')}
141
+ </OText>
142
+ {!!printers.list.length && (
143
+ <EnabledAutoPrint>
144
+ <View style={{ flex: 1 }}>
145
+ <OText
146
+ numberOfLines={2}
147
+ adjustsFontSizeToFit
148
+ color={theme.colors.textGray}
149
+ style={{ paddingHorizontal: 0 }}>
150
+ {t('AUTO_PRINT_AFTER_ACCEPTING_ORDER', 'Auto print after accepting order')}
151
+ </OText>
152
+ </View>
153
+ <ToggleSwitch
154
+ isOn={autoPrintEnabled}
155
+ onColor={theme.colors.primary}
156
+ offColor={theme.colors.offColor}
157
+ size="small"
158
+ onToggle={() => handleAutoPrint()}
159
+ animationSpeed={200}
160
+ />
161
+ </EnabledAutoPrint>
162
+ )}
163
+ {!!printers.list.length && (
164
+ <OButton
165
+ text={t('ADD_PRINTER', 'Add printer')}
166
+ imgRightSrc={null}
167
+ textStyle={styles.addButtonText}
168
+ style={styles.addButton}
169
+ bgColor={theme.colors.primary}
170
+ borderColor={theme.colors.primary}
171
+ onClick={() => setOpenModal({ open: true, data: null })}
172
+ />
173
+ )}
174
+ <View>
175
+ {printers.list.map((item: any, i: number) => (
176
+ <ContainerList
177
+ key={i}
178
+ activeOpacity={1}
179
+ >
180
+ <View style={styles.wrapperContainer}>
181
+ <View style={{ flexDirection: 'row', alignItems: 'center' }}>
182
+ <TouchableOpacity
183
+ activeOpacity={1}
184
+ style={styles.wIconContainer}
185
+ onPress={() => setOpenModal({ open: true, data: { ...item, index: i} })}
186
+ >
187
+ <SimpleLineIcons
188
+ name='printer'
189
+ color={theme.colors.textGray}
190
+ size={18}
191
+ style={{
192
+ ...styles.icons,
193
+ color: theme.colors.primary
194
+ }}
195
+ />
196
+ <OText
197
+ size={18}
198
+ color={theme.colors.primary}
199
+ >
200
+ {item?.nickname ?? item.model}
201
+ </OText>
202
+ </TouchableOpacity>
203
+ <TouchableOpacity
204
+ activeOpacity={1}
205
+ onPress={() => setOpenModal({ open: true, data: { ...item, index: i} })}
206
+ >
207
+ <FeatherIcon
208
+ name='edit'
209
+ size={22}
210
+ />
211
+ </TouchableOpacity>
212
+ <TouchableOpacity
213
+ activeOpacity={1}
214
+ onPress={() => handleClick({ item })}
215
+ style={{ marginLeft: 10 }}
216
+ >
217
+ <FeatherIcon
218
+ name='trash-2'
219
+ size={22}
220
+ color={theme.colors.danger500}
221
+ />
222
+ </TouchableOpacity>
223
+ </View>
224
+ </View>
225
+ </ContainerList>
226
+ ))}
227
+ {!printers.list.length && (
228
+ <NoPrintersContainer style={{ height: HEIGHT_SCREEN/2 }}>
229
+ <OText
230
+ size={20}
231
+ color={theme.colors.textGray}
232
+ numberOfLines={2}
233
+ adjustsFontSizeToFit
234
+ style={{ paddingHorizontal: 0, opacity: 0.4 }}
235
+ >
236
+ {t('NO_PRINTERS_CONFIGURED', 'No printers configured')}
237
+ </OText>
238
+ <OButton
239
+ text={t('ADD_PRINTER', 'Add printer')}
240
+ imgRightSrc={null}
241
+ textStyle={styles.addButtonText}
242
+ style={styles.addButton}
243
+ bgColor={theme.colors.primary}
244
+ borderColor={theme.colors.primary}
245
+ onClick={() => setOpenModal({ open: true, data: null })}
246
+ />
247
+ </NoPrintersContainer>
248
+ )}
249
+ </View>
250
+ <OModal
251
+ hideIcons
252
+ entireModal
253
+ customClose
254
+ open={openModal.open}
255
+ style={{ paddingTop: 0, marginTop: 0 }}
256
+ onClose={() => setOpenModal({ open: false, data: null })}
257
+ >
258
+ <PrinterEdition
259
+ printer={openModal.data}
260
+ printersList={printers}
261
+ handleChangePrinter={handleClick}
262
+ onClose={() => setOpenModal({ open: false, data: null })}
263
+ />
264
+ </OModal>
265
+ </Container>
266
+ )
267
+ }
@@ -0,0 +1,30 @@
1
+ import styled from "styled-components/native";
2
+
3
+ export const Container = styled.View`
4
+ margin-bottom: 50px;
5
+ `
6
+
7
+ export const ContainerList = styled.View`
8
+ flex-direction: row;
9
+ justify-content: space-between;
10
+ width: 100%;
11
+ padding: 5px 5px 5px 0;
12
+ border-bottom-width: 1px;
13
+ border-bottom-color: ${(props: any) => props.theme.colors.lightGray};
14
+ `
15
+
16
+ export const EnabledAutoPrint = styled.View`
17
+ flex-direction: row;
18
+ justify-content: space-between;
19
+ align-items: center;
20
+ padding: 20px 0px 10px;
21
+ `;
22
+
23
+ export const NoPrintersContainer = styled.View`
24
+ flex-direction: column;
25
+ align-items: center;
26
+ justify-content: center;
27
+ margin-top: 40px;
28
+ height: 100%;
29
+ flex: 1;
30
+ `
@@ -1,3 +1,5 @@
1
+
2
+
1
3
  import React, { useState, useEffect, useRef } from 'react'
2
4
  import {
3
5
  useLanguage,
@@ -149,10 +149,10 @@ const StoresListUI = (props: BusinessesListingParams) => {
149
149
  width={12}
150
150
  height={12}
151
151
  color={theme.colors.skyBlue}
152
- style={{ marginRight: 5, marginTop: 3 }}
152
+ style={{ marginRight: 5 }}
153
153
  />
154
154
  <OText size={12}>
155
- {t('MORE_SETTINGS_GO_TO', 'For more settings go to')}{' '}
155
+ {t('MORE_SETTINGS_GO_TO', 'For more settings go to ')}
156
156
  </OText>
157
157
  <TouchableOpacity onPress={() => { Linking.openURL(t('LINK_MORE_SETTINGS_GO_TO', 'https://app.ordering.co')) }}>
158
158
  <OText size={12} color={theme.colors.skyBlue}>
@@ -36,7 +36,8 @@ export const UserFormDetailsUI = (props: any) => {
36
36
  handleCancelEdit,
37
37
  toggleIsEdit,
38
38
  isCheckout,
39
- isAlsea
39
+ isAlsea,
40
+ allowDriverUpdateData
40
41
  } = props;
41
42
 
42
43
  const theme = useTheme();
@@ -66,9 +67,9 @@ export const UserFormDetailsUI = (props: any) => {
66
67
  const rules: any = {
67
68
  required: isRequiredField(field.code)
68
69
  ? t(
69
- `VALIDATION_ERROR_${field.code.toUpperCase()}_REQUIRED`,
70
- `${field.name} is required`,
71
- ).replace('_attribute_', t(field.name, field.code))
70
+ `VALIDATION_ERROR_${field.code.toUpperCase()}_REQUIRED`,
71
+ `${field.name} is required`,
72
+ ).replace('_attribute_', t(field.name, field.code))
72
73
  : null,
73
74
  };
74
75
  if (field.code && field.code === 'email') {
@@ -261,90 +262,93 @@ export const UserFormDetailsUI = (props: any) => {
261
262
  sortInputFields({ values: validationFields?.fields?.checkout })
262
263
  .length > 0 && (
263
264
  <UDWrapper>
264
- {sortInputFields({
265
- values: validationFields.fields?.checkout,
266
- }).map(
267
- (field: any) =>
268
- showField &&
269
- showField(field.code) &&
270
- !isAlsea
271
- && (
272
- <React.Fragment key={field.id}>
273
- <OText style={styles.label}>
274
- {t(field?.code.toUpperCase(), field?.name)}
275
- </OText>
265
+ {allowDriverUpdateData && (
266
+ <>
267
+ {sortInputFields({
268
+ values: validationFields.fields?.checkout,
269
+ }).map(
270
+ (field: any) =>
271
+ showField &&
272
+ showField(field.code) &&
273
+ !isAlsea
274
+ && (
275
+ <React.Fragment key={field.id}>
276
+ <OText style={styles.label}>
277
+ {t(field?.code.toUpperCase(), field?.name)}
278
+ </OText>
276
279
 
277
- <Controller
278
- key={field.id}
279
- control={control}
280
- render={() => (
281
- <OInput
282
- name={field.code}
283
- placeholder={t(
284
- field.code.toUpperCase(),
285
- field?.name,
286
- )}
287
- placeholderTextColor={theme.colors.arrowColor}
288
- style={styles.inputStyle}
289
- icon={
290
- field.code === 'email'
291
- ? theme.images.general.email
292
- : theme.images.general.user
293
- }
294
- autoCapitalize={
295
- field.code === 'email' ? 'none' : 'sentences'
296
- }
297
- isDisabled={!isEdit}
298
- value={
299
- formState?.changes[field.code] ??
300
- (user && user[field.code]) ??
301
- ''
302
- }
303
- onChange={(val: any) => {
304
- field.code !== 'email'
305
- ? setValue(field.code, val.target.value)
306
- : setValue(
307
- field.code,
308
- val.target.value
309
- .toLowerCase()
310
- .replace(/[&,()%";:ç?<>{}\\[\]\s]/g, ''),
311
- );
312
- field.code !== 'email'
313
- ? handleChangeInput(val)
314
- : handleChangeInput({
315
- target: {
316
- name: 'email',
317
- value: val.target.value
280
+ <Controller
281
+ key={field.id}
282
+ control={control}
283
+ render={() => (
284
+ <OInput
285
+ name={field.code}
286
+ placeholder={t(
287
+ field.code.toUpperCase(),
288
+ field?.name,
289
+ )}
290
+ placeholderTextColor={theme.colors.arrowColor}
291
+ style={styles.inputStyle}
292
+ icon={
293
+ field.code === 'email'
294
+ ? theme.images.general.email
295
+ : theme.images.general.user
296
+ }
297
+ autoCapitalize={
298
+ field.code === 'email' ? 'none' : 'sentences'
299
+ }
300
+ isDisabled={!isEdit}
301
+ value={
302
+ formState?.changes[field.code] ??
303
+ (user && user[field.code]) ??
304
+ ''
305
+ }
306
+ onChange={(val: any) => {
307
+ field.code !== 'email'
308
+ ? setValue(field.code, val.target.value)
309
+ : setValue(
310
+ field.code,
311
+ val.target.value
318
312
  .toLowerCase()
319
- .replace(
320
- /[&,()%";:ç?<>{}\\[\]\s]/g,
321
- '',
322
- ),
323
- },
324
- });
325
- }}
326
- autoCorrect={field.code === 'email' && false}
327
- type={
328
- field.code === 'email'
329
- ? 'email-address'
330
- : 'default'
331
- }
332
- returnKeyType="done"
333
- autoCompleteType={
334
- field.code === 'email' ? 'email' : 'off'
335
- }
336
- selectionColor={theme.colors.primary}
337
- color={theme.colors.textGray}
313
+ .replace(/[&,()%";:ç?<>{}\\[\]\s]/g, ''),
314
+ );
315
+ field.code !== 'email'
316
+ ? handleChangeInput(val)
317
+ : handleChangeInput({
318
+ target: {
319
+ name: 'email',
320
+ value: val.target.value
321
+ .toLowerCase()
322
+ .replace(
323
+ /[&,()%";:ç?<>{}\\[\]\s]/g,
324
+ '',
325
+ ),
326
+ },
327
+ });
328
+ }}
329
+ autoCorrect={field.code === 'email' && false}
330
+ type={
331
+ field.code === 'email'
332
+ ? 'email-address'
333
+ : 'default'
334
+ }
335
+ returnKeyType="done"
336
+ autoCompleteType={
337
+ field.code === 'email' ? 'email' : 'off'
338
+ }
339
+ selectionColor={theme.colors.primary}
340
+ color={theme.colors.textGray}
341
+ />
342
+ )}
343
+ name={field.code}
344
+ rules={getInputRules(field)}
345
+ defaultValue={user && user[field.code]}
338
346
  />
339
- )}
340
- name={field.code}
341
- rules={getInputRules(field)}
342
- defaultValue={user && user[field.code]}
343
- />
344
- </React.Fragment>
345
- ),
347
+ </React.Fragment>
348
+ ),
349
+ )}
350
+ </>
346
351
  )}
347
-
348
352
  <OText style={styles.label}>{t('PASSWORD', 'Password')}</OText>
349
353
 
350
354
  <Controller
@@ -445,7 +449,7 @@ export const UserFormDetailsUI = (props: any) => {
445
449
  </OText>
446
450
  )}
447
451
 
448
- {!!showInputPhoneNumber && !isAlsea && (
452
+ {!!showInputPhoneNumber && !isAlsea && allowDriverUpdateData && (
449
453
  <WrapperPhone>
450
454
  <PhoneInputNumber
451
455
  data={phoneInputData}
@@ -487,28 +491,28 @@ export const UserFormDetailsUI = (props: any) => {
487
491
  isEdit) ||
488
492
  (watchPassword?.length > 0 && watchConfirmPassword?.length > 0) ||
489
493
  formState?.loading) && (
490
- <View style={{ flex: 1, marginLeft: 5 }}>
491
- <OButton
492
- text={
493
- formState.loading
494
- ? t('UPDATING', 'Updating')
495
- : t('UPDATE', 'Update')
496
- }
497
- bgColor={theme.colors.primary}
498
- textStyle={{
499
- ...styles.btnText,
500
- color: formState.loading
501
- ? theme.colors.textGray
502
- : theme.colors.white,
503
- }}
504
- borderColor={theme.colors.primary}
505
- isDisabled={formState.loading}
506
- imgRightSrc={null}
507
- style={styles.editButton}
508
- onClick={handleSubmit(onSubmit)}
509
- />
510
- </View>
511
- )}
494
+ <View style={{ flex: 1, marginLeft: 5 }}>
495
+ <OButton
496
+ text={
497
+ formState.loading
498
+ ? t('UPDATING', 'Updating')
499
+ : t('UPDATE', 'Update')
500
+ }
501
+ bgColor={theme.colors.primary}
502
+ textStyle={{
503
+ ...styles.btnText,
504
+ color: formState.loading
505
+ ? theme.colors.textGray
506
+ : theme.colors.white,
507
+ }}
508
+ borderColor={theme.colors.primary}
509
+ isDisabled={formState.loading}
510
+ imgRightSrc={null}
511
+ style={styles.editButton}
512
+ onClick={handleSubmit(onSubmit)}
513
+ />
514
+ </View>
515
+ )}
512
516
  </EditButton>
513
517
  )}
514
518
  </>