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, ScrollView, I18nManager, Modal, Pressable } from 'react-native';
|
||||
import { StyleSheet, ScrollView, I18nManager, Modal, Pressable } from 'react-native';
|
||||
import { Text, View } from '@/components/Themed';
|
||||
import FeatureCard from '@/components/FeatureCard';
|
||||
import PrayerTimeCard from '@/components/PrayerTimeCard';
|
||||
@@ -8,10 +8,12 @@ import * as Updates from 'expo-updates';
|
||||
import AsyncStorage from '@react-native-async-storage/async-storage';
|
||||
import Colors from '@/constants/Colors';
|
||||
import { useState } from 'react';
|
||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||
|
||||
|
||||
export default function HomeScreen() {
|
||||
const [modalVisible, setModalVisible] = useState(false);
|
||||
const insets = useSafeAreaInsets();
|
||||
|
||||
const changeLanguage = async (lang: 'en' | 'tk' | 'ru') => {
|
||||
if (!lang) return;
|
||||
@@ -38,7 +40,7 @@ export default function HomeScreen() {
|
||||
];
|
||||
|
||||
return (
|
||||
<SafeAreaView style={styles.container}>
|
||||
<View style={[styles.container, { paddingTop: insets.top }]}>
|
||||
|
||||
<View style={styles.header}>
|
||||
<Text style={styles.title}>{i18n.t('home')}</Text>
|
||||
@@ -81,7 +83,7 @@ export default function HomeScreen() {
|
||||
{/* <ServicesGrid services={services} /> */}
|
||||
</View>
|
||||
</ScrollView>
|
||||
</SafeAreaView>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user