ordering-ui-react-native 0.12.62 → 0.12.66
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 +2 -1
- package/src/components/BusinessProductsListing/index.tsx +2 -1
- package/src/components/Messages/index.tsx +4 -4
- package/src/components/OrderCreating/index.tsx +1 -2
- package/src/components/OrderDetails/index.tsx +7 -1
- package/src/navigators/HomeNavigator.tsx +0 -1
- package/themes/business/src/components/Chat/index.tsx +31 -16
- package/themes/doordash/src/components/BusinessProductsListing/index.tsx +341 -341
- package/themes/original/index.tsx +4 -0
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +1 -1
- package/themes/original/src/components/BusinessController/index.tsx +9 -2
- package/themes/original/src/components/BusinessMenuList/index.tsx +132 -0
- package/themes/original/src/components/BusinessMenuList/styles.tsx +15 -0
- package/themes/original/src/components/BusinessPreorder/index.tsx +474 -0
- package/themes/original/src/components/BusinessPreorder/styles.tsx +60 -0
- package/themes/original/src/components/BusinessesListing/index.tsx +2 -1
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +3 -1
- package/themes/original/src/types/index.tsx +22 -1
- package/themes/single-business/src/components/BusinessBasicInformation/index.tsx +2 -2
- package/themes/single-business/src/components/BusinessProductsListing/index.tsx +2 -2
- package/themes/single-business/src/components/BusinessesListing/index.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-react-native",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.66",
|
|
4
4
|
"description": "Reusable components made in react native",
|
|
5
5
|
"main": "src/index.tsx",
|
|
6
6
|
"author": "ordering.inc",
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
"react-native-background-timer": "^2.4.1",
|
|
70
70
|
"react-native-bootsplash": "^3.2.3",
|
|
71
71
|
"react-native-calendar-picker": "^7.1.2",
|
|
72
|
+
"react-native-calendar-strip": "^2.2.5",
|
|
72
73
|
"react-native-country-picker-modal": "^2.0.0",
|
|
73
74
|
"react-native-credit-card-input": "^0.4.1",
|
|
74
75
|
"react-native-document-picker": "^5.2.0",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import { View, TouchableOpacity, StyleSheet } from 'react-native'
|
|
2
|
+
import { View, TouchableOpacity, StyleSheet, Platform } from 'react-native'
|
|
3
3
|
import MaterialIcon from 'react-native-vector-icons/MaterialIcons'
|
|
4
4
|
import {
|
|
5
5
|
BusinessAndProductList,
|
|
@@ -325,6 +325,7 @@ const styles = StyleSheet.create({
|
|
|
325
325
|
export const BusinessProductsListing = (props: BusinessProductsListingParams) => {
|
|
326
326
|
const businessProductslistingProps = {
|
|
327
327
|
...props,
|
|
328
|
+
isForceSearch: Platform.OS === 'ios',
|
|
328
329
|
UIComponent: BusinessProductsListingUI
|
|
329
330
|
}
|
|
330
331
|
return (
|
|
@@ -67,10 +67,10 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
67
67
|
const theme = useTheme();
|
|
68
68
|
|
|
69
69
|
const quickMessageList = [
|
|
70
|
-
{ key: '
|
|
71
|
-
{ key: '
|
|
72
|
-
{ key: '
|
|
73
|
-
{ key: '
|
|
70
|
+
{ key: 'customer_message_1', text: t('CUSTOMER_MESSAGE_1', 'customer_message_1') },
|
|
71
|
+
{ key: 'customer_message_2', text: t('CUSTOMER_MESSAGE_2', 'customer_message_2') },
|
|
72
|
+
{ key: 'customer_message_3', text: t('CUSTOMER_MESSAGE_3', 'customer_message_3') },
|
|
73
|
+
{ key: 'customer_message_4', text: t('CUSTOMER_MESSAGE_4', 'customer_message_4') }
|
|
74
74
|
]
|
|
75
75
|
|
|
76
76
|
const [formattedMessages, setFormattedMessages] = useState<Array<any>>([])
|
|
@@ -86,7 +86,7 @@ export const OrderCreating = (props: any) => {
|
|
|
86
86
|
if (business?.address) {
|
|
87
87
|
AsyncStorage.setItem(
|
|
88
88
|
'business-address',
|
|
89
|
-
|
|
89
|
+
business?.address
|
|
90
90
|
);
|
|
91
91
|
setAddress(business?.address)
|
|
92
92
|
}
|
|
@@ -97,7 +97,6 @@ export const OrderCreating = (props: any) => {
|
|
|
97
97
|
if (isOrderDetail) {
|
|
98
98
|
try {
|
|
99
99
|
const value = await AsyncStorage.getItem('business-address');
|
|
100
|
-
value != null ? JSON.parse(value) : null;
|
|
101
100
|
setAddress(value)
|
|
102
101
|
} catch {
|
|
103
102
|
console.log('err')
|
|
@@ -105,7 +105,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
105
105
|
const [openModalForDriver, setOpenModalForDriver] = useState(false)
|
|
106
106
|
const [unreadAlert, setUnreadAlert] = useState({ business: false, driver: false })
|
|
107
107
|
const [isReviewed, setIsReviewed] = useState(false)
|
|
108
|
-
const [openOrderCreating, setOpenOrderCreating] = useState(
|
|
108
|
+
const [openOrderCreating, setOpenOrderCreating] = useState(false)
|
|
109
109
|
const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, data: null })
|
|
110
110
|
const { order, loading, businessData, error } = props.order
|
|
111
111
|
const isTaxIncluded = order?.tax_type === 1
|
|
@@ -245,6 +245,12 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
245
245
|
}
|
|
246
246
|
}, [loading])
|
|
247
247
|
|
|
248
|
+
useEffect(() => {
|
|
249
|
+
AsyncStorage.getItem('business-address', (err, result) => {
|
|
250
|
+
if (result !== null) setOpenOrderCreating(true)
|
|
251
|
+
})
|
|
252
|
+
}, [])
|
|
253
|
+
|
|
248
254
|
return (
|
|
249
255
|
<OrderDetailsContainer keyboardShouldPersistTaps='handled'>
|
|
250
256
|
{order && order?.id && !error && !loading && (
|
|
@@ -21,7 +21,6 @@ import HelpOrder from '../pages/HelpOrder'
|
|
|
21
21
|
import HelpGuide from '../pages/HelpGuide'
|
|
22
22
|
import HelpAccountAndPayment from '../pages/HelpAccountAndPayment'
|
|
23
23
|
import Splash from '../pages/Splash';
|
|
24
|
-
|
|
25
24
|
const Stack = createStackNavigator();
|
|
26
25
|
|
|
27
26
|
const HomeNavigator = (e : any) => {
|
|
@@ -66,14 +66,22 @@ const ChatUI = (props: MessagesParams) => {
|
|
|
66
66
|
const [, t] = useLanguage();
|
|
67
67
|
const [, { showToast }] = useToast();
|
|
68
68
|
const theme = useTheme();
|
|
69
|
+
const [messageList, setMessageList] = useState<any>([])
|
|
69
70
|
|
|
70
|
-
const
|
|
71
|
+
const storeMessageList: any = [
|
|
71
72
|
{ key: 'store_message_1', text: t('STORE_MESSAGE_1', 'store_message_1') },
|
|
72
73
|
{ key: 'store_message_2', text: t('STORE_MESSAGE_2', 'store_message_2') },
|
|
73
74
|
{ key: 'store_message_3', text: t('STORE_MESSAGE_3', 'store_message_3') },
|
|
74
75
|
{ key: 'store_message_4', text: t('STORE_MESSAGE_4', 'store_message_4') }
|
|
75
76
|
]
|
|
76
77
|
|
|
78
|
+
const driverMessageList: any = [
|
|
79
|
+
{ key: 'driver_message_1', text: t('DRIVER_MESSAGE_1', 'driver_message_1') },
|
|
80
|
+
{ key: 'driver_message_2', text: t('DRIVER_MESSAGE_2', 'driver_message_2') },
|
|
81
|
+
{ key: 'driver_message_3', text: t('DRIVER_MESSAGE_3', 'driver_message_3') },
|
|
82
|
+
{ key: 'driver_message_4', text: t('DRIVER_MESSAGE_4', 'driver_message_4') }
|
|
83
|
+
]
|
|
84
|
+
|
|
77
85
|
const handleClickQuickMessage = (text: string) => {
|
|
78
86
|
setMessage && setMessage(`${message}${text}`)
|
|
79
87
|
}
|
|
@@ -464,6 +472,12 @@ const ChatUI = (props: MessagesParams) => {
|
|
|
464
472
|
);
|
|
465
473
|
};
|
|
466
474
|
|
|
475
|
+
useEffect(() => {
|
|
476
|
+
if (user.level === 2) setMessageList(storeMessageList)
|
|
477
|
+
else if (user.level === 4) setMessageList(driverMessageList)
|
|
478
|
+
else setMessageList([])
|
|
479
|
+
}, [user])
|
|
480
|
+
|
|
467
481
|
useEffect(() => {
|
|
468
482
|
let newMessages: Array<any> = [];
|
|
469
483
|
const console = (
|
|
@@ -754,21 +768,22 @@ const ChatUI = (props: MessagesParams) => {
|
|
|
754
768
|
horizontal
|
|
755
769
|
showsHorizontalScrollIndicator={false}
|
|
756
770
|
>
|
|
757
|
-
{
|
|
758
|
-
<
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
771
|
+
{messageList.map((quickMessage: any, i: number) => (
|
|
772
|
+
<React.Fragment key={i}>
|
|
773
|
+
<OButton
|
|
774
|
+
text={quickMessage.text}
|
|
775
|
+
bgColor='#E9ECEF'
|
|
776
|
+
borderColor='#E9ECEF'
|
|
777
|
+
imgRightSrc={null}
|
|
778
|
+
textStyle={{
|
|
779
|
+
fontSize: 11,
|
|
780
|
+
lineHeight: 16,
|
|
781
|
+
color: '#414954'
|
|
782
|
+
}}
|
|
783
|
+
style={{ ...styles.editButton }}
|
|
784
|
+
onClick={() => handleClickQuickMessage(quickMessage.text)}
|
|
785
|
+
/>
|
|
786
|
+
</React.Fragment>
|
|
772
787
|
))}
|
|
773
788
|
</QuickMessageContainer>
|
|
774
789
|
</View>
|