ordering-ui-react-native 0.17.66 → 0.17.68

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.
Files changed (37) hide show
  1. package/package.json +1 -1
  2. package/src/components/shared/OToast.tsx +2 -2
  3. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +31 -27
  4. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
  5. package/themes/business/src/components/OrdersOption/index.tsx +14 -58
  6. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  7. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  8. package/themes/business/src/components/PreviousOrders/index.tsx +332 -242
  9. package/themes/business/src/components/PreviousOrders/styles.tsx +30 -2
  10. package/themes/business/src/components/ReviewCustomer/index.tsx +12 -2
  11. package/themes/business/src/components/shared/OLink.tsx +24 -12
  12. package/themes/business/src/components/shared/OText.tsx +3 -2
  13. package/themes/business/src/types/index.tsx +6 -1
  14. package/themes/original/index.tsx +2 -0
  15. package/themes/original/src/components/BusinessController/index.tsx +16 -2
  16. package/themes/original/src/components/BusinessController/styles.tsx +13 -1
  17. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  18. package/themes/original/src/components/BusinessProductsListing/index.tsx +1 -0
  19. package/themes/original/src/components/Cart/index.tsx +31 -2
  20. package/themes/original/src/components/FloatingButton/index.tsx +13 -11
  21. package/themes/original/src/components/LoginForm/Otp/index.tsx +0 -6
  22. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  23. package/themes/original/src/components/Messages/index.tsx +15 -0
  24. package/themes/original/src/components/MultiCart/index.tsx +63 -0
  25. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +6 -7
  26. package/themes/original/src/components/MultiCheckout/index.tsx +4 -2
  27. package/themes/original/src/components/MultiOrdersDetails/index.tsx +14 -0
  28. package/themes/original/src/components/OrdersOption/index.tsx +32 -2
  29. package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
  30. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  31. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  32. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  33. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  34. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  35. package/themes/original/src/components/SingleOrderCard/index.tsx +54 -19
  36. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -1
  37. package/themes/original/src/types/index.tsx +2 -0
@@ -0,0 +1,115 @@
1
+ import React, { useState } from 'react'
2
+ import { Animated, StyleSheet, View } from 'react-native'
3
+ import { useTheme } from 'styled-components/native';
4
+ import { useLanguage, useUtils } from 'ordering-components/native'
5
+ import FastImage from 'react-native-fast-image'
6
+ import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'
7
+
8
+ import {
9
+ AccordionSection,
10
+ Accordion,
11
+ ContentInfo,
12
+ AccordionContent,
13
+ ProductOptionsList
14
+ } from './styles'
15
+
16
+ import { OText } from '../shared';
17
+
18
+ export const OrdersGroupedItem = (props: any) => {
19
+ const { groupId, orders } = props
20
+
21
+ const theme = useTheme()
22
+ const [, t] = useLanguage()
23
+ const [{ parseDate }] = useUtils();
24
+ const [isActive, setActiveState] = useState(false)
25
+
26
+ const styles = StyleSheet.create({
27
+ productImage: {
28
+ borderRadius: 7.6,
29
+ width: 60,
30
+ height: 60
31
+ },
32
+ logo: {
33
+ borderRadius: 10,
34
+ shadowColor: "#0000006e",
35
+ shadowRadius: 10,
36
+ elevation: 15,
37
+ justifyContent: 'center',
38
+ alignItems: 'center',
39
+ marginLeft: 3,
40
+ height: 65,
41
+ width: 65
42
+ },
43
+ title: {
44
+ marginBottom: 2,
45
+ fontWeight: '600',
46
+ fontSize: 16,
47
+ color: theme.colors.textGray,
48
+ },
49
+ orderlength: {
50
+ marginBottom: 2,
51
+ fontSize: 12,
52
+ },
53
+ })
54
+
55
+ return (
56
+ <AccordionSection>
57
+ <Accordion
58
+ activeOpacity={1}
59
+ onPress={() => setActiveState(!isActive)}
60
+ >
61
+ <View style={{ flexDirection: 'row', alignItems: 'flex-start' }}>
62
+ <ContentInfo>
63
+ <View style={styles.logo}>
64
+ <FastImage
65
+ style={styles.productImage}
66
+ source={theme.images.general.ordersGroup}
67
+ resizeMode={FastImage.resizeMode.cover}
68
+ />
69
+ </View>
70
+ <View style={{ flex: 1, marginLeft: 10, flexDirection: 'column' }}>
71
+ <View>
72
+ <OText numberOfLines={1} style={styles.title}>
73
+ {t('GROUP_NRO', 'Group No.')}{groupId}
74
+ </OText>
75
+ </View>
76
+ <OText
77
+ style={styles.orderlength}
78
+ color={theme.colors.unselectText}
79
+ numberOfLines={1}
80
+ adjustsFontSizeToFit
81
+ >
82
+ {orders.length}{' '}{t('ORDERS', 'Orders')}
83
+ </OText>
84
+ <OText
85
+ style={styles.orderlength}
86
+ color={theme.colors.unselectText}
87
+ numberOfLines={1}
88
+ adjustsFontSizeToFit
89
+ >
90
+ {orders[0]?.delivery_datetime_utc
91
+ ? parseDate(orders[0]?.delivery_datetime_utc, { outputFormat: 'MM/DD/YY · HH:mm a' })
92
+ : parseDate(orders[0]?.delivery_datetime, { utc: false })}
93
+ </OText>
94
+ </View>
95
+ <View style={{ display: 'flex', flexDirection: 'column', flex: 1, alignItems: 'flex-end', maxWidth: 100 }}>
96
+ <View style={{ flexDirection: 'row' }}>
97
+ <MaterialCommunityIcon name={isActive ? 'chevron-up' : 'chevron-down'} size={18} />
98
+ </View>
99
+ </View>
100
+ </ContentInfo>
101
+ </View>
102
+ </Accordion>
103
+
104
+ <View style={{ display: isActive ? 'flex' : 'none' }}>
105
+ <Animated.View>
106
+ <AccordionContent>
107
+ <ProductOptionsList>
108
+ {props.children}
109
+ </ProductOptionsList>
110
+ </AccordionContent>
111
+ </Animated.View>
112
+ </View>
113
+ </AccordionSection>
114
+ )
115
+ }