import React from 'react'; import { TouchableOpacity, StyleSheet, Platform } from 'react-native'; import { createNativeStackNavigator } from '@react-navigation/native-stack'; import { DrawerNavigationProp } from '@react-navigation/drawer'; import Icon from 'react-native-vector-icons/Ionicons'; import { CustomersScreen, CustomerDetailsScreen, AddCustomerScreen } from '@features'; import { route, RouteParams } from '@utils'; import { useTheme } from '@theme'; import { getStyles } from './customersStack.styles'; export type CustomersStackParamList = Pick< RouteParams, 'customersList' | 'customerDetails' | 'addCustomer' >; const Stack = createNativeStackNavigator(); export const CustomersStack = () => { const { theme: colors } = useTheme(); const styles = getStyles(colors); return ( ({ headerTitle: 'Customers', headerLeft: () => ( { const parentNav = navigation.getParent>(); if (parentNav) { parentNav.openDrawer(); } else { (navigation as any).openDrawer?.(); } }}> ), headerRight: () => ( navigation.navigate(route.addCustomer)} style={{ marginRight: 8, backgroundColor: colors.icon, width: 32, height: 32, borderRadius: 16, justifyContent: 'center', alignItems: 'center', shadowColor: colors.icon, shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.25, shadowRadius: 3.84, elevation: 3, }} activeOpacity={0.7} hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}> ), })} /> ); };