ordering-ui-react-native 0.12.21 → 0.12.25

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 (33) hide show
  1. package/package.json +1 -1
  2. package/src/components/ActiveOrders/index.tsx +31 -14
  3. package/src/components/Messages/index.tsx +59 -4
  4. package/src/components/Messages/styles.tsx +3 -0
  5. package/themes/business/src/components/Chat/index.tsx +56 -8
  6. package/themes/business/src/components/Chat/styles.tsx +4 -0
  7. package/themes/doordash/src/components/Messages/index.tsx +62 -4
  8. package/themes/doordash/src/components/Messages/styles.tsx +2 -0
  9. package/themes/doordash/src/components/shared/OButton.tsx +2 -1
  10. package/themes/instacart/src/components/Messages/index.tsx +60 -5
  11. package/themes/instacart/src/components/Messages/styles.tsx +2 -0
  12. package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +7 -1
  13. package/themes/kiosk/src/components/CartBottomSheet/styles.tsx +1 -1
  14. package/themes/kiosk/src/components/CategoriesMenu/index.tsx +8 -1
  15. package/themes/original/src/components/Messages/index.tsx +61 -5
  16. package/themes/original/src/components/Messages/styles.tsx +2 -2
  17. package/themes/original/src/components/ProductForm/index.tsx +40 -24
  18. package/themes/single-business/index.tsx +4 -0
  19. package/themes/single-business/src/components/AddressList/index.tsx +2 -2
  20. package/themes/single-business/src/components/BusinessProductsCategories/index.tsx +89 -16
  21. package/themes/single-business/src/components/BusinessProductsList/index.tsx +22 -8
  22. package/themes/single-business/src/components/BusinessProductsList/styles.tsx +1 -1
  23. package/themes/single-business/src/components/BusinessProductsListing/index.tsx +71 -26
  24. package/themes/single-business/src/components/LoginForm/index.tsx +43 -26
  25. package/themes/single-business/src/components/OrderListOption/index.tsx +231 -0
  26. package/themes/single-business/src/components/OrderListOption/styles.tsx +62 -0
  27. package/themes/single-business/src/components/OrdersListing/index.tsx +112 -0
  28. package/themes/single-business/src/components/SignupForm/index.tsx +15 -16
  29. package/themes/single-business/src/components/UserProfile/index.tsx +9 -3
  30. package/themes/single-business/src/types/index.tsx +9 -0
  31. package/themes/single-business/src/utils/index.tsx +32 -1
  32. package/themes/uber-eats/src/components/Messages/index.tsx +59 -4
  33. package/themes/uber-eats/src/components/Messages/styles.tsx +2 -0
@@ -82,7 +82,6 @@ const SignupFormUI = (props: SignupParams) => {
82
82
  display: 'flex',
83
83
  flexDirection: 'row',
84
84
  justifyContent: 'space-between',
85
- marginBottom: 30,
86
85
  },
87
86
  line: {
88
87
  height: 1,
@@ -539,6 +538,21 @@ const SignupFormUI = (props: SignupParams) => {
539
538
  )}
540
539
  </FormInput>
541
540
 
541
+ {
542
+ onNavigationRedirect && loginButtonText && (
543
+ <View style={style.wrappText}>
544
+ <OText size={14} style={{ marginRight: 5 }}>
545
+ {t('MOBILE_FRONT_ALREADY_HAVE_AN_ACCOUNT', 'Already have an account?')}
546
+ </OText>
547
+ <Pressable onPress={() => onNavigationRedirect('Login')}>
548
+ <OText size={14} color={theme.colors.primary}>
549
+ {loginButtonText}
550
+ </OText>
551
+ </Pressable>
552
+ </View>
553
+ )
554
+ }
555
+
542
556
  <View
