From f796f832a8ac7983bee7873e0a4f09c746a41382 Mon Sep 17 00:00:00 2001 From: Nurmuhammet Allanov Date: Wed, 20 Aug 2025 18:43:05 +0500 Subject: [PATCH] Refactor ServicesScreen to use a dynamic services array and improve layout - Introduced a services array to dynamically render service cards with localized titles and icons. - Updated layout styles for a grid display of service cards, enhancing visual organization. - Added new localization keys for services in English, Russian, and Turkmen. --- app/(tabs)/services.tsx | 47 ++++++++++++++++++++++++++------------ components/ServiceCard.tsx | 4 ++-- locales/en.json | 9 +++++--- locales/ru.json | 9 +++++--- locales/tk.json | 10 ++++---- 5 files changed, 52 insertions(+), 27 deletions(-) diff --git a/app/(tabs)/services.tsx b/app/(tabs)/services.tsx index 9c59ec2..2d2d14d 100644 --- a/app/(tabs)/services.tsx +++ b/app/(tabs)/services.tsx @@ -1,4 +1,4 @@ -import { StyleSheet, SafeAreaView, View, TouchableOpacity } from 'react-native'; +import { StyleSheet, SafeAreaView, View, TouchableOpacity, Dimensions } from 'react-native'; import { Text } from '@/components/Themed'; import i18n from '@/i18n'; import { FontAwesome5 } from '@expo/vector-icons'; @@ -9,18 +9,36 @@ import CurrencyConverterModal from '@/components/CurrencyConverterModal'; export default function ServicesScreen() { const [modalVisible, setModalVisible] = useState(false); + const services = [ + { + title: 'currencyConverter', + icon: , + onPress: () => setModalVisible(true), + }, + { + title: 'hotelCard', + icon: , + }, + { + title: 'lostKey', + icon: , + }, + { + title: 'translator', + icon: , + }, + ]; + return ( {i18n.t('services')} - - setModalVisible(true)}> - } /> - - - } /> - } /> - } /> + + {services.map((service, index) => ( + + + + ))}