Files
umra-app/app/(tabs)/services.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

56 lines
1.3 KiB
TypeScript

import { StyleSheet, SafeAreaView, FlatList } from 'react-native';
import { Text } from '@/components/Themed';
import i18n from '@/i18n';
import { FontAwesome5 } from '@expo/vector-icons';
import ServiceCard from '@/components/ServiceCard';
const services = [
{
key: 'sarToTmt',
icon: <FontAwesome5 name="exchange-alt" size={24} color="#D4AF37" />,
},
{
key: 'hotelBusinessCard',
icon: <FontAwesome5 name="vcard" size={24} color="#D4AF37" />,
},
{
key: 'masterkeyBox',
icon: <FontAwesome5 name="key" size={24} color="#D4AF37" />,
},
{
key: 'translator',
icon: <FontAwesome5 name="language" size={24} color="#D4AF37" />,
},
];
export default function ServicesScreen() {
return (
<SafeAreaView style={styles.container}>
<Text style={styles.title}>{i18n.t('services')}</Text>
<FlatList
data={services}
renderItem={({ item }) => <ServiceCard title={i18n.t(item.key)} icon={item.icon} />}
keyExtractor={(item) => item.key}
numColumns={2}
columnWrapperStyle={styles.row}
/>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
paddingHorizontal: 15,
},
title: {
fontSize: 22,
fontWeight: 'bold',
marginVertical: 15,
},
row: {
flex: 1,
justifyContent: 'space-around',
},
});