ordering-ui-react-native 0.12.74 → 0.12.75
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
package/src/config.json
CHANGED
|
@@ -36,6 +36,7 @@ import { UserProfileForm } from './src/components/UserProfileForm';
|
|
|
36
36
|
import { VerifyPhone } from './src/components/VerifyPhone';
|
|
37
37
|
import { DriverMap } from './src/components/DriverMap';
|
|
38
38
|
import { MapViewUI as MapView } from './src/components/MapView'
|
|
39
|
+
import { NewOrderNotification } from './src/components/NewOrderNotification';
|
|
39
40
|
//OComponents
|
|
40
41
|
import {
|
|
41
42
|
OText,
|
|
@@ -74,8 +75,9 @@ export {
|
|
|
74
75
|
LoginForm,
|
|
75
76
|
LogoutButton,
|
|
76
77
|
MessagesOption,
|
|
77
|
-
NotFoundSource,
|
|
78
78
|
MapView,
|
|
79
|
+
NewOrderNotification,
|
|
80
|
+
NotFoundSource,
|
|
79
81
|
OrderDetailsBusiness,
|
|
80
82
|
OrderDetailsDelivery,
|
|
81
83
|
OrderMessage,
|
|
@@ -59,19 +59,19 @@ export const NewOrderNotification = (props: any) => {
|
|
|
59
59
|
setModalOpen(false)
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
const handleNotification =
|
|
62
|
+
const handleNotification = (order: any) => {
|
|
63
|
+
setModalOpen(true)
|
|
63
64
|
clearInterval(soundTimeout)
|
|
64
65
|
handlePlayNotificationSound()
|
|
65
66
|
setNewOrderId(order.id)
|
|
66
|
-
|
|
67
|
-
}, [newOrderId, notificationSound, soundTimeout])
|
|
67
|
+
}
|
|
68
68
|
|
|
69
69
|
useEffect(() => {
|
|
70
70
|
events.on('order_added', handleNotification)
|
|
71
71
|
return () => {
|
|
72
72
|
events.off('order_added', handleNotification)
|
|
73
73
|
}
|
|
74
|
-
}, [
|
|
74
|
+
}, [])
|
|
75
75
|
|
|
76
76
|
const handleUpdateOrder = useCallback(async (order: any) => {
|
|
77
77
|
if (order?.driver) {
|
|
@@ -20,7 +20,6 @@ import {
|
|
|
20
20
|
} from './styles';
|
|
21
21
|
import { PreviousOrders } from '../PreviousOrders';
|
|
22
22
|
import { OrdersOptionParams } from '../../types';
|
|
23
|
-
import { NewOrderNotification } from '../NewOrderNotification';
|
|
24
23
|
|
|
25
24
|
import { TouchableOpacity } from 'react-native-gesture-handler';
|
|
26
25
|
import GestureRecognizer from 'react-native-swipe-gestures';
|
|
@@ -549,7 +548,6 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
549
548
|
</View>
|
|
550
549
|
{/* </GestureRecognizer> */}
|
|
551
550
|
|
|
552
|
-
<NewOrderNotification />
|
|
553
551
|
{openModal && (
|
|
554
552
|
<OModal open={openModal} entireModal customClose>
|
|
555
553
|
<ModalContainer
|