543
557
  style={{
544
558
  flexDirection: 'row',
@@ -578,21 +592,6 @@ const SignupFormUI = (props: SignupParams) => {
578
592
  </SocialButtons>
579
593
  </ButtonsWrapper>
580
594
 
581
- {/* {
582
- onNavigationRedirect && loginButtonText && (
583
- <View style={style.wrappText}>
584
- <OText size={18} style={{ marginRight: 5 }}>
585
- {t('MOBILE_FRONT_ALREADY_HAVE_AN_ACCOUNT', 'Already have an account?')}
586
- </OText>
587
- <Pressable onPress={() => onNavigationRedirect('Login')}>
588
- <OText size={18} color={theme.colors.primary}>
589
- {loginButtonText}
590
- </OText>
591
- </Pressable>
592
- </View>
593
- )
594
- } */}
595
-
596
595
  {/* {
597
596
  configs && Object.keys(configs).length > 0 && (
598
597
  (configs?.facebook_login?.value === 'true' ||
@@ -123,6 +123,12 @@ const ProfileListUI = (props: ProfileParams) => {
123
123
  onNavigationRedirect: (route: string, params: any) => props.navigation.navigate(route, params)
124
124
  }
125
125
 
126
+ const getName = () => {
127
+ return user?.lastname
128
+ ? `${user?.name} ${user?.lastname}`
129
+ : user?.name
130
+ }
131
+
126
132
  return (
127
133
  <View style={{ flex: 1, height: height - top - bottom - 62 }}>
128
134
  <OText size={24} color={theme.colors.textNormal} lineHeight={36} weight={Platform.OS === 'ios' ? '600' : 'bold'} style={{ marginTop: 14, marginBottom: 24, ...styles.pagePadding }}>{t('PROFILE', 'Profile')}</OText>
@@ -136,7 +142,7 @@ const ProfileListUI = (props: ProfileParams) => {
136
142
  />
137
143
  </View>
138
144
  <View style={{ flexBasis: '70%' }}>
139
- <OText size={20} lineHeight={30} weight={Platform.OS === 'ios' ? '500' : 'bold'} color={theme.colors.textNormal}>{`${user?.name} ${user?.lastname}`}</OText>
145
+ <OText size={20} lineHeight={30} weight={Platform.OS === 'ios' ? '500' : 'bold'} color={theme.colors.textNormal}>{getName()}</OText>
140
146
  <TouchableOpacity onPress={() => navigation.navigate('ProfileForm', { ...detailProps })}>
141
147
  <OText size={12} lineHeight={18} color={theme.colors.primary} style={{ textDecorationLine: 'underline' }}>{t('VIEW_ACCOUNT', 'View account')}</OText>
142
148
  </TouchableOpacity>
@@ -154,10 +160,10 @@ const ProfileListUI = (props: ProfileParams) => {
154
160
  <OIcon src={theme.images.general.help} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
155
161
  <OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('HELP', 'Help')}</OText>
156
162
  </ListItem>
157
- <ListItem onPress={() => navigation.navigate('Notifications', {})} activeOpacity={0.7}>
163
+ {/* <ListItem onPress={() => navigation.navigate('Notifications', {})} activeOpacity={0.7}>
158
164
  <OIcon src={theme.images.general.bell} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
159
165
  <OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('NOTIFICATIONS', ' Notifications')}</OText>
160
- </ListItem>
166
+ </ListItem> */}
161
167
  </Actions>
162
168
 
163
169
  <Actions>
@@ -162,6 +162,7 @@ export interface BusinessProductsListingParams {
162
162
  errorQuantityProducts?: boolean;
163
163
  header?: any;
164
164
  logo?: any;
165
+ getNextProducts?: any;
165
166
  productModal?: any;
166
167
  handleChangeCategory: (value: any) => {};
167
168
  setProductLogin?: () => {};
@@ -183,6 +184,12 @@ export interface BusinessProductsCategoriesParams {
183
184
  categorySelected: any;
184
185
  featured: boolean;
185
186
  loading?: any;
187
+ scrollViewRef?: any;
188
+ productListLayout?: any;
189
+ categoriesLayout?: any;
190
+ selectedCategoryId?: any;
191
+ setSelectedCategoryId?: any;
192
+ lazyLoadProductsRecommended?: any;
186
193
  }
187
194
  export interface BusinessProductsListParams {
188
195
  errors?: any;
@@ -198,6 +205,8 @@ export interface BusinessProductsListParams {
198
205
  isBusinessLoading?: any,
199
206
  errorQuantityProducts?: boolean,
200
207
  handleCancelSearch?: () => void
208
+ categoriesLayout?: any
209
+ setCategoriesLayout?: any
201
210
  }
202
211
  export interface SingleProductCardParams {
203
212
  businessId: any,
@@ -219,4 +219,35 @@ export const getOrderStatus = (status: number) => {
219
219
  default:
220
220
  return status
221
221
  }
222
- }
222
+ }
223
+
224
+ export const getTextOrderStatus = (s: string, t: any) => {
225
+ const status = parseInt(s)
226
+ const orderStatus = [
227
+ { key: 0, value: t('PENDING', 'Pending') },
228
+ { key: 1, value: t('COMPLETED', 'Completed') },
229
+ { key: 2, value: t('REJECTED', 'Rejected') },
230
+ { key: 3, value: t('DRIVER_IN_BUSINESS', 'Driver in business') },
231
+ { key: 4, value: t('PREPARATION_COMPLETED', 'Preparation Completed') },
232
+ { key: 5, value: t('REJECTED_BY_BUSINESS', 'Rejected by business') },
233
+ { key: 6, value: t('REJECTED_BY_DRIVER', 'Rejected by Driver') },
234
+ { key: 7, value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business') },
235
+ { key: 8, value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver') },
236
+ { key: 9, value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver') },
237
+ { key: 10, value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver') },
238
+ { key: 11, value: t('DELIVERY_COMPLETED_BY_DRIVER', 'Delivery completed by driver') },
239
+ { key: 12, value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver') },
240
+ { key: 13, value: t('PREORDER', 'PreOrder') },
241
+ { key: 14, value: t('ORDER_NOT_READY', 'Order not ready') },
242
+ { key: 15, value: t('ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER', 'Order picked up completed by customer') },
243
+ { key: 16, value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer') },
244
+ { key: 17, value: t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', 'Order not picked up by customer') },
245
+ { key: 18, value: t('DRIVER_ALMOST_ARRIVED_TO_BUSINESS', 'Driver almost arrived to business') },
246
+ { key: 19, value: t('DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', 'Driver almost arrived to customer') },
247
+ { key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business') },
248
+ { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') }
249
+ ]
250
+
251
+ const objectStatus = orderStatus.find((o) => o.key === status)
252
+ return objectStatus && objectStatus
253
+ }
@@ -5,9 +5,9 @@ import { useTheme } from 'styled-components/native';
5
5
  import { GiftedChat, Actions, InputToolbar, Composer, Send, Bubble, MessageImage } from 'react-native-gifted-chat'
6
6
  import { USER_TYPE } from '../../config/constants'
7
7
  import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'
8
- import { OIcon, OIconButton, OText } from '../shared'
8
+ import { OIcon, OIconButton, OText, OButton } from '../shared'
9
9
  import { TouchableOpacity, ActivityIndicator, StyleSheet, View, Platform, Keyboard,I18nManager } from 'react-native'
10
- import { Header, TitleHeader, Wrapper } from './styles'
10
+ import { Header, TitleHeader, Wrapper, QuickMessageContainer } from './styles'
11
11
  import { MessagesParams } from '../../types'
12
12
 
13
13
  const ImageDummy = require('../../assets/images/image.png')
@@ -63,6 +63,17 @@ const MessagesUI = (props: MessagesParams) => {
63
63
  const previousStatus = [1, 2, 5, 6, 10, 11, 12, 16, 17]
64
64
  const chatDisabled = previousStatus.includes(order?.status)
65
65
 
66
+ const quickMessageList = [
67
+ { key: 'customer_message_1', text: t('CUSTOMER_MESSAGE_1', 'customer_message_1') },
68
+ { key: 'customer_message_2', text: t('CUSTOMER_MESSAGE_2', 'customer_message_2') },
69
+ { key: 'customer_message_3', text: t('CUSTOMER_MESSAGE_3', 'customer_message_3') },
70
+ { key: 'customer_message_4', text: t('CUSTOMER_MESSAGE_4', 'customer_message_4') }
71
+ ]
72
+
73
+ const handleClickQuickMessage = (text: string) => {
74
+ setMessage && setMessage(`${message}${text}`)
75
+ }
76
+
66
77
  const onChangeMessage = (val: string) => {
67
78
  setMessage && setMessage(val)
68
79
  }
@@ -185,13 +196,48 @@ const MessagesUI = (props: MessagesParams) => {
185
196
  )
186
197
  }
187
198
 
199
+ const renderAccessory = () => {
200
+ return (
201
+ <QuickMessageContainer
202
+ style={{
203
+ marginLeft: 10,
204
+ marginBottom: 10
205
+ }}
206
+ contentContainerStyle={{
207
+ alignItems: 'center',
208
+ }}
209
+ horizontal
210
+ showsHorizontalScrollIndicator={false}
211
+ >
212
+ {quickMessageList.map((quickMessage, i) => (
213
+ <OButton
214
+ key={i}
215
+ text={quickMessage.text}
216
+ bgColor='#E9ECEF'
217
+ borderColor='#E9ECEF'
218
+ imgRightSrc={null}
219
+ textStyle={{
220
+ fontSize: 11,
221
+ lineHeight: 16,
222
+ color: '#414954'
223
+ }}
224
+ style={{ ...styles.editButton }}
225
+ onClick={() => handleClickQuickMessage(quickMessage.text)}
226
+ />
227
+ ))}
228
+ </QuickMessageContainer>
229
+ )
230
+ }
231
+
188
232
  const renderInputToolbar = (props : any) => (
189
233
  <InputToolbar
190
234
  {...props}
191
235
  containerStyle={{
192
- padding: Platform.OS === 'ios' && isKeyboardShow ? 0 : 10
236
+ padding: Platform.OS === 'ios' && isKeyboardShow ? 0 : 10,
237
+ flexDirection: 'column-reverse'
193
238
  }}
194
239
  primaryStyle={{ alignItems: 'center', justifyContent: 'flex-start' }}
240
+ renderAccessory={() => renderAccessory()}
195
241
  />
196
242
  )
197
243
 
@@ -328,7 +374,7 @@ const MessagesUI = (props: MessagesParams) => {
328
374
  renderMessageImage={renderMessageImage}
329
375
  scrollToBottomComponent={() => renderScrollToBottomComponent()}
330
376
  messagesContainerStyle={{
331
- paddingBottom: 20
377
+ paddingBottom: 55
332
378
  }}
333
379
  isLoadingEarlier={messages.loading}
334
380
  renderLoading={() => <ActivityIndicator size="small" color="#000" />}
@@ -354,6 +400,15 @@ const styles = StyleSheet.create({
354
400
  alignItems: 'center',
355
401
  justifyContent: 'center',
356
402
  marginHorizontal: 4
403
+ },
404
+ editButton : {
405
+ borderRadius: 50,
406
+ backgroundColor: '#E9ECEF',
407
+ marginRight: 10,
408
+ height: 24,
409
+ borderWidth: 1,
410
+ paddingLeft: 0,
411
+ paddingRight: 0
357
412
  }
358
413
  })
359
414
 
@@ -19,3 +19,5 @@ export const TitleHeader = styled.View`
19
19
  align-items: flex-start;
20
20
  max-width: 85%;
21
21
  `
22
+
23
+ export const QuickMessageContainer = styled.ScrollView``