ordering-ui-react-native 0.16.94 → 0.16.96

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.16.94",
3
+ "version": "0.16.96",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -599,8 +599,9 @@ const AddressFormUI = (props: AddressFormParams) => {
599
599
  />
600
600
 
601
601
  {(
602
- (!isEditing && !formState.changes?.address) ||
603
- (isEditing && !formState.changes?.address && formState.changes?.address !== undefined)) &&
602
+ (!isEditing && !isGuestUser && !formState.changes?.address) ||
603
+ (isEditing && !isGuestUser && !formState.changes?.address && formState.changes?.address !== undefined)) ||
604
+ (isGuestUser && !formState.changes?.address && formState.changes?.address !== undefined) &&
604
605
  (
605
606
  <View style={styles.pinIcon}>
606
607
  <GPSButton
@@ -73,8 +73,6 @@ export const BusinessesListing = (props: any) => {
73
73
  )
74
74
  }
75
75
 
76
-
77
-
78
76
  useEffect(() => {
79
77
  (checkNotificationStatus?.checked && auth) && _getLastOrderHasNoReview()
80
78
  }, [checkNotificationStatus, auth])
@@ -82,7 +80,7 @@ export const BusinessesListing = (props: any) => {
82
80
  return (
83
81
  <>
84
82
  {((layout === 'original') || logosLayout) && <OriginalBusinessListing {...props} />}
85
- {(layout === 'appointment') && !logosLayout && <AppointmentBusinessListing {...props} />}
83
+ {(layout === 'appointments') && !logosLayout && <AppointmentBusinessListing {...props} />}
86
84
 
87
85
  {lastOrderReview?.isReviewOpen && (
88
86
  <OBottomPopup
@@ -1,4 +1,16 @@
1
- import React, { useEffect, useRef, useCallback } from 'react';
1
+ import React, { useEffect, useRef, useState, useCallback } from 'react';
2
+ import {
3
+ View,
4
+ Keyboard,
5
+ TextInput,
6
+ TouchableOpacity,
7
+ StyleSheet,
8
+ Dimensions,
9
+ I18nManager,
10
+ SafeAreaView,
11
+ Platform,
12
+ Button
13
+ } from 'react-native';
2
14
  import {
3
15
  ProductForm as ProductOptions,
4
16
  useSession,
@@ -15,17 +27,10 @@ import Swiper from 'react-native-swiper'
15
27
  import FastImage from 'react-native-fast-image';
16
28
  import IconAntDesign from 'react-native-vector-icons/AntDesign';
17
29
  import YoutubePlayer from "react-native-youtube-iframe"
18
- import { Keyboard, TextInput } from 'react-native'
19
- import {
20
- Grayscale
21
- } from 'react-native-color-matrix-image-filters'
22
-
23
- import { View, TouchableOpacity, StyleSheet, Dimensions, I18nManager, SafeAreaView, Platform, Button } from 'react-native';
24
30
 
25
31
  import {
26
32
  WrapHeader,
27
33
  TopHeader,
28
- WrapContent,
29
34
  ProductTitle,
30
35
  ProductDescription,
31
36
  ProductEditions,
@@ -45,8 +50,6 @@ import { ScrollView } from 'react-native-gesture-handler';
45
50
  import { ProductOptionSubOption } from '../ProductOptionSubOption';
46
51
  import { NotFoundSource } from '../NotFoundSource';
47
52
  import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
48
- import { useState } from 'react';
49
- const windowHeight = Dimensions.get('window').height;
50
53
  const windowWidth = Dimensions.get('window').width;
51
54
 
52
55
  export const ProductOptionsUI = (props: any) => {
@@ -183,7 +186,6 @@ export const ProductOptionsUI = (props: any) => {
183
186
  const [headerRefHeight, setHeaderRefHeight] = useState(0)
184
187
  const [summaryRefHeight, setSummaryRefHeight] = useState(0)
185
188
  const [isScrollAvailable, setIsScrollAvailable] = useState(null)
186
- const [isKeyboardShow, setIsKeyboardShow] = useState(false)
187
189
 
188
190
  const isError = (id: number) => {
189
191
  let bgColor = theme.colors.white;
@@ -457,14 +459,10 @@ export const ProductOptionsUI = (props: any) => {
457
459
 
458
460
  useEffect(() => {
459
461
  const keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', () => {
460
- setIsKeyboardShow(true)
461
- })
462
- const keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', () => {
463
- setIsKeyboardShow(false)
462
+ scrollViewRef.current.scrollToEnd({ animated: true })
464
463
  })
465
464
  return () => {
466
465
  keyboardDidShowListener.remove()
467
- keyboardDidHideListener.remove()
468
466
  }
469
467
  }, [])
470
468
 
@@ -481,7 +479,8 @@ export const ProductOptionsUI = (props: any) => {
481
479
  ref={scrollViewRef}
482
480
  contentContainerStyle={{ paddingBottom: 80 }}
483
481
  stickyHeaderIndices={[2]}
484
- onScroll={handleScroll}>
482
+ onScroll={handleScroll}
483
+ >
485
484
  <WrapHeader onLayout={(event: any) => setHeaderRefHeight(event.nativeEvent.layout?.height)}>
486
485
  {loading && !product ? (
487
486
  <View style={styles.productHeaderSkeleton}>
@@ -962,7 +961,7 @@ export const ProductOptionsUI = (props: any) => {
962
961
  </>
963
962
  )}
964
963
  {!product?.hide_special_instructions && (
965
- <ProductComment pb={isKeyboardShow && Platform.OS === 'ios' && 320}>
964
+ <ProductComment>
966
965
  <SectionTitle>
967
966
  <OText size={16} weight={'600'} lineHeight={24}>
968
967
  {t('SPECIAL_COMMENT', 'Special comment')}