- 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.
73 lines
1.7 KiB
TypeScript
73 lines
1.7 KiB
TypeScript
import React from 'react';
|
|
import { View, Text, StyleSheet, Image, ImageSourcePropType } from 'react-native';
|
|
import Colors from '@/constants/Colors';
|
|
|
|
type FeatureCardProps = {
|
|
title: string;
|
|
description: string;
|
|
badgeText?: string;
|
|
image?: ImageSourcePropType;
|
|
};
|
|
|
|
export default function FeatureCard({ title, description, badgeText, image }: FeatureCardProps) {
|
|
const colorScheme = 'dark'; // Assuming a dark theme
|
|
|
|
return (
|
|
<View style={[styles.container, { backgroundColor: Colors[colorScheme].secondary }]}>
|
|
{badgeText && (
|
|
<View style={styles.newBadge}>
|
|
<Text style={styles.newText}>{badgeText}</Text>
|
|
</View>
|
|
)}
|
|
<View style={styles.content}>
|
|
<View>
|
|
<Text style={styles.title}>{title}</Text>
|
|
<Text style={styles.description}>{description}</Text>
|
|
</View>
|
|
{image && <Image source={image} style={styles.image} resizeMode="cover" />}
|
|
</View>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
borderRadius: 15,
|
|
padding: 15,
|
|
marginVertical: 10,
|
|
},
|
|
newBadge: {
|
|
backgroundColor: Colors.dark.tint,
|
|
borderRadius: 7,
|
|
paddingVertical: 4,
|
|
paddingHorizontal: 8,
|
|
alignSelf: 'flex-start',
|
|
marginBottom: 10,
|
|
},
|
|
newText: {
|
|
color: Colors.dark.secondary,
|
|
fontWeight: 'bold',
|
|
fontSize: 12,
|
|
},
|
|
content: {
|
|
flexDirection: 'row',
|
|
justifyContent: 'space-between',
|
|
alignItems: 'center',
|
|
},
|
|
title: {
|
|
fontSize: 18,
|
|
fontWeight: 'bold',
|
|
color: Colors.dark.text,
|
|
},
|
|
description: {
|
|
fontSize: 14,
|
|
color: Colors.dark.textSecondary,
|
|
marginTop: 5,
|
|
},
|
|
image: {
|
|
width: 100,
|
|
height: 100,
|
|
borderRadius: 50,
|
|
}
|
|
});
|