ordering-ui-react-native 0.12.80 → 0.12.84

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.12.80",
3
+ "version": "0.12.84",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -1,6 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import { OrderList, useLanguage, useOrder, ToastType, useToast } from 'ordering-components/native'
3
- import { OrderDetails as OrderDetailsConTableoller } from './naked'
2
+ import { useLanguage, useOrder, ToastType, useToast, OrderList, OrderDetails as OrderDetailsConTableoller } from 'ordering-components/native'
4
3
  import { useTheme } from 'styled-components/native';
5
4
  import { useFocusEffect } from '@react-navigation/native'
6
5
  import { OText, OModal } from '../shared'
@@ -261,7 +261,9 @@ export interface OrdersOptionParams {
261
261
  setOrderList?: any,
262
262
  preOrders?: boolean,
263
263
  setOrdersLength?: ({ activeOrdersLength, previousOrdersLength }: { activeOrdersLength: number, previousOrdersLength: number }) => void,
264
- ordersLength: { activeOrdersLength: number, previousOrdersLength: number }
264
+ ordersLength: { activeOrdersLength: number, previousOrdersLength: number },
265
+ setSelectedOrderId?: any,
266
+ setOpenMessges?: any
265
267
  }
266
268
  export interface ActiveOrdersParams {
267
269
  orders?: any,
@@ -272,7 +274,9 @@ export interface ActiveOrdersParams {
272
274
  setScreen?: any,
273
275
  screen?: any,
274
276
  loadMoreOrders?: () => {},
275
- onNavigationRedirect?: (route: string, params?: any) => {}
277
+ onNavigationRedirect?: (route: string, params?: any) => {},
278
+ isMessageView?: boolean,
279
+ handleClickOrder?: any
276
280
  }
277
281
  export interface PreviousOrdersParams {
278
282
  orders?: any,
@@ -334,6 +338,7 @@ export interface MessagesParams {
334
338
  setMessages?: () => {},
335
339
  readMessages?: () => {},
336
340
  onClose?: () => void,
341
+ isMeesageListing?: boolean
337
342
  }
338
343
  export interface ViewInterface {
339
344
  navigation?: any;
@@ -459,4 +464,7 @@ export interface HelpGuideParams {
459
464
  export interface HelpAccountAndPaymentParams {
460
465
  navigation: any;
461
466
  }
462
-
467
+
468
+ export interface MessageListingParams {
469
+ navigation: any;
470
+ }
@@ -65,8 +65,8 @@ export const BusinessBasicInformation = (
65
65
  <BusinessHeader
66
66
  style={
67
67
  isBusinessInfoShow
68
- ? {...styles.businesInfoheaderStyle, paddingTop: 0}
69
- : { ...styles.headerStyle, paddingTop: 0, backgroundColor: theme.colors.backgroundGray }
68
+ ? {...styles.businesInfoheaderStyle, paddingTop: Platform.OS === 'ios' ? 40 : 0}
69
+ : { ...styles.headerStyle, paddingTop: Platform.OS === 'ios' ? 40 : 0, backgroundColor: theme.colors.backgroundGray }
70
70
  }
71
71
  source={{
72
72
  uri:
@@ -259,7 +259,10 @@ export const ProductOptionsUI = (props: any) => {
259
259
  }, []);
260
260
 
261
261
  return (
262
- <>
262
+ <KeyboardAvoidingView
263
+ enabled
264
+ behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
265
+ >
263
266
  <ScrollView ref={scrollViewRef}>
264
267
  {!error && (
265
268
  <>
@@ -710,7 +713,7 @@ export const ProductOptionsUI = (props: any) => {
710
713
  </View>
711
714
  </ProductActions>
712
715
  )}
713
- </>
716
+ </KeyboardAvoidingView>
714
717
  );
715
718
  };
716
719
 
@@ -1,4 +1,4 @@
1
- import React, { useState, useEffect } from 'react'
1
+ import React, { useState, useEffect, useRef } from 'react'
2
2
  import { OrderReview as ReviewOrderController, useLanguage, useToast, ToastType } from 'ordering-components/native'
3
3
  import { useForm, Controller } from 'react-hook-form'
4
4
  import LinearGradient from 'react-native-linear-gradient'
@@ -14,7 +14,7 @@ import {
14
14
  RatingTextContainer
15
15
  } from './styles'
16
16
  import { OButton, OIcon, OInput, OText } from '../shared'
17
- import { TouchableOpacity, StyleSheet, View, I18nManager } from 'react-native';
17
+ import { TouchableOpacity, StyleSheet, View, I18nManager, Keyboard } from 'react-native';
18
18
  import NavBar from '../NavBar'
19
19
  import { FloatingBottomContainer } from '../../../../../src/layouts/FloatingBottomContainer'
20
20
  import Spinner from 'react-native-loading-spinner-overlay'
@@ -90,6 +90,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
90
90
  const [alertState, setAlertState] = useState<{ open: boolean, content: Array<any>, success?: boolean }>({ open: false, content: [], success: false })
91
91
  const [comments, setComments] = useState<Array<any>>([])
92
92
  const [extraComment, setExtraComment] = useState('')
93
+ const scrollViewRef = useRef<any>()
93
94
 
94
95
  const onSubmit = () => {
95
96
  if (Object.values(stars).some((value: any) => value === 0)) {
@@ -199,9 +200,23 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
199
200
  setStars({ ...stars, comments: _comment })
200
201
  }, [comments, extraComment])
201
202
 
203
+ useEffect(() => {
204
+ const keyboardDidShowListener = Keyboard.addListener(
205
+ 'keyboardDidShow',
206
+ () => {
207
+ scrollViewRef?.current && scrollViewRef?.current?.scrollToEnd()
208
+ }
209
+ );
210
+
211
+ return () => {
212
+ keyboardDidShowListener.remove();
213
+ };
214
+ }, []);
215
+
216
+
202
217
  return (
203
218
  <>
204
- <ReviewOrderContainer>
219
+ <ReviewOrderContainer ref={scrollViewRef}>
205
220
  <NavBar
206
221
  title={t('REVIEW_ORDER', 'Review Order')}
207
222
  titleAlign={'center'}