58 lines
2.2 KiB
TypeScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React from 'react';
import { View, Text } from 'react-native';
import { useNavigation, useRoute, RouteProp } from '@react-navigation/native';
import { StackNavigationProp } from '@react-navigation/stack';
import { getStyles } from './liveTrackingScreen.styles';
import { Header, PrimaryButton } from '@components';
import { useAppTheme } from '@theme';
import { AppStackParamList } from '../../../navigation/appStack';
type LiveTrackingNavProp = StackNavigationProp<AppStackParamList, 'LiveTrackingScreen'>;
type LiveTrackingRouteProp = RouteProp<AppStackParamList, 'LiveTrackingScreen'>;
export const LiveTrackingScreen: React.FC = () => {
const { colors } = useAppTheme();
const styles = getStyles(colors);
const navigation = useNavigation<LiveTrackingNavProp>();
const route = useRoute<LiveTrackingRouteProp>();
const orderId = route.params?.orderId || 'ORD-123456';
return (
<View style={styles.container}>
<Header title="Live Tracking" onBack={() => navigation.goBack()} />
<View style={styles.mapPlaceholder}>
<Text style={styles.mapIcon}>🗺</Text>
<Text style={styles.mapText}>Live Map</Text>
<Text style={styles.mapSubtext}>
Delivery partner location tracking for {orderId}
</Text>
<View style={styles.blinkingBadge}>
<Text style={styles.blinkingText}> Live</Text>
</View>
</View>
<View style={styles.agentSheet}>
<PrimaryButton
title="Simulate Order Delivered"
onPress={() => navigation.navigate('OrderDeliveredScreen', { orderId })}
style={{ marginBottom: 16 }}
/>
<Text style={styles.agentName}>Rahul Sharma</Text>
<Text style={styles.agentRating}> 4.8</Text>
<Text style={styles.agentVehicle}>KA-01-AB-1234 Honda Activa</Text>
<View style={styles.agentActions}>
<PrimaryButton
title="Call"
onPress={() => {}}
style={{ flex: 1, marginRight: 8 }}
/>
<PrimaryButton
title="Message"
onPress={() => {}}
style={{ flex: 1, marginLeft: 8 }}
/>
</View>
</View>
</View>
);
};