ordering-ui-react-native 0.12.20 → 0.12.24

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 (29) hide show
  1. package/package.json +1 -1
  2. package/src/components/ActiveOrders/index.tsx +31 -14
  3. package/src/components/AddressForm/index.tsx +16 -1
  4. package/src/components/Messages/index.tsx +59 -4
  5. package/src/components/Messages/styles.tsx +3 -0
  6. package/themes/business/src/components/Chat/index.tsx +56 -8
  7. package/themes/business/src/components/Chat/styles.tsx +4 -0
  8. package/themes/doordash/src/components/Messages/index.tsx +62 -4
  9. package/themes/doordash/src/components/Messages/styles.tsx +2 -0
  10. package/themes/doordash/src/components/shared/OButton.tsx +2 -1
  11. package/themes/instacart/src/components/Messages/index.tsx +60 -5
  12. package/themes/instacart/src/components/Messages/styles.tsx +2 -0
  13. package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +7 -1
  14. package/themes/kiosk/src/components/CartBottomSheet/styles.tsx +1 -1
  15. package/themes/kiosk/src/components/CategoriesMenu/index.tsx +8 -1
  16. package/themes/original/src/components/Messages/index.tsx +61 -5
  17. package/themes/original/src/components/Messages/styles.tsx +2 -2
  18. package/themes/original/src/components/ProductForm/index.tsx +40 -24
  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/SignupForm/index.tsx +15 -16
  26. package/themes/single-business/src/components/UserProfile/index.tsx +2 -2
  27. package/themes/single-business/src/types/index.tsx +9 -0
  28. package/themes/uber-eats/src/components/Messages/index.tsx +59 -4
  29. package/themes/uber-eats/src/components/Messages/styles.tsx +2 -0
@@ -136,6 +136,10 @@ const LoginFormUI = (props: LoginParams) => {
136
136
  fontWeight: 'normal',
137
137
  fontSize: 16,
138
138
  },
139
+ linkTxt: {
140
+ flexDirection: 'row',
141
+ justifyContent: 'center',
142
+ }
139
143
  });
140
144
 
141
145
  const inputRef = useRef<any>({});
@@ -425,6 +429,15 @@ const LoginFormUI = (props: LoginParams) => {
425
429
  }}
426
430
  defaultValue=""
427
431
  />
432
+
433
+ {onNavigationRedirect && forgotButtonText && (
434
+ <Pressable onPress={() => onNavigationRedirect('Forgot')}>
435
+ <OText size={14} mBottom={18}>
436
+ {forgotButtonText}
437
+ </OText>
438
+ </Pressable>
439
+ )}
440
+
428
441
  <OButton
429
442
  onClick={handleSubmit(onSubmit)}
430
443
  text={loginButtonText}
@@ -438,13 +451,18 @@ const LoginFormUI = (props: LoginParams) => {
438
451
  </FormInput>
439
452
  )}
440
453
 
441
- {onNavigationRedirect && forgotButtonText && (
442
- <Pressable onPress={() => onNavigationRedirect('Forgot')}>
443
- <OText size={16} mBottom={18}>
444
- {forgotButtonText}
445
- </OText>
446
- </Pressable>
447
- )}
454
+ {onNavigationRedirect && registerButtonText && (
455
+ <View style={loginStyle.linkTxt}>
456
+ <OText size={14} space>
457
+ {t('NEW_ON_PLATFORM', 'New on Ordering?')}
458
+ </OText>
459
+ <Pressable onPress={() => onNavigationRedirect('Signup')}>
460
+ <OText size={14} color={theme.colors.primary}>
461
+ {registerButtonText}
462
+ </OText>
463
+ </Pressable>
464
+ </View>
465
+ )}
448
466
 
449
467
  {useLoginByCellphone &&
450
468
  loginTab === 'cellphone' &&
@@ -453,13 +471,24 @@ const LoginFormUI = (props: LoginParams) => {
453
471
  (configs?.twilio_service_enabled?.value === 'true' ||
454
472
  configs?.twilio_service_enabled?.value === '1') && (
455
473
  <>
456
- <OrSeparator>
457
- <LineSeparator />
458
- <OText size={18} mRight={20} mLeft={20}>
459
- {t('OR', 'Or')}
460
- </OText>
461
- <LineSeparator />
462
- </OrSeparator>
474
+ <View
475
+ style={{
476
+ flexDirection: 'row',
477
+ width: '100%',
478
+ justifyContent: 'space-between',
479
+ alignItems: 'center',
480
+ marginVertical: 30
481
+ }}>
482
+ <View style={loginStyle.line} />
483
+ <OText
484
+ size={14}
485
+ mBottom={10}
486
+ style={{ paddingHorizontal: 19 }}
487
+ color={theme.colors.disabled}>
488
+ {t('OR', 'or')}
489
+ </OText>
490
+ <View style={loginStyle.line} />
491
+ </View>
463
492
 
464
493
  <ButtonsWrapper mBottom={20}>
465
494
  <OButton
@@ -533,18 +562,6 @@ const LoginFormUI = (props: LoginParams) => {
533
562
  </Placeholder>
534
563
  </SkeletonWrapper>
535
564
  )}
536
-
537
- {/* {onNavigationRedirect && registerButtonText && (
538
- <ButtonsWrapper>
539
- <OButton
540
- onClick={() => onNavigationRedirect('Signup')}
541
- text={registerButtonText}
542
- style={loginStyle.btnOutline}
543
- borderColor={theme.colors.primary}
544
- imgRightSrc={null}
545
- />
546
- </ButtonsWrapper>
547
- )} */}
548
565
  </FormSide>
549
566
  <OModal open={isModalVisible} onClose={() => setIsModalVisible(false)}>
550
567
  <VerifyPhone
@@ -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' ||
@@ -154,10 +154,10 @@ const ProfileListUI = (props: ProfileParams) => {
154
154
  <OIcon src={theme.images.general.help} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
155
155
  <OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('HELP', 'Help')}</OText>
156
156
  </ListItem>
157
- <ListItem onPress={() => navigation.navigate('Notifications', {})} activeOpacity={0.7}>
157
+ {/* <ListItem onPress={() => navigation.navigate('Notifications', {})} activeOpacity={0.7}>
158
158
  <OIcon src={theme.images.general.bell} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
159
159
  <OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('NOTIFICATIONS', ' Notifications')}</OText>
160
- </ListItem>
160
+ </ListItem> */}
161
161
  </Actions>
162
162
 
163
163
  <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,
@@ -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``