ordering-ui-react-native 0.18.76 → 0.18.78

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.18.76",
3
+ "version": "0.18.78",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -176,7 +176,6 @@ const OrderProgressUI = (props: any) => {
176
176
  ? parseTime(lastOrder?.delivery_datetime_utc, { outputFormat: configs?.general_hour_format?.value || 'HH:mm' })
177
177
  : parseTime(lastOrder?.delivery_datetime, { utc: false })}
178
178
   - 
179
- <OrderEta order={lastOrder} outputFormat='hh:mm A' />
180
179
  {statusToShow.includes(lastOrder?.status) ? (
181
180
  <OrderEta order={lastOrder} outputFormat={configs?.general_hour_format?.value || 'HH:mm'} />
182
181
  ) : (
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import { View, StyleSheet, useWindowDimensions, Keyboard, Platform } from 'react-native';
3
- import { useLanguage, useSession, useConfig } from 'ordering-components/native';
3
+ import { useLanguage, useSession, useConfig, useValidationFields } from 'ordering-components/native';
4
4
  import {
5
5
  StripeProvider,
6
6
  CardField,
@@ -41,6 +41,7 @@ const StripeElementsFormUI = (props: any) => {
41
41
  const [, t] = useLanguage();
42
42
  const [{ user }] = useSession();
43
43
  const [{ configs }] = useConfig();
44
+ const [validationFields] = useValidationFields()
44
45
  const [card, setCard] = useState<any>(null);
45
46
  const [isCompleted, setIsCompleted] = useState(false);
46
47
  const [errors, setErrors] = useState('')
@@ -49,7 +50,8 @@ const StripeElementsFormUI = (props: any) => {
49
50
  const { height } = useWindowDimensions();
50
51
  const { top, bottom } = useSafeAreaInsets();
51
52
  const [isKeyboardShow, setIsKeyboardShow] = useState(false);
52
-
53
+ const zipCodeEnabled = validationFields?.checkout?.zipcode?.enabled
54
+ const zipCodeRequired = validationFields?.checkout?.zipcode?.required
53
55
  const styles = StyleSheet.create({
54
56
  container: {
55
57
  width: '100%',
@@ -166,7 +168,8 @@ const StripeElementsFormUI = (props: any) => {
166
168
  !!card?.last4 &&
167
169
  !!card?.expiryMonth &&
168
170
  !!card?.expiryYear &&
169
- !!card?.brand
171
+ !!card?.brand &&
172
+ ((!zipCodeEnabled || !zipCodeRequired || !!card?.postalCode))
170
173
  )
171
174
  }
172
175
  }, [card])
@@ -217,7 +220,7 @@ const StripeElementsFormUI = (props: any) => {
217
220
  />
218
221
  ) : (
219
222
  <CardField
220
- postalCodeEnabled={true}
223
+ postalCodeEnabled={zipCodeEnabled}
221
224
  cardStyle={{
222
225
  backgroundColor: '#FFFFFF',
223
226
  textColor: '#000000',