Update app.json to change splash screen background color to white; refactor MainNavigator and screens to utilize dynamic padding with useSafeAreaInsets, enhancing layout consistency across Home, Menu, and Profile screens.
This commit is contained in:
4
app.json
4
app.json
@@ -10,7 +10,7 @@
|
|||||||
"splash": {
|
"splash": {
|
||||||
"image": "./assets/splash-icon.png",
|
"image": "./assets/splash-icon.png",
|
||||||
"resizeMode": "contain",
|
"resizeMode": "contain",
|
||||||
"backgroundColor": "#17b69b"
|
"backgroundColor": "#ffffff"
|
||||||
},
|
},
|
||||||
"ios": {
|
"ios": {
|
||||||
"supportsTablet": true,
|
"supportsTablet": true,
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
[
|
[
|
||||||
"expo-splash-screen",
|
"expo-splash-screen",
|
||||||
{
|
{
|
||||||
"backgroundColor": "#17b69b",
|
"backgroundColor": "#ffffff",
|
||||||
"image": "./assets/splash-icon.png",
|
"image": "./assets/splash-icon.png",
|
||||||
"imageWidth": 200
|
"imageWidth": 200
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
|
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
|
||||||
import { Ionicons } from '@expo/vector-icons';
|
import { Ionicons } from '@expo/vector-icons';
|
||||||
import { COLORS } from '../constants/colors';
|
import { COLORS } from '../constants/colors';
|
||||||
import { View, ActivityIndicator, Platform } from 'react-native';
|
import { View, ActivityIndicator, Platform, OS } from 'react-native';
|
||||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||||
|
|
||||||
import HomeScreen from '../screens/Main/HomeScreen';
|
import HomeScreen from '../screens/Main/HomeScreen';
|
||||||
@@ -37,9 +37,9 @@ const MainNavigator = () => {
|
|||||||
backgroundColor: COLORS.white,
|
backgroundColor: COLORS.white,
|
||||||
borderTopWidth: 1,
|
borderTopWidth: 1,
|
||||||
borderTopColor: COLORS.gray[200],
|
borderTopColor: COLORS.gray[200],
|
||||||
paddingBottom: Math.max(insets.bottom, Platform.OS === 'android' ? 16 : 8),
|
paddingBottom: (insets.bottom || 16),
|
||||||
paddingTop: 8,
|
paddingTop: 8,
|
||||||
height: 82 + Math.max(insets.bottom, Platform.OS === 'android' ? 16 : 8),
|
height: Platform.OS === 'ios' ? 100 : (82 + (insets.bottom || 16)),
|
||||||
elevation: 8,
|
elevation: 8,
|
||||||
shadowColor: COLORS.gray[900],
|
shadowColor: COLORS.gray[900],
|
||||||
shadowOffset: {
|
shadowOffset: {
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ const HomeScreen = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={[styles.container, { paddingTop: insets.top }]}>
|
<View style={styles.container}>
|
||||||
<StatusBar style="dark" />
|
<StatusBar style="dark" />
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
@@ -260,7 +260,7 @@ const HomeScreen = () => {
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<View style={styles.header}>
|
<View style={[styles.header, { paddingTop: insets.top + 16 }]}>
|
||||||
<View>
|
<View>
|
||||||
<Text style={styles.greeting}>Salam,</Text>
|
<Text style={styles.greeting}>Salam,</Text>
|
||||||
<Text style={styles.userName}>{user?.name || 'Ulanyjy'}</Text>
|
<Text style={styles.userName}>{user?.name || 'Ulanyjy'}</Text>
|
||||||
@@ -338,7 +338,6 @@ const styles = StyleSheet.create({
|
|||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
paddingHorizontal: 24,
|
paddingHorizontal: 24,
|
||||||
paddingTop: 16,
|
|
||||||
paddingBottom: 24,
|
paddingBottom: 24,
|
||||||
backgroundColor: COLORS.white,
|
backgroundColor: COLORS.white,
|
||||||
marginBottom: 16,
|
marginBottom: 16,
|
||||||
|
|||||||
@@ -67,10 +67,10 @@ const MenuScreen = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={[styles.container, { paddingTop: insets.top }]}>
|
<View style={styles.container}>
|
||||||
<StatusBar style="dark" />
|
<StatusBar style="dark" />
|
||||||
|
|
||||||
<View style={styles.header}>
|
<View style={[styles.header, { paddingTop: insets.top + 16 }]}>
|
||||||
<Text style={styles.headerTitle}>Hyzmatlar</Text>
|
<Text style={styles.headerTitle}>Hyzmatlar</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
@@ -117,7 +117,6 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
paddingHorizontal: 24,
|
paddingHorizontal: 24,
|
||||||
paddingTop: 16,
|
|
||||||
paddingBottom: 24,
|
paddingBottom: 24,
|
||||||
borderBottomWidth: 1,
|
borderBottomWidth: 1,
|
||||||
borderBottomColor: COLORS.gray[200],
|
borderBottomColor: COLORS.gray[200],
|
||||||
|
|||||||
@@ -280,10 +280,10 @@ const ProfileScreen = () => {
|
|||||||
const currentUser = profileData || user;
|
const currentUser = profileData || user;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={[styles.container, { paddingTop: insets.top }]}>
|
<View style={styles.container}>
|
||||||
<StatusBar style="dark" />
|
<StatusBar style="dark" />
|
||||||
|
|
||||||
<View style={styles.header}>
|
<View style={[styles.header, { paddingTop: insets.top + 16 }]}>
|
||||||
<Text style={styles.headerTitle}>Profil</Text>
|
<Text style={styles.headerTitle}>Profil</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
@@ -401,7 +401,6 @@ const styles = StyleSheet.create({
|
|||||||
header: {
|
header: {
|
||||||
backgroundColor: COLORS.white,
|
backgroundColor: COLORS.white,
|
||||||
paddingHorizontal: 24,
|
paddingHorizontal: 24,
|
||||||
paddingTop: 16,
|
|
||||||
paddingBottom: 24,
|
paddingBottom: 24,
|
||||||
borderBottomWidth: 1,
|
borderBottomWidth: 1,
|
||||||
borderBottomColor: COLORS.gray[200],
|
borderBottomColor: COLORS.gray[200],
|
||||||
|
|||||||
Reference in New Issue
Block a user