- 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.
56 lines
1.3 KiB
TypeScript
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',
|
|
},
|
|
});
|