native_convex_CRM/app/navigation/drawerStack.tsx
2026-07-22 13:33:19 +05:30

66 lines
1.8 KiB
TypeScript

import React from 'react';
import { createDrawerNavigator } from '@react-navigation/drawer';
import { TabStack } from './tabStack';
import { CustomDrawerContent } from './customDrawerContent';
import {
CustomersScreen,
ProposalsScreen,
EstimatesScreen,
InvoicesScreen,
ProjectsScreen,
TasksScreen,
TicketsScreen,
} from '@features';
import { route, RouteParams } from '@utils';
import { useTheme } from '@theme';
export type DrawerStackParamList = { home: undefined } & Pick<
RouteParams,
| 'customers'
| 'proposals'
| 'estimates'
| 'invoices'
| 'projects'
| 'tasks'
| 'tickets'
>;
const Drawer = createDrawerNavigator<DrawerStackParamList>();
export const DrawerStack = () => {
const { theme: colors } = useTheme();
return (
<Drawer.Navigator
drawerContent={CustomDrawerContent}
screenOptions={{
swipeEnabled: false,
headerStyle: {
backgroundColor: colors.header,
},
headerTitleStyle: {
fontSize: 17,
fontWeight: '700',
color: colors.text,
letterSpacing: 0.2,
},
headerTitleAlign: 'center',
headerTintColor: colors.text,
headerShadowVisible: false,
}}>
<Drawer.Screen
name="home"
component={TabStack}
options={{ headerShown: false }}
/>
<Drawer.Screen name={route.customers} component={CustomersScreen} />
<Drawer.Screen name={route.proposals} component={ProposalsScreen} />
<Drawer.Screen name={route.estimates} component={EstimatesScreen} />
<Drawer.Screen name={route.invoices} component={InvoicesScreen} />
<Drawer.Screen name={route.projects} component={ProjectsScreen} />
<Drawer.Screen name={route.tasks} component={TasksScreen} />
<Drawer.Screen name={route.tickets} component={TicketsScreen} />
</Drawer.Navigator>
);
};