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.
This commit is contained in:
2025-08-20 10:31:51 +05:00
parent ec059535c8
commit a8ec876cc0
8 changed files with 297 additions and 43 deletions

View File

@@ -1,7 +1,6 @@
import React from 'react';
import { View, Text, StyleSheet, Image, ImageSourcePropType } from 'react-native';
import Colors from '@/constants/Colors';
import i18n from '@/i18n';
type FeatureCardProps = {
title: string;

View File

@@ -0,0 +1,46 @@
import React from 'react';
import { View, Text, StyleSheet } from 'react-native';
import Colors from '@/constants/Colors';
type ServiceCardProps = {
title: string;
icon: React.ReactNode;
};
export default function ServiceCard({ title, icon }: ServiceCardProps) {
const colorScheme = 'dark';
return (
<View style={[styles.container, { backgroundColor: Colors[colorScheme].secondary }]}>
<View style={styles.content}>
<View style={styles.iconContainer}>{icon}</View>
<Text style={styles.title}>{title}</Text>
</View>
</View>
);
}
const styles = StyleSheet.create({
container: {
borderRadius: 15,
padding: 15,
marginVertical: 10,
width: '45%',
aspectRatio: 1,
justifyContent: 'center',
alignItems: 'center',
},
content: {
justifyContent: 'center',
alignItems: 'center',
},
iconContainer: {
marginBottom: 10,
},
title: {
fontSize: 16,
fontWeight: 'bold',
color: Colors.dark.text,
textAlign: 'center',
},
});