ordering-ui-react-native 0.21.57 → 0.21.58

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.21.57",
3
+ "version": "0.21.58",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -323,7 +323,6 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
323
323
  <TouchableOpacity onPress={() => goToBack && goToBack()} style={{ marginBottom: 12 }}>
324
324
  <IconAntDesign
325
325
  name='close'
326
- color={theme.colors.textThird}
327
326
  size={24}
328
327
  style={{ marginLeft: -4 }}
329
328
  />
@@ -148,7 +148,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
148
148
  const openCarts = (Object.values(orderState?.carts)?.filter((cart: any) => cart?.products && cart?.products?.length && cart?.status !== 2 && cart?.valid_schedule && cart?.valid_products && cart?.valid_address && cart?.valid_maximum && cart?.valid_minimum && !cart?.wallets) || null) || []
149
149
  const currentCart: any = Object.values(orderState.carts).find((cart: any) => cart?.business?.slug === business?.slug) ?? {}
150
150
  const isOpenFiltProducts = isOpenSearchBar && !!searchValue
151
- const filtProductsHeight = Platform.OS === 'ios' ? 165 : 100
151
+ const filtProductsHeight = Platform.OS === 'ios' ? 65 : 30
152
152
  const viewOrderButtonVisible = !loading && auth && currentCart?.products?.length > 0 && categoryState.products.length !== 0
153
153
 
154
154
  const onRedirect = (route: string, params?: any) => {
@@ -1,5 +1,5 @@
1
- import React, { useState, useEffect, useCallback } from 'react';
2
- import { View, StyleSheet, TouchableOpacity, Platform, I18nManager, ScrollView, SafeAreaView } from 'react-native';
1
+ import React, { useState, useEffect, useCallback, useRef } from 'react';
2
+ import { View, StyleSheet, TouchableOpacity, Platform, I18nManager, ScrollView, Keyboard } from 'react-native';
3
3
  import { initStripe, useConfirmPayment } from '@stripe/stripe-react-native';
4
4
  import NativeStripeSdk from '@stripe/stripe-react-native/src/NativeStripeSdk'
5
5
  import Picker from 'react-native-country-picker-modal';
@@ -170,6 +170,7 @@ const CheckoutUI = (props: any) => {
170
170
  const [paymethodClicked, setPaymethodClicked] = useState<any>(null)
171
171
  const [showTitle, setShowTitle] = useState(false)
172
172
  const [cardList, setCardList] = useState<any>({ cards: [], loading: false, error: null })
173
+ const containerRef = useRef<any>()
173
174
  const cardsMethods = ['credomatic']
174
175
  const stripePaymethods: any = ['stripe', 'stripe_direct', 'stripe_connect', 'stripe_redirect']
175
176
  const placeSpotTypes = [3, 4, 5]
@@ -411,6 +412,15 @@ const CheckoutUI = (props: any) => {
411
412
  }
412
413
  }, [cartState?.error, cartState?.cart, cartState?.loading])
413
414
 
415
+ useEffect(() => {
416
+ const keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', () => {
417
+ containerRef?.current?.scrollToEnd && containerRef.current.scrollToEnd({ animated: true })
418
+ })
419
+ return () => {
420
+ keyboardDidShowListener.remove()
421
+ }
422
+ }, [])
423
+
414
424
  return (
415
425
  <>
416
426
  <View style={styles.wrapperNavbar}>
@@ -436,7 +446,7 @@ const CheckoutUI = (props: any) => {
436
446
  </>
437
447
  </TopHeader>
438
448
  </View>
439
- <Container noPadding onScroll={handleScroll}>
449
+ <Container forwardRef={containerRef} noPadding onScroll={handleScroll}>
440
450
  <View style={styles.wrapperNavbar}>
441
451
  <NavBar
442
452
  hideArrowLeft
@@ -129,7 +129,7 @@ const WalletsUI = (props: any) => {
129
129
  flexDirection: !hideWalletsTheme ? 'column' : 'row',
130
130
  justifyContent: !hideWalletsTheme ? 'flex-start' : 'space-between',
131
131
  alignItems: !hideWalletsTheme ? 'flex-start' : 'center',
132
- marginTop: !hideWalletsTheme ? 0 : 10,
132
+ marginTop: !hideWalletsTheme ? 30 : 10,
133
133
  },
134
134
  }}>
135
135
  <NavBar
@@ -3,7 +3,7 @@ import styled from 'styled-components/native'
3
3
  export const Container = styled.View`
4
4
  padding-horizontal: 20px;
5
5
  padding-bottom: 20px;
6
- padding-top: ${(props: any) => props.pdng};
6
+ padding-top: ${(props: any) => props.pdng || 0};
7
7
  `
8
8
  export const Header = styled.View`
9
9
  flex-direction: row;
@@ -4,7 +4,9 @@ import styled, { css, useTheme } from 'styled-components/native';
4
4
  import { Platform, View } from 'react-native';
5
5
 
6
6
  const ContainerStyled = styled.ScrollView`
7
- flex: 1;
7
+ ${(props: any) => !props.disableFlex && css`
8
+ flex: 1
9
+ `}
8
10
  ${(props: any) => !props.noPadding && css`
9
11
  padding: ${Platform.OS === 'ios' ? '0px 20px' : '20px 20px'};
10
12
  `}
@@ -17,7 +19,7 @@ export const Container = (props: any) => {
17
19
  return (
18
20
  <View
19
21
  style={{
20
- flex: 1,
22
+ flex: props.disableFlex ? undefined : 1,
21
23
  paddingTop: props.pt ?? insets.top,
22
24
  backgroundColor: theme.colors.backgroundPage
23
25
  }}