Add expo-asset dependency and update layout for safe area insets
- Included expo-asset in app.json and package.json for asset management. - Refactored layout components in HomeScreen, TabIndex, Programs, and ServicesScreen to utilize safe area insets for better UI on different devices. - Updated StatusBar style in RootLayoutNav for improved visibility.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { StyleSheet, SafeAreaView, View, TouchableOpacity, Dimensions } from 'react-native';
|
||||
import { StyleSheet, View, TouchableOpacity, Dimensions } from 'react-native';
|
||||
import { Text } from '@/components/Themed';
|
||||
import i18n from '@/i18n';
|
||||
import { FontAwesome5 } from '@expo/vector-icons';
|
||||
@@ -8,12 +8,14 @@ import CurrencyConverterModal from '@/components/CurrencyConverterModal';
|
||||
import HotelBusinessCardModal from '@/components/HotelBusinessCardModal';
|
||||
import LostKeyModal from '@/components/LostKeyModal';
|
||||
import PhrasebookModal from '@/components/PhrasebookModal';
|
||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||
|
||||
export default function ServicesScreen() {
|
||||
const [currencyModalVisible, setCurrencyModalVisible] = useState(false);
|
||||
const [hotelModalVisible, setHotelModalVisible] = useState(false);
|
||||
const [lostKeyModalVisible, setLostKeyModalVisible] = useState(false);
|
||||
const [phrasebookModalVisible, setPhrasebookModalVisible] = useState(false);
|
||||
const insets = useSafeAreaInsets();
|
||||
|
||||
const services = [
|
||||
{
|
||||
@@ -43,7 +45,7 @@ export default function ServicesScreen() {
|
||||
];
|
||||
|
||||
return (
|
||||
<SafeAreaView style={styles.container}>
|
||||
<View style={[styles.container, { paddingTop: insets.top }]}>
|
||||
<Text style={styles.title}>{i18n.t('services')}</Text>
|
||||
|
||||
<View style={styles.grid}>
|
||||
@@ -69,7 +71,7 @@ export default function ServicesScreen() {
|
||||
visible={phrasebookModalVisible}
|
||||
onClose={() => setPhrasebookModalVisible(false)}
|
||||
/>
|
||||
</SafeAreaView>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user