ordering-ui-react-native 0.11.57 → 0.11.61

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.11.57",
3
+ "version": "0.11.61",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -67,13 +67,17 @@ export const OrderCreating = (props: any) => {
67
67
  let hour = 0
68
68
  let min = 0
69
69
  if (orderState?.options?.type === 1 && cart) {
70
- hour = (cart?.business?.delivery_time).split(':')[0]
71
- min = (cart?.business?.delivery_time).split(':')[1]
70
+ if (cart?.business?.delivery_time) {
71
+ hour = (cart?.business?.delivery_time).split(':')[0]
72
+ min = (cart?.business?.delivery_time).split(':')[1]
73
+ }
72
74
  }
73
75
 
74
76
  if (orderState?.options?.type === 2 && cart) {
75
- hour = (cart?.business?.pickup_time).split(':')[0]
76
- min = (cart?.business?.pickup_time).split(':')[1]
77
+ if (cart?.business?.pickup_time) {
78
+ hour = (cart?.business?.pickup_time).split(':')[0]
79
+ min = (cart?.business?.pickup_time).split(':')[1]
80
+ }
77
81
  }
78
82
  return getHourMin(hour, min)
79
83
  }
package/src/config.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "app_id": "react-native-app",
3
3
  "notification_app": "orderingapp",
4
4
  "app_name": "Ordering",
