ordering-ui-react-native 0.22.58 → 0.22.59

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.22.58",
3
+ "version": "0.22.59",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -67,7 +67,8 @@ const AddressFormUI = (props: AddressFormParams) => {
67
67
  hasAddressDefault,
68
68
  afterSignup,
69
69
  businessSlug,
70
- isFromCheckout
70
+ isFromCheckout,
71
+ onNavigationRedirect
71
72
  } = props;
72
73
 
73
74
  const theme = useTheme();
@@ -174,6 +175,8 @@ const AddressFormUI = (props: AddressFormParams) => {
174
175
  const isHideMap = theme?.address?.components?.map?.hidden
175
176
  const isHideIcons = theme?.address?.components?.icons?.hidden
176
177
  const continueAsGuest = () => navigation.navigate(!!businessSlug ? 'Business' : 'BusinessList', { isGuestUser: true });
178
+ const unaddressedTypes = configState?.configs?.unaddressed_order_types_allowed?.value.split('|').map((value: any) => Number(value)) || []
179
+ const isAllowUnaddressOrderType = unaddressedTypes.includes(orderState?.options?.type)
177
180
  const goToBack = () => navigation?.canGoBack() && navigation.goBack();
178
181
 
179
182
  const getAddressFormatted = (address: any) => {
@@ -528,6 +531,12 @@ const AddressFormUI = (props: AddressFormParams) => {
528
531
  setIsSignUpEffect(true);
529
532
  }, [orderState.loading]);
530
533
 
534
+ useEffect(() => {
535
+ if (isAllowUnaddressOrderType) {
536
+ onNavigationRedirect && onNavigationRedirect(!!businessSlug ? 'Business' : 'BusinessList')
537
+ }
538
+ }, [isAllowUnaddressOrderType])
539
+
531
540
  return (
532
541
  <ScrollView
533
542
  keyboardShouldPersistTaps='always'
@@ -18,12 +18,6 @@ export const Home = (props: any) => {
18
18
  const unaddressedTypes = configs?.unaddressed_order_types_allowed?.value.split('|').map((value: any) => Number(value)) || []
19
19
  const isAllowUnaddressOrderType = unaddressedTypes.includes(orderState?.options?.type)
20
20
 
21
- useEffect(() => {
22
- if (isAllowUnaddressOrderType) {
23
- onNavigationRedirect(!!businessSlug ? 'Business' : 'BusinessList')
24
- }
25
- }, [isAllowUnaddressOrderType])
26
-
27
21
  return (
28
22
  <View style={styles.container}>
29
23
  <View>
@@ -66,7 +60,7 @@ export const Home = (props: any) => {
66
60
  <TouchableOpacity
67
61
  style={{ ...styles.textLink, marginTop: 12 }}
68
62
  onPress={() =>
69
- orderState?.options?.address?.address
63
+ orderState?.options?.address?.address || isAllowUnaddressOrderType
70
64
  ? onNavigationRedirect(!!businessSlug ? 'Business' : 'BusinessList', { isGuestUser: true })
71
65
  : onNavigationRedirect('AddressForm', { isGuestUser: true })
72
66
  }>
@@ -29,7 +29,7 @@ import {
29
29
  TimeItem
30
30
  } from './styles';
31
31
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
32
- import { locale, monthsEnum } from '../../utils';
32
+ import { monthsEnum, setLocalMoment } from '../../utils';
33
33
 
34
34
  const MomentOptionUI = (props: MomentOptionParams) => {
35
35
  const {
@@ -323,6 +323,10 @@ const MomentOptionUI = (props: MomentOptionParams) => {
323
323
  }
324
324
  }, [dateSelected, JSON.stringify(hoursList), JSON.stringify(datesWhitelist), cateringPreorder, JSON.stringify(business)])
325
325
 
326
+ useEffect(() => {
327
+ setLocalMoment(moment, t)
328
+ }, [])
329
+
326
330
  return (
327
331
  <>
328
332
  <Container
@@ -394,7 +398,6 @@ const MomentOptionUI = (props: MomentOptionParams) => {
394
398
  <View style={{ flex: 1 }}>
395
399
  {selectDate && datesWhitelist[0]?.start !== null && (
396
400
  <CalendarStrip
397
- locale={locale}
398
401
  scrollable
399
402
  style={styles.calendar}
400
403
  calendarHeaderContainerStyle={styles.calendarHeaderContainer}