23 lines
631 B
TypeScript
Executable file
23 lines
631 B
TypeScript
Executable file
import Toast from "react-native-toast-message";
|
|
import React from "react";
|
|
import { useRouter } from "expo-router";
|
|
|
|
export function NotificationToast(title: string, subtitle: string, data: any) {
|
|
const router = useRouter();
|
|
Toast.show({
|
|
type: "info",
|
|
text1: title,
|
|
text2: subtitle,
|
|
position: "top",
|
|
onPress: () => {
|
|
if (data && data.rideId) {
|
|
// router.push(`/(drawer)/dashboard/ride-details?id=${data.rideId}`);
|
|
} else if (data && data.carId) {
|
|
// router.push(`/(drawer)/my-cars/car-details?id=${data.carId}`);
|
|
}
|
|
Toast.hide();
|
|
},
|
|
});
|
|
}
|
|
|
|
export default Toast;
|