5
- "project": "reactdemo",
5
+ "project": "luisv4",
6
6
  "api": {
7
7
  "url": "https://apiv4.ordering.co",
8
8
  "language": "en",
@@ -34,7 +34,7 @@ import { UserFormDetailsUI } from './src/components/UserFormDetails';
34
34
  import { UserProfileForm } from './src/components/UserProfileForm';
35
35
  import { VerifyPhone } from './src/components/VerifyPhone';
36
36
  import { DriverMap } from './src/components/DriverMap';
37
-
37
+ import { MapViewUI as MapView } from './src/components/MapView'
38
38
  //OComponents
39
39
  import {
40
40
  OText,
@@ -74,6 +74,7 @@ export {
74
74
  LogoutButton,
75
75
  MessagesOption,
76
76
  NotFoundSource,
77
+ MapView,
77
78
  OrderDetailsBusiness,
78
79
  OrderDetailsDelivery,
79
80
  OrderMessage,
@@ -0,0 +1,286 @@
1
+ import React, { useState, useEffect, useRef, useCallback } from 'react';
2
+ import { Dimensions, SafeAreaView, StyleSheet, View } from 'react-native';
3
+ import { useFocusEffect } from '@react-navigation/native'
4
+ import MapView, {
5
+ PROVIDER_GOOGLE,
6
+ Marker,
7
+ Callout
8
+ } from 'react-native-maps';
9
+ import { useLanguage, useSession, MapView as MapViewController } from 'ordering-components/native';
10
+ import { MapViewParams } from '../../types';
11
+ import Alert from '../../providers/AlertProvider';
12
+ import { useTheme } from 'styled-components/native';
13
+ import { useLocation } from '../../hooks/useLocation';
14
+ import Icon from 'react-native-vector-icons/FontAwesome5';
15
+ import { OIcon, OText } from '../shared'
16
+
17
+ const MapViewComponent = (props: MapViewParams) => {
18
+
19
+ const {
20
+ onNavigationRedirect,
21
+ isLoadingBusinessMarkers,
22
+ getBusinessLocations,
23
+ markerGroups,
24
+ customerMarkerGroups
25
+ } = props;
26
+
27
+ const theme = useTheme();
28
+ const [, t] = useLanguage();
29
+ const [{ user }] = useSession()
30
+ const { width, height } = Dimensions.get('window');
31
+ const ASPECT_RATIO = width / height;
32
+ const mapRef = useRef<MapView>(null);
33
+ const following = useRef<boolean>(true);
34
+ const [isFocused, setIsFocused] = useState(false)
35
+ const [locationSelected, setLocationSelected] = useState<any>(null)
36
+ const [alertState, setAlertState] = useState<{
37
+ open: boolean;
38
+ content: Array<string>;
39
+ key?: string | null;
40
+ }>({ open: false, content: [], key: null });
41
+
42
+ const {
43
+ initialPosition,
44
+ userLocation,
45
+ stopFollowUserLocation,
46
+ followUserLocation
47
+ } = useLocation();
48
+
49
+ const location = { lat: userLocation.latitude, lng: userLocation.longitude }
50
+
51
+ const closeAlert = () => {
52
+ setAlertState({
53
+ open: false,
54
+ content: [],
55
+ });
56
+ };
57
+
58
+ const fitCoordinates = (location?: any) => {
59
+ if (mapRef.current) {
60
+ mapRef.current.fitToCoordinates(
61
+ [
62
+ { latitude: location.latitude, longitude: location.longitude },
63
+ {
64
+ latitude: userLocation.latitude,
65
+ longitude: userLocation.longitude,
66
+ },
67
+ ],
68
+ {
69
+ edgePadding: { top: 120, right: 120, bottom: 120, left: 120 },
70
+ },
71
+ );
72
+ }
73
+ };
74
+
75
+ useEffect(() => {
76
+ fitCoordinates(locationSelected || userLocation);
77
+ }, [userLocation, locationSelected]);
78
+
79
+
80
+ useEffect(() => {
81
+ if (isFocused) {
82
+ getBusinessLocations()
83
+ }
84
+ }, [isFocused])
85
+
86
+ useEffect(() => {
87
+ followUserLocation();
88
+
89
+ return () => {
90
+ stopFollowUserLocation();
91
+ };
92
+ }, []);
93
+
94
+
95
+ useFocusEffect(
96
+ useCallback(() => {
97
+ setIsFocused(true)
98
+ return () => {
99
+ stopFollowUserLocation()
100
+ setIsFocused(false)
101
+ setLocationSelected(null)
102
+ }
103
+ }, [])
104
+ )
105
+
106
+ const styles = StyleSheet.create({
107
+ image: {
108
+ borderRadius: 50,
109
+ },
110
+ view: {
111
+ width: 25,
112
+ position: 'absolute',
113
+ top: 6,
114
+ left: 6,
115
+ bottom: 0,
116
+ right: 0,
117
+ },
118
+ });
119
+
120
+ const RenderMarker = ({ marker, customer, orderIds }: { marker: any, customer?: boolean, orderIds?: Array<number> }) => {
121
+ const markerRef = useRef<any>()
122
+ useEffect(() => {
123
+ if (
124
+ markerRef?.current?.props?.coordinate?.latitude === locationSelected?.latitude &&
125
+ markerRef?.current?.props?.coordinate?.longitude === locationSelected?.longitude
126
+ ) {
127
+ markerRef?.current?.showCallout()
128
+ } else {
129
+ markerRef?.current?.hideCallout()
130
+ }
131
+ }, [locationSelected])
132
+
133
+ return (
134
+ <Marker
135
+ key={customer ? marker?.customer?.id : marker?.business?.id}
136
+ coordinate={{
137
+ latitude: customer ? marker?.customer?.location?.lat : marker?.business?.location?.lat,
138
+ longitude: customer ? marker?.customer?.location?.lng : marker?.business?.location?.lng
139
+ }}
140
+ onPress={() =>
141
+ setLocationSelected({
142
+ latitude: customer ? marker?.customer?.location?.lat : marker?.business?.location?.lat,
143
+ longitude: customer ? marker?.customer?.location?.lng : marker?.business?.location?.lng
144
+ })
145
+ }
146
+ ref={(ref) => markerRef.current = ref}
147
+ >
148
+ <Icon
149
+ name="map-marker"
150
+ size={50}
151
+ color={theme.colors.primary}
152
+ />
153
+ <View style={styles.view}>
154
+ <OIcon
155
+ style={styles.image}
156
+ src={{ uri: customer ? marker?.customer?.photo : marker?.business?.logo }}
157
+ width={25}
158
+ height={25}
159
+ />
160
+ </View>
161
+ <Callout
162
+ onPress={() => !!orderIds && orderIds.toString().includes(',') ? onNavigationRedirect('Orders') : onNavigationRedirect('OrderDetails', { order: marker })}
163
+ >
164
+ <View style={{ flex: 1, width: 200, padding: 5 }}>
165
+ <OText weight='bold'>{customer ? `${marker?.customer?.name} ${marker?.customer?.lastname}` : marker?.business?.name}</OText>
166
+ <OText>
167
+ {!!orderIds && orderIds.toString().includes(',') ? (
168
+ <>
169
+ {t('ORDER_NUMBERS', 'Order Numbers')} {orderIds}
170
+ </>
171
+ ) : (
172
+ <>
173
+ {t('ORDER_NUMBER', 'Order No.')} {marker?.id}
174
+ </>
175
+ )}
176
+ </OText>
177
+ <OText>{customer ? marker?.customer?.address : marker?.business?.address}</OText>
178
+ {((customer && marker?.customer?.city?.address_notes) || !customer) && (
179
+ <OText>{customer ? marker?.customer?.city?.address_notes : marker?.business?.city?.name}</OText>
180
+ )}
181
+ {((customer && marker?.business?.zipcode) || (!customer && marker?.business?.zipcode)) && (
182
+ <OText>{customer ? marker?.customer?.zipcode : marker?.business?.zipcode}</OText>
183
+ )}
184
+ {customer && marker?.customer?.internal_number && (
185
+ <OText>{marker?.customer?.internal_number}</OText>
186
+ )}
187
+ <OText textDecorationLine='underline' color={theme.colors.primary}>
188
+ {!!orderIds && orderIds.toString().includes(',') ? (
189
+ <>
190
+ {t('SHOW_ORDERS', 'Show orders')}
191
+ </>
192
+ ) : (
193
+ <>
194
+ {t('MORE_INFO', 'More info')}
195
+ </>
196
+ )}
197
+ </OText>
198
+ </View>
199
+ </Callout>
200
+ </Marker>
201
+ )
202
+ }
203
+ return (
204
+ <SafeAreaView style={{ flex: 1 }}>
205
+ <View style={{ flex: 1 }}>
206
+ <View style={{ flex: 1 }}>
207
+ {typeof initialPosition?.latitude === 'number' && !isLoadingBusinessMarkers && isFocused && (
208
+ <MapView
209
+ ref={mapRef}
210
+ provider={PROVIDER_GOOGLE}
211
+ initialRegion={{
212
+ latitude: initialPosition.latitude,
213
+ longitude: initialPosition.longitude,
214
+ latitudeDelta: 0.01,
215
+ longitudeDelta: 0.01 * ASPECT_RATIO,
216
+ }}
217
+ style={{ flex: 1 }}
218
+ zoomTapEnabled
219
+ zoomEnabled
220
+ zoomControlEnabled
221
+ cacheEnabled
222
+ moveOnMarkerPress
223
+ onTouchStart={() => (following.current = false)}
224
+ >
225
+ <>
226
+ {Object.values(markerGroups).map((marker: any) => (
227
+ <RenderMarker
228
+ key={marker[0]?.business_id}
229
+ marker={marker[0]}
230
+ orderIds={marker.map((order: any) => order.id).join(', ')}
231
+ />
232
+ ))}
233
+ {Object.values(customerMarkerGroups).map((marker: any) => (
234
+ <RenderMarker
235
+ key={marker[0]?.customer_id}
236
+ marker={marker[0]}
237
+ orderIds={marker.map((order: any) => order.id).join(', ')}
238
+ customer
239
+ />
240
+ ))}
241
+ <Marker
242
+ coordinate={{
243
+ latitude: location.lat,
244
+ longitude: location.lng,
245
+ }}
246
+ title={t('YOUR_LOCATION', 'Your Location')}
247
+ >
248
+ <Icon
249
+ name="map-marker"
250
+ size={50}
251
+ color={theme.colors.primary}
252
+ />
253
+ <View style={styles.view}>
254
+ <OIcon
255
+ style={styles.image}
256
+ src={{ uri: user.photo }}
257
+ width={25}
258
+ height={25}
259
+ />
260
+ </View>
261
+ </Marker>
262
+ </>
263
+ </MapView>
264
+ )}
265
+ </View>
266
+ </View>
267
+ <View>
268
+ <Alert
269
+ open={alertState.open}
270
+ onAccept={closeAlert}
271
+ onClose={closeAlert}
272
+ content={alertState.content}
273
+ title={t('ERROR', 'Error')}
274
+ />
275
+ </View>
276
+ </SafeAreaView >
277
+ );
278
+ };
279
+
280
+ export const MapViewUI = (props: any) => {
281
+ const MapViewProps = {
282
+ ...props,
283
+ UIComponent: MapViewComponent
284
+ }
285
+ return <MapViewController {...MapViewProps} />
286
+ }
@@ -23,6 +23,7 @@ const SText = styled.Text`
23
23
  css`
24
24
  flex: ${props.weight ? 1 : 0};
25
25
  `};
26
+ text-decoration: ${(props : any) => props.textDecorationLine};
26
27
  `;
27
28
  interface Props {
28
29
  color?: string;
@@ -39,6 +40,7 @@ interface Props {
39
40
  numberOfLines?: number;
40
41
  ellipsizeMode?: string;
41
42
  adjustsFontSizeToFit?: boolean;
43
+ textDecorationLine?: string
42
44
  }
43
45
 
44
46
  const OText = (props: Props): React.ReactElement => {
@@ -539,3 +539,11 @@ export interface AcceptOrRejectOrderParams {
539
539
  titleReject?: textTranslate;
540
540
  appTitle?: textTranslate;
541
541
  }
542
+
543
+ export interface MapViewParams {
544
+ onNavigationRedirect: (page : string, params ?: any) => void,
545
+ getBusinessLocations: () => void,
546
+ isLoadingBusinessMarkers?: boolean,
547
+ markerGroups: Array<any>,
548
+ customerMarkerGroups: Array<any>
549
+ }
@@ -82,6 +82,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
82
82
  inactiveSlideOpacity={1}
83
83
  initialScrollIndex={0}
84
84
  onScrollToIndexFailed={(_: any) => {}}
85
+ enableMomentum={true}
85
86
  />
86
87
  </>
87
88
  );
@@ -13,7 +13,8 @@ import {
13
13
  StyledContent,
14
14
  StyledTopBar,
15
15
  } from './styles';
16
- import { OButton, OModal, OText } from '../shared';
16
+ import { OButton, OModal, OText, OIconButton } from '../shared';
17
+ import EvilIcons from 'react-native-vector-icons/EvilIcons';
17
18
  import CartItem from '../CartItem';
18
19
  import { Cart as TypeCart } from '../../types';
19
20
  import { ProductForm } from '../ProductForm';
@@ -109,6 +110,7 @@ const CartBottomSheetUI = (props: CartBottomSheetUIProps): React.ReactElement |
109
110
  {...props}
110
111
  handleClearProducts={handleClearProducts}
111
112
  selectedOrderType={selectedOrderType}
113
+ hideCartBottomSheet={hideCartBottomSheet}
112
114
  />
113
115
 
114
116
  {cart?.products?.length > 0 && cart?.products.map((product: any) => (
@@ -126,13 +128,27 @@ const CartBottomSheetUI = (props: CartBottomSheetUIProps): React.ReactElement |
126
128
  ))}
127
129
 
128
130
  </StyledContent>
129
-
130
- <StyledBottomContent
131
- minHeight={props.height * 0.1}
131
+ <TouchableOpacity
132
+ onPress={handleClearProducts}
133
+ style={{flex:1, justifyContent:'center', alignItems:'center', bottom: 20, paddingTop: 5}}
132
134
  >
135
+ <View>
136
+ <OText
137
+ size={20}
138
+ weight="700"
139
+ color={theme.colors.red}
140
+ >
141
+ {t('CANCEL_ORDER', 'Cancel order')}
142
+ </OText>
143
+ </View>
144
+ </TouchableOpacity>
145
+ <StyledBottomContent
146
+ style={{bottom:10}}
147
+ minHeight={props.height * 0.01}
148
+ >
133
149
  <OButton
134
150
  text={(cart?.subtotal >= cart?.minimum || !cart?.minimum) && cart?.valid_address ? (
135
- !openUpselling !== canOpenUpselling ? `${t('CONFIRM_THIS', 'Confirm this')} ${parsePrice(cart?.total)} ${t('ORDER', 'order')}`: t('LOADING', 'Loading')
151
+ !openUpselling !== canOpenUpselling ? `${t('CHECKOUT', 'Checkout')} ${parsePrice(cart?.total)}`: t('LOADING', 'Loading')
136
152
  ) : !cart?.valid_address ? (
137
153
  `${t('OUT_OF_COVERAGE', 'Out of Coverage')}`
138
154
  ) : (
@@ -205,20 +221,19 @@ const TopBar = (props:any) => {
205
221
  {props?.selectedOrderType === 3 && t('EAT_IN', 'Eat in')}
206
222
  </OText>
207
223
  </View>
208
-
209
- <TouchableOpacity
210
- onPress={props?.handleClearProducts}
211
- >
212
- <View>
213
- <OText
214
- size={20}
215
- weight="500"
216
- color={theme.colors.primary}
217
- >
218
- {t('CANCEL_ORDER', 'Cancel order')}
219
- </OText>
220
- </View>
221
- </TouchableOpacity>
224
+ <OIconButton
225
+ bgColor="transparent"
226
+ borderColor="transparent"
227
+ RenderIcon={() =>
228
+ <EvilIcons
229
+ name={'close'}
230
+ size={40}
231
+ color={theme.colors.primary}
232
+ />
233
+ }
234
+ style={{ flex:1, justifyContent: 'flex-end', left: 30 }}
235
+ onClick={props.hideCartBottomSheet}
236
+ />
222
237
  </StyledTopBar>
223
238
  );
224
239
  }
@@ -10,7 +10,8 @@ import {
10
10
  ProductSubOption,
11
11
  ProductComment
12
12
  } from './styles';
13
- import { OButton, OImage, OText } from '../shared';
13
+ import { OButton, OImage, OText, OIconButton } from '../shared';
14
+ import EvilIcons from 'react-native-vector-icons/EvilIcons';
14
15
  import { Product } from '../../types';
15
16
  import QuantityControl from '../QuantityControl';
16
17
  import { LANDSCAPE, useDeviceOrientation } from '../../../../../src/hooks/DeviceOrientation';
@@ -52,7 +53,7 @@ const CartItem = (props: CartItemProps) => {
52
53
  }
53
54
  return product
54
55
  }
55
-
56
+ const isProductIngredients = productInfo()?.ingredients.length > 0 || productInfo()?.options.length > 0 || product?.comment
56
57
  const getFormattedSubOptionName = ({ quantity, name, position, price }: { quantity: number, name: string, position: string, price: number }) => {
57
58
  const pos = position ? `(${position})` : ''
58
59
  return `${quantity} x ${name} ${pos} +${price}`
@@ -64,7 +65,7 @@ const CartItem = (props: CartItemProps) => {
64
65
  onPress={() => (!product?.valid_menu && isCartProduct)
65
66
  ? {}
66
67
  : setActiveState(!isActive)}
67
- activeOpacity={1}
68
+ activeOpacity={0.5}
68
69
  >
69
70
  <StyledCartItem>
70
71
  <View style={{ flexDirection: 'row' }}>
@@ -105,6 +106,21 @@ const CartItem = (props: CartItemProps) => {
105
106
  }}
106
107
  onClick={() => { onEditProduct ? onEditProduct(product) : null }}
107
108
  />
109
+ <OIconButton
110
+ bgColor="transparent"
111
+ borderColor="transparent"
112
+ RenderIcon={isProductIngredients && (() =>
113
+ <EvilIcons
114
+ name={isActive ? 'chevron-up': 'chevron-down'}
115
+ size={40}
116
+ color={theme.colors.primary}
117
+ />
118
+ )}
119
+ style={{ justifyContent: 'flex-start', right: 40 }}
120
+ onClick={() => (!product?.valid_menu && isCartProduct)
121
+ ? {}
122
+ : setActiveState(!isActive)}
123
+ />
108
124
  </View>
109
125
  </View>
110
126
  </View>
@@ -90,7 +90,7 @@ const CategoriesMenu = (props: any): React.ReactElement => {
90
90
  <Container nopadding nestedScrollEnabled>
91
91
  <View style={{ paddingTop: 20 }}>
92
92
  <NavBar
93
- title={t('CATEGORY_X_ID', 'Category')}
93
+ title={categories[curIndexCateg].name}
94
94
  onActionLeft={goToBack}
95
95
  rightComponent={cart && (
96
96
  <TouchableOpacity
@@ -128,7 +128,7 @@ const CategoriesMenu = (props: any): React.ReactElement => {
128
128
  image={{ uri: product?.images }}
129
129
  style={{
130
130
  width: orientationState?.orientation === LANDSCAPE
131
- ? orientationState?.dimensions?.width * 0.16
131
+ ? bottomSheetVisibility ? orientationState?.dimensions?.width * 0.15 :orientationState?.dimensions?.width * 0.16
132
132
  : orientationState?.dimensions?.width * 0.21
133
133
  }}
134
134
  titleStyle={{marginTop: Platform.OS === 'ios' ? 10 : 0}}
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import styled from 'styled-components/native'
3
3
  import { OIcon, OButton, OText } from '../shared'
4
- import { TextStyle, View } from 'react-native'
4
+ import { ImageStyle, TextStyle, View } from 'react-native'
5
5
  import { OrderTypeSelector } from '../OrderTypeSelector'
6
6
  import { useConfig } from 'ordering-components/native'
7
7
  import { useTheme } from 'styled-components/native'
@@ -53,6 +53,7 @@ interface Props {
53
53
  style?: TextStyle,
54
54
  paddingTop?: number,
55
55
  includeOrderTypeSelector?: boolean,
56
+ imgLeftStyle?: ImageStyle
56
57
  }
57
58
 
58
59
  const NavBar = (props: Props) => {
@@ -68,6 +69,7 @@ const NavBar = (props: Props) => {
68
69
  imgRightSrc={null}
69
70
  style={{ ...btnBackArrow, ...props.btnStyle }}
70
71
  onClick={props.onActionLeft}
72
+ imgLeftStyle= {props.imgLeftStyle}
71
73
  />)
72
74
  }
73
75
  <TitleTopWrapper>
@@ -27,7 +27,7 @@ import {
27
27
  import { OrderDetailsParams, Product } from '../../types'
28
28
  import { Container } from '../../layouts/Container';
29
29
  import NavBar from '../../components/NavBar';
30
- import { OButton, OImage, OInput, OText } from '../../components/shared';
30
+ import { OButton, OIconButton, OImage, OInput, OText } from '../../components/shared';
31
31
  import GridContainer from '../../layouts/GridContainer';
32
32
  import OptionSwitch, { Opt } from '../../components/shared/OOptionToggle';
33
33
  import { verifyDecimals } from '../../../../../src/utils'
@@ -35,6 +35,7 @@ import { LANDSCAPE, PORTRAIT, useDeviceOrientation } from '../../../../../src/ho
35
35
  import { useTheme } from 'styled-components/native'
36
36
  import { _retrieveStoreData } from '../../../../../src/providers/StoreUtil';
37
37
  import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons'
38
+ import EvilIcons from 'react-native-vector-icons/EvilIcons'
38
39
  const _EMAIL = 'email';
39
40
  const _SMS = 'sms';
40
41
 
@@ -210,6 +211,14 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
210
211
  setCustomerName(name)
211
212
  }
212
213
  getCustomerName()
214
+ const redirectHome = setTimeout(() =>{
215
+ navigation.reset({
216
+ routes: [{ name: 'Intro' }],
217
+ });
218
+ }, 60000);
219
+ return () => {
220
+ clearTimeout(redirectHome);
221
+ }
213
222
  }, [])
214
223
 
215
224
  useEffect(() => {
@@ -327,7 +336,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
327
336
  </OSInputWrapper>
328
337
 
329
338
  <OButton
330
- text={`${t('YOU_ARE_DONE', 'You are done')}!`}
339
+ text={`${t('YOU_ARE_DONE', 'You are done! Click to close')}!`}
331
340
  onClick={() => {
332
341
  navigation.reset({
333
342
  routes: [{ name: 'Intro' }],
@@ -485,18 +494,46 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
485
494
  <>
486
495
  <Container>
487
496
  <NavBar
488
- title={t('TAKE_YOUR_RECEIPT', 'Take your receipt')}
497
+ title={t('BACK_BUTTON_CONFIRMATION', 'Confirmation')}
489
498
  style={{ right: 10 }}
499
+ rightComponent={
500
+ <OIconButton
501
+ bgColor="transparent"
502
+ borderColor="transparent"
503
+ RenderIcon={() =>
504
+ <EvilIcons
505
+ name={'close'}
506
+ size={40}
507
+ color={theme.colors.primary}
508
+ />
509
+ }
510
+ style={{ flex:1, justifyContent: 'flex-end', left: 30 }}
511
+ onClick={() => {
512
+ navigation.reset({
513
+ routes: [{ name: 'Intro' }],
514
+ });
515
+ }}
516
+ />
517
+ }
490
518
  />
491
519
 
492
520
  <View style={{
493
521
  marginVertical: orientationState?.dimensions?.height * 0.03,
494
522
  flexDirection: orientationState?.orientation === PORTRAIT ? 'column' : 'row',
495
523
  }}>
524
+ <View
525
+ style={{
526
+ flex: 1,
527
+ marginVertical: orientationState?.orientation === PORTRAIT ? 40 : 0,
528
+ }}
529
+ >
530
+ {orderDetailsContent}
531
+ </View>
496
532
  <View style={{
497
- flex: 1,
533
+ flex: 1.1,
498
534
  marginRight: orientationState?.orientation === PORTRAIT ? 0 : 20,
499
- justifyContent: 'space-between'
535
+ justifyContent: 'space-between',
536
+ marginLeft: 20
500
537
  }}>
501
538
  <View>
502
539
  <OText
@@ -515,22 +552,13 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
515
552
  <OText
516
553
  size={orientationState?.dimensions?.width * (orientationState?.orientation === PORTRAIT ? 0.04 : 0.025)}
517
554
  >
518
- {t('TO_FINISH_TAKE_YOUR_RECEIPT_AND_GO_TO_THE_FRONT_COUNTER', 'To finish take your receipt and go to the front counter.')}
555
+ {t('TO_FINISH_TAKE_YOUR_RECEIPT_AND_GO_TO_THE_FRONT_COUNTER', "We`ve received your order and we will call you by your name or your order number.")}
519
556
  </OText>
520
557
 
521
558
  </View>
522
559
 
523
560
  {orientationState?.orientation === LANDSCAPE && actionsContent}
524
561
  </View>
525
-
526
- <View
527
- style={{
528
- flex: 1.4,
529
- marginVertical: orientationState?.orientation === PORTRAIT ? 40 : 0,
530
- }}
531
- >
532
- {orderDetailsContent}
533
- </View>
534
562
  </View>
535
563
  </Container>
536
564
 
@@ -135,14 +135,14 @@ const PaymentOptionsUI = (props: any) => {
135
135
  cashIndex !== -1
136
136
  ? {
137
137
  style: cardStyle,
138
- title: t('CASH', supportedMethods[cashIndex]?.name),
138
+ title: t('CASH', 'Cash'),
139
139
  description: t(
140
140
  'GO_FOR_YOR_RECEIPT_AND_GO_TO_THE_FRONT_COUNTER',
141
- 'Go for yor receipt and go to the front counter',
141
+ 'Pay with cash in the front counter',
142
142
  ),
143
143
  bgImage: theme.images.general.cash,
144
144
  icon: theme.images.general.shoppingCart,
145
- callToActionText: t('TAKE_MY_RECEIPT', 'Take my receipt'),
145
+ callToActionText: t('LETS_GO', 'LETS_GO'),
146
146
  onClick: () =>
147
147
  onSelectPaymethod(supportedMethods[cashIndex], false),
148
148
  ...supportedMethods[cashIndex],
@@ -137,8 +137,6 @@ export const ProductOptionsUI = (props: any) => {
137
137
  const navBarProps = {
138
138
  style: { backgroundColor: 'transparent', width: orientationState?.dimensions?.width, borderBottomWidth: 0 },
139
139
  paddingTop: 20,
140
- title: t('YOUR_DISH', 'Your dish'),
141
- btnStyle: { backgroundColor: 'transparent' },
142
140
  onActionLeft: onClose ? onClose : navigation ? goToBack : undefined,
143
141
  };
144
142
 
@@ -238,12 +236,29 @@ export const ProductOptionsUI = (props: any) => {
238
236
  {...navBarProps}
239
237
  titleColor={theme.colors.white}
240
238
  {...((navigation || onClose) && { leftImg: theme.images.general.arrow_left_white })}
239
+ btnStyle={{
240
+ width: 55,
241
+ height: 55,
242
+ backgroundColor: 'black',
243
+ borderRadius: 100,
244
+ opacity: 0.8,
245
+ left: 20,
246
+ }}
247
+ imgLeftStyle={{ width: 27, height: 27 }}
241
248
  />
242
249
  </Animated.View>
243
250
  <Animated.View style={{ opacity: navBar2ContainerOpacity, position: 'absolute' }}>
244
251
  <NavBar
245
252
  {...navBarProps}
246
253
  {...((navigation || onClose) && { leftImg: theme.images.general.arrow_left })}
254
+ btnStyle={{
255
+ width: 55,
256
+ height: 55,
257
+ backgroundColor: 'transparent',
258
+ borderRadius: 100,
259
+ left: 20,
260
+ }}
261
+ imgLeftStyle={{ width: 27, height: 27 }}
247
262
  />
248
263
  </Animated.View>
249
264
 
@@ -178,30 +178,6 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
178
178
  alignItems: 'center'
179
179
  }}
180
180
  >
181
-
182
- <View style={{ height: '100%', width: '35%' }}>
183
- <OText
184
- size={orientationState?.dimensions?.width * 0.048}
185
- >
186
- {t('DO_YOU_WANT', 'Do you want')} {'\n'}
187
- <OText
188
- size={orientationState?.dimensions?.width * 0.048}
189
- weight={'700'}
190
- >
191
- {t('SOMETHING_ELSE', 'something else')} {'?'}
192
- </OText>
193
- </OText>
194
-
195
- <CloseUpsellingLand>
196
- <OButton
197
- imgRightSrc=''
198
- text={t('I_AM_FINE_THANK_YOU', 'I’m fine, thank you')}
199
- style={styles.closeUpsellingButton}
200
- onClick={() => handleUpsellingPage()}
201
- />
202
- </CloseUpsellingLand>
203
- </View>
204
-
205
181
  <View style={{ width: '65%', marginBottom: 30 }}>
206
182
  <GridContainer>
207
183
  {
@@ -258,7 +234,27 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
258
234
  }
259
235
  </GridContainer>
260
236
  </View>
261
-
237
+ <View style={{ height: '100%', width: '35%' }}>
238
+ <OText
239
+ size={orientationState?.dimensions?.width * 0.040}
240
+ >
241
+ {t('DO_YOU_WANT', 'Do you want')} {'\n'}
242
+ <OText
243
+ size={orientationState?.dimensions?.width * 0.040}
244
+ weight={'700'}
245
+ >
246
+ {t('SOMETHING_ELSE', 'something else')} {'?'}
247
+ </OText>
248
+ </OText>
249
+ <CloseUpsellingLand>
250
+ <OButton
251
+ imgRightSrc=''
252
+ text={t('I_AM_FINE_THANK_YOU', 'I’m fine, thank you')}
253
+ style={styles.closeUpsellingButton}
254
+ onClick={() => handleUpsellingPage()}
255
+ />
256
+ </CloseUpsellingLand>
257
+ </View>
262
258
  </View>
263
259
  </>
264
260
  )
@@ -48,9 +48,10 @@ interface Props {
48
48
  iconCover?: boolean,
49
49
  urlIcon?: any,
50
50
  cover?: any,
51
+ RenderIcon?: React.FunctionComponent
51
52
  }
52
-
53
53
  const OIconButton = (props: Props) => {
54
+ const { RenderIcon } = props
54
55
  const theme = useTheme()
55
56
 
56
57
  return (
@@ -66,7 +67,7 @@ const OIconButton = (props: Props) => {
66
67
  ...props.style
67
68
  }}
68
69
  >
69
- {props.icon ? (
70
+ {props.icon && typeof props.icon !== 'object' ? (
70
71
  <Icon
71
72
  source={props.icon}
72
73
  style={{
@@ -75,6 +76,9 @@ const OIconButton = (props: Props) => {
75
76
  }}
76
77
  />
77
78
  ) : null}
79
+ {RenderIcon ? (
80
+ <RenderIcon />
81
+ ) : null}
78
82
  {props.title ? (
79
83
  <Title style={{
80
84
  color: props.textColor || props.color,
@@ -97,7 +101,7 @@ const OIconButton = (props: Props) => {
97
101
  >
98
102
  {props.icon ? (
99
103
  <Icon
100
- source={props.urlIcon ? {uri: props.icon} : props.icon}
104
+ source={props.urlIcon ? { uri: props.icon } : props.icon}
101
105
  resizeMode={props.cover ? 'cover' : 'contain'}
102
106
  style={{
103
107
  tintColor: props.iconColor,
@@ -105,6 +109,9 @@ const OIconButton = (props: Props) => {
105
109
  }}
106
110
  />
107
111
  ) : null}
112
+ {RenderIcon ? (
113
+ <RenderIcon />
114
+ ) : null}
108
115
  {props.title ? (
109
116
  <Title style={{
110
117
  color: props.textColor || props.color,
@@ -90,6 +90,7 @@ const AddressFormUI = (props: AddressFormParams) => {
90
90
  height: 50,
91
91
  maxHeight: 50,
92
92
  minHeight: 50,
93
+ flex: 1,
93
94
  },
94
95
  textAreaStyles: {
95
96
  borderColor: theme.colors.border,
@@ -495,7 +496,10 @@ const AddressFormUI = (props: AddressFormParams) => {
495
496
  }, [orderState.loading]);
496
497
 
497
498
  return (
498
- <ScrollView>
499
+ <ScrollView
500
+ keyboardShouldPersistTaps='always'
501
+ listViewDisplayed={false}
502
+ >
499
503
  <NavBar
500
504
  title={t('WHERE_DO_WE_DELIVERY', 'Where do we delivery?')}
501
505
  titleAlign={'center'}
@@ -504,7 +508,7 @@ const AddressFormUI = (props: AddressFormParams) => {
504
508
  paddingTop={20}
505
509
  btnStyle={{ paddingLeft: 40 }}
506
510
  titleStyle={{ fontSize: 14 }}
507
- titleWrapStyle={{ flexBasis: '75%' }}
511
+ titleWrapStyle={{ paddingHorizontal: 0 }}
508
512
  />
509
513
  <TouchableWithoutFeedback onPress={Keyboard.dismiss}>
510
514
  <AddressFormContainer style={{ height: 600, overflow: 'scroll' }}>
@@ -60,8 +60,9 @@ const FloatingButtonUI = (props: FloatingButtonParams) => {
60
60
 
61
61
  return (
62
62
  <Container
63
- isIos={Platform.OS === 'ios'}
64
- style={{ paddingBottom: bottom + 16 }}>
63
+ style={{
64
+ paddingBottom: Platform.OS === 'ios' ? 0 : bottom + 16
65
+ }}>
65
66
 
66
67
  <View style={styles.infoCont}>
67
68
  <OText color={theme.colors.textNormal} size={16} lineHeight={24} weight={'600'} mRight={20}>
@@ -1,4 +1,4 @@
1
- import styled, { css } from 'styled-components/native'
1
+ import styled from 'styled-components/native'
2
2
 
3
3
  export const Container = styled.View`
4
4
  position: absolute;
@@ -21,6 +21,6 @@ export const Button = styled.TouchableOpacity`
21
21
  align-items: center;
22
22
  border-radius: 7.6px;
23
23
  height: 44px;
24
- max-height; 44px;
24
+ max-height: 44px;
25
25
  padding-horizontal: 20px;
26
26
  `
@@ -25,7 +25,8 @@ const UserDetailsUI = (props: any) => {
25
25
  validationFields,
26
26
  isUserDetailsEdit,
27
27
  phoneUpdate,
28
- togglePhoneUpdate
28
+ togglePhoneUpdate,
29
+ isCheckout
29
30
  } = props
30
31
 
31
32
  const theme = useTheme();
@@ -116,7 +117,7 @@ const UserDetailsUI = (props: any) => {
116
117
  )}
117
118
  </UDInfo>
118
119
  ) : (
119
- <UserFormDetailsUI {...props} phoneUpdate={phoneUpdate} togglePhoneUpdate={togglePhoneUpdate} />
120
+ <UserFormDetailsUI {...props} phoneUpdate={phoneUpdate} togglePhoneUpdate={togglePhoneUpdate} isCheckout={isCheckout} />
120
121
  )}
121
122
  </UDContainer>
122
123
  )}
@@ -14,7 +14,6 @@ export const UDWrapper = styled.View`
14
14
  flex-direction: column;
15
15
  width: 100%;
16
16
  margin-top: 20px;
17
- padding-bottom: 50px;
18
17
  `
19
18
 
20
19
  export const UDLoader = styled.View`
@@ -4,7 +4,7 @@ import { Platform } from 'react-native';
4
4
 
5
5
  const ContainerStyled = styled.ScrollView`
6
6
  flex: 1;
7
- ${(props: any) => !props.nopadding && css`
7
+ ${(props: any) => !props.noPadding && css`
8
8
  padding: ${Platform.OS === 'ios' ? '0px 40px' : '20px 40px'};
9
9
  `}
10
10
  background-color: ${(props: any) => props.theme.colors.backgroundPage};