ordering-ui-react-native 0.16.55 → 0.16.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.16.55",
3
+ "version": "0.16.58",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -48,6 +48,20 @@ const BusinessInformationUI = (props: BusinessInformationParams) => {
48
48
  />
49
49
  <WrapMainContent>
50
50
  <InnerContent>
51
+ {(!!businessState?.business?.email || !!businessState?.business?.cellphone) && (
52
+ <>
53
+ <GrayBackground>
54
+ <OText size={16} weight='bold'>{t('BUSINESS_DETAILS', 'Business Details')}</OText>
55
+ </GrayBackground>
56
+ {!!businessState?.business?.email && (
57
+ <OText size={14} mBottom={5} mLeft={15} style={{ marginTop: 10 }}>{t('EMAIL', 'Email')}: <OText color={theme.colors.textSecondary}>{businessState?.business?.email}</OText></OText>
58
+ )}
59
+ {!!businessState?.business?.cellphone && (
60
+ <OText size={14} mBottom={20} mLeft={15}>{t('CELLPHONE', 'Cellphone')}: <OText color={theme.colors.textSecondary}>{businessState?.business?.cellphone}</OText></OText>
61
+ )}
62
+ </>
63
+ )}
64
+
51
65
  <GrayBackground>
52
66
  <OText size={16} weight='bold'>{t('BUSINESS_LOCATION', 'Business Location')}</OText>
53
67
  </GrayBackground>
@@ -59,7 +59,7 @@ export const PaymentOptionsWebView = (props: PaymentOptionsWebViewParams) => {
59
59
  if (e?.nativeEvent?.data && e?.nativeEvent?.data !== 'undefined') {
60
60
  let payment = JSON.parse(e.nativeEvent.data);
61
61
 
62
- if (payment === 'api error') {
62
+ if (payment === 'api error' || payment === 'Cancelled by user') {
63
63
  setShowGateway({ closedByUser: true, open: false })
64
64
  setProg(true);
65
65
  }
@@ -31,8 +31,8 @@ export const PreviousOrders = (props: any) => {
31
31
  const theme = useTheme();
32
32
  const [, setCurrentTime] = useState()
33
33
  const [allowColumns, setAllowColumns] = useState({
34
- timer: true,
35
- slaBar: true,
34
+ timer: configState?.configs?.order_deadlines_enabled?.value === '1',
35
+ slaBar: configState?.configs?.order_deadlines_enabled?.value === '1',
36
36
  })
37
37
 
38
38
  const [orientationState] = useDeviceOrientation();
@@ -85,7 +85,7 @@ export const BusinessesListing = (props: any) => {
85
85
  transparent={true}
86
86
  onClose={() => setLastOrderReview({ ...lastOrderReview, isReviewOpen: false, order: defaultOrder })}
87
87
  title={t('HEY', 'Hey! ') + t('HOW_WAS_YOUR_ORDER', 'How was your order?')}
88
- bottomContainerStyle={{ height: 'auto' }}
88
+ bottomContainerStyle={{ height: 'auto', borderRadius: 10 }}
89
89
  titleStyle={{ textAlign: 'center' }}
90
90
  closeIcon={theme.images.general.close}
91
91
  >
@@ -217,7 +217,7 @@ const CheckoutUI = (props: any) => {
217
217
  const _requiredFields: any = []
218
218
 
219
219
  Object.values(validationFields?.fields?.checkout).map((field: any) => {
220
- if (field?.required && !notFields.includes(field.code)) {
220
+ if (field?.required && !notFields.includes(field.code) && field?.enabled) {
221
221
  if (!user[field?.code]) {
222
222
  _requiredFields.push(field?.code)
223
223
  }
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react';
2
- import { View, StyleSheet, BackHandler, Platform, Linking } from 'react-native';
2
+ import { View, StyleSheet, BackHandler, Platform, Linking, RefreshControl } from 'react-native';
3
3
  import LinearGradient from 'react-native-linear-gradient';
4
4
  import { _setStoreData } from '../../providers/StoreUtil';
5
5
  import {
@@ -54,7 +54,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
54
54
  driverLocation,
55
55
  onNavigationRedirect,
56
56
  reorderState,
57
- handleReorder
57
+ handleReorder,
58
+ getOrder
58
59
  } = props;
59
60
 
60
61
  const theme = useTheme();
@@ -101,6 +102,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
101
102
  const [isReviewed, setIsReviewed] = useState(false)
102
103
  const [isOrderHistory, setIsOrderHistory] = useState(false)
103
104
  const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, tax: null, type: '' })
105
+ const [refreshing] = useState(false);
104
106
  const { order, businessData } = props.order;
105
107
  const mapValidStatuses = [9, 19, 23]
106
108
 
@@ -380,6 +382,11 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
380
382
  ) && !order.review && !isReviewed && handleClickOrderReview(order)
381
383
  }
382
384
 
385
+
386
+ const resfreshOrder = () => {
387
+ getOrder()
388
+ }
389
+
383
390
  useEffect(() => {
384
391
  const _businessId = 'businessId:' + businessData?.id
385
392
  if (reorderState?.error) {
@@ -447,7 +454,15 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
447
454
  }, [driverLocation]);
448
455
 
449
456
  return (
450
- <OrderDetailsContainer keyboardShouldPersistTaps="handled">
457
+ <OrderDetailsContainer
458
+ keyboardShouldPersistTaps="handled"
459
+ refreshControl={
460
+ <RefreshControl
461
+ refreshing={refreshing}
462
+ onRefresh={() => resfreshOrder()}
463
+ />
464
+ }
465
+ >
451
466
  {(!order || Object.keys(order).length === 0) && (
452
467
  <Placeholder style={{ marginTop: 30 }}>
453
468
  <Header>
@@ -101,7 +101,7 @@ export const ReviewTrigger = (props: any) => {
101
101
  </FormReviews>
102
102
  </View>
103
103
  </ReviewOrderContainer>
104
- <FloatingBottomContainer>
104
+ <FloatingBottomContainer borderTopWidth={0} borderRadius={10}>
105
105
  <ActionContainer>
106
106
  <OButton
107
107
  textStyle={{ color: theme.colors.white, paddingRight: 10 }}
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components/native'
2
2
 
3
3
  export const ReviewOrderContainer = styled.ScrollView`
4
- padding: 20px 40px;
4
+ padding: 0 25px;
5
5
  margin-bottom: 100px;
6
6
  `
7
7
 
@@ -13,7 +13,7 @@ export const BusinessLogo = styled.View`
13
13
  export const FormReviews = styled.View`
14
14
  flex: 1;
15
15
  height: 100%;
16
- margin-top: 30px;
16
+ margin-top: 10px;
17
17
  `
18
18
 
19
19
  export const ActionContainer = styled.View`
@@ -47,19 +47,21 @@ const OBottomPopup = (props: Props) => {
47
47
  </TouchableWithoutFeedback>
48
48
  <View style={{ ...styles.bottomContainer, ...bottomContainerStyle }}>
49
49
  <View style={{ paddingTop: top, paddingBottom: bottom }}>
50
- {closeIcon && (
51
- <TouchableOpacity onPress={onClose} style={styles.closeIconStyle}>
52
- <OIcon
53
- src={closeIcon}
54
- width={30}
55
- />
56
- </TouchableOpacity>
57
- )}
58
- {!!title && (
59
- <Text style={{ ...styles.titleStyle, ...titleStyle }}>
60
- {title}
61
- </Text>
62
- )}
50
+ <View style={styles.modalTitleStyle}>
51
+ {closeIcon && (
52
+ <TouchableOpacity onPress={onClose} style={styles.closeIconStyle}>
53
+ <OIcon
54
+ src={closeIcon}
55
+ width={30}
56
+ />
57
+ </TouchableOpacity>
58
+ )}
59
+ {!!title && (
60
+ <Text style={{ ...styles.titleStyle, ...titleStyle }}>
61
+ {title}
62
+ </Text>
63
+ )}
64
+ </View>
63
65
  {children}
64
66
  </View>
65
67
  </View>
@@ -86,12 +88,17 @@ const styles = StyleSheet.create({
86
88
  },
87
89
  titleStyle: {
88
90
  fontSize: 20,
89
- fontWeight: 'bold',
90
- marginVertical: 10
91
+ fontWeight: 'bold'
91
92
  },
92
93
  closeIconStyle: {
93
- paddingTop: 20,
94
- paddingLeft: 20
94
+ position: 'absolute',
95
+ left: 25,
96
+ top: 22.5
97
+ },
98
+ modalTitleStyle: {
99
+ position: 'relative',
100
+ paddingHorizontal: 10,
101
+ paddingVertical: 20
95
102
  }
96
103
  })
97
104
 
@@ -19,7 +19,11 @@ export const Container = styled.View`
19
19
 
20
20
  export const FloatingBottomContainer = (props: any) => {
21
21
  return (
22
- <Container style={{ width: windowWidth }}>
22
+ <Container style={{
23
+ width: windowWidth,
24
+ borderTopWidth: props?.borderTopWidth ?? 1,
25
+ borderRadius: props?.borderRadius ?? 0
26
+ }}>
23
27
  {props.children}
24
28
  </Container>
25
29
  )