Files
umra-app/app/(tabs)/_layout.tsx
Nurmuhammet Allanov a8ec876cc0 Add 'Programs' tab to TabLayout and refactor ServicesScreen to use FlatList for service cards
- Introduced a new 'Programs' tab in the TabLayout with localized title and icon.
- Refactored ServicesScreen to replace ScrollView with FlatList for improved performance and layout, displaying service cards with icons.
- Updated localization files to include new keys for services and programs.
2025-08-20 10:31:51 +05:00

55 lines
1.5 KiB
TypeScript

import FontAwesome from '@expo/vector-icons/FontAwesome';
import { Tabs } from 'expo-router';
import { useColorScheme } from 'react-native';
import Colors from '@/constants/Colors';
import i18n from '@/i18n';
/**
* You can explore the built-in icon families and icons on the web at https://icons.expo.fyi/
*/
function TabBarIcon(props: {
name: React.ComponentProps<typeof FontAwesome>['name'];
color: string;
}) {
return <FontAwesome size={28} style={{ marginBottom: -3 }} {...props} />;
}
export default function TabLayout() {
const colorScheme = 'dark'; // Force dark mode
return (
<Tabs
screenOptions={{
tabBarActiveTintColor: Colors[colorScheme].tint,
tabBarStyle: {
backgroundColor: Colors[colorScheme].secondary,
borderTopColor: Colors[colorScheme].secondary,
},
headerShown: false, // Hide header globally for tabs
}}>
<Tabs.Screen
name="home"
options={{
title: i18n.t('home'),
tabBarIcon: ({ color }) => <TabBarIcon name="home" color={color} />,
}}
/>
<Tabs.Screen
name="services"
options={{
title: i18n.t('services'),
tabBarIcon: ({ color }) => <TabBarIcon name="th-large" color={color} />,
}}
/>
<Tabs.Screen
name="programs"
options={{
title: i18n.t('programs'),
tabBarIcon: ({ color }) => <TabBarIcon name="briefcase" color={color} />,
}}
/>
</Tabs>
);
}