fix: 统一修复所有屏幕的安全区域问题
- 有 header 的屏幕使用 edges={['bottom']}(React Navigation 自动处理顶部)
- 没有 header 的屏幕使用 edges={['top', 'bottom']}(需要自己处理顶部)
- 修复了以下屏幕:
- HomeScreen: edges={['bottom']} → ['top', 'bottom']
- MessageListScreen: edges={['top']} → ['top', 'bottom']
- ScheduleScreen: edges={['top']} → ['top', 'bottom']
- ProfileScreen: edges={['top', 'bottom']} ✓ 已正确
- PostDetailScreen: 空状态添加 edges={['bottom']}
- UserScreen: 空状态添加 edges={['bottom']}
- NotificationsScreen: edges={[]} → ['bottom']
- SearchScreen: edges={['left', 'right']} → ['bottom']
- BlockedUsersScreen: 加载状态添加 edges={['bottom']}
- GroupInfoScreen: edges={['bottom']} ✓ 已正确
- PrivateChatInfoScreen: 加载状态添加 edges={['bottom']}
This commit is contained in:
@@ -643,7 +643,7 @@ export const HomeScreen: React.FC = () => {
|
|||||||
// 搜索页面内嵌模式
|
// 搜索页面内嵌模式
|
||||||
if (showSearch) {
|
if (showSearch) {
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={styles.container} edges={['top']}>
|
<SafeAreaView style={styles.container} edges={['top', 'bottom']}>
|
||||||
<StatusBar barStyle="dark-content" backgroundColor={colors.background.paper} />
|
<StatusBar barStyle="dark-content" backgroundColor={colors.background.paper} />
|
||||||
<SearchScreen
|
<SearchScreen
|
||||||
onBack={() => setShowSearch(false)}
|
onBack={() => setShowSearch(false)}
|
||||||
@@ -654,7 +654,7 @@ export const HomeScreen: React.FC = () => {
|
|||||||
|
|
||||||
// 正常首页内容
|
// 正常首页内容
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={styles.container} edges={['top']}>
|
<SafeAreaView style={styles.container} edges={['top', 'bottom']}>
|
||||||
<StatusBar barStyle="dark-content" backgroundColor={colors.background.paper} />
|
<StatusBar barStyle="dark-content" backgroundColor={colors.background.paper} />
|
||||||
|
|
||||||
{/* 顶部Header */}
|
{/* 顶部Header */}
|
||||||
|
|||||||
@@ -1406,7 +1406,7 @@ export const PostDetailScreen: React.FC = () => {
|
|||||||
|
|
||||||
if (!post) {
|
if (!post) {
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={styles.container}>
|
<SafeAreaView style={styles.container} edges={['bottom']}>
|
||||||
<EmptyState
|
<EmptyState
|
||||||
title="帖子不存在"
|
title="帖子不存在"
|
||||||
description="该帖子可能已被删除"
|
description="该帖子可能已被删除"
|
||||||
|
|||||||
@@ -407,7 +407,7 @@ export const SearchScreen: React.FC<SearchScreenProps> = ({ onBack, navigation:
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={styles.container} edges={['left', 'right']}>
|
<SafeAreaView style={styles.container} edges={['bottom']}>
|
||||||
{/* 搜索输入框 */}
|
{/* 搜索输入框 */}
|
||||||
<View
|
<View
|
||||||
style={[
|
style={[
|
||||||
|
|||||||
@@ -534,7 +534,7 @@ const GroupInfoScreen: React.FC = () => {
|
|||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={styles.container}>
|
<SafeAreaView style={styles.container} edges={['bottom']}>
|
||||||
<Loading />
|
<Loading />
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
@@ -542,7 +542,7 @@ const GroupInfoScreen: React.FC = () => {
|
|||||||
|
|
||||||
if (!group) {
|
if (!group) {
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={styles.container}>
|
<SafeAreaView style={styles.container} edges={['bottom']}>
|
||||||
<View style={styles.errorContainer}>
|
<View style={styles.errorContainer}>
|
||||||
<Text variant="body" color={colors.text.secondary}>
|
<Text variant="body" color={colors.text.secondary}>
|
||||||
群组信息不存在
|
群组信息不存在
|
||||||
|
|||||||
@@ -931,7 +931,7 @@ export const MessageListScreen: React.FC = () => {
|
|||||||
// 桌面端双栏布局
|
// 桌面端双栏布局
|
||||||
if (isWideScreen && !isSearchMode) {
|
if (isWideScreen && !isSearchMode) {
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={styles.container} edges={['top']}>
|
<SafeAreaView style={styles.container} edges={['top', 'bottom']}>
|
||||||
<View style={styles.desktopContainer}>
|
<View style={styles.desktopContainer}>
|
||||||
{/* 左侧会话列表 */}
|
{/* 左侧会话列表 */}
|
||||||
<View style={[styles.sidebar, { width: sidebarWidth }]}>
|
<View style={[styles.sidebar, { width: sidebarWidth }]}>
|
||||||
@@ -966,7 +966,7 @@ export const MessageListScreen: React.FC = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={styles.container} edges={['top']}>
|
<SafeAreaView style={styles.container} edges={['top', 'bottom']}>
|
||||||
{showNotifications ? (
|
{showNotifications ? (
|
||||||
// 显示系统通知页面,传入 onBack 回调
|
// 显示系统通知页面,传入 onBack 回调
|
||||||
<NotificationsScreen onBack={() => setShowNotifications(false)} />
|
<NotificationsScreen onBack={() => setShowNotifications(false)} />
|
||||||
|
|||||||
@@ -372,7 +372,7 @@ export const NotificationsScreen: React.FC<{ onBack?: () => void }> = ({ onBack
|
|||||||
// 如果还未hydrated,显示加载占位符,避免竞态条件导致的渲染问题
|
// 如果还未hydrated,显示加载占位符,避免竞态条件导致的渲染问题
|
||||||
if (!isHydrated) {
|
if (!isHydrated) {
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={styles.container} edges={[]}>
|
<SafeAreaView style={styles.container} edges={['bottom']}>
|
||||||
<View style={styles.loadingContainer}>
|
<View style={styles.loadingContainer}>
|
||||||
<ActivityIndicator size="large" color={colors.primary.main} />
|
<ActivityIndicator size="large" color={colors.primary.main} />
|
||||||
</View>
|
</View>
|
||||||
@@ -381,7 +381,7 @@ export const NotificationsScreen: React.FC<{ onBack?: () => void }> = ({ onBack
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={styles.container} edges={[]}>
|
<SafeAreaView style={styles.container} edges={['bottom']}>
|
||||||
{isWideScreen ? (
|
{isWideScreen ? (
|
||||||
<ResponsiveContainer maxWidth={containerMaxWidth}>
|
<ResponsiveContainer maxWidth={containerMaxWidth}>
|
||||||
{/* 头部 - 大屏模式下隐藏返回按钮 */}
|
{/* 头部 - 大屏模式下隐藏返回按钮 */}
|
||||||
|
|||||||
@@ -307,7 +307,7 @@ const PrivateChatInfoScreen: React.FC = () => {
|
|||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={styles.container}>
|
<SafeAreaView style={styles.container} edges={['bottom']}>
|
||||||
<Loading />
|
<Loading />
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ export const BlockedUsersScreen: React.FC = () => {
|
|||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={styles.container}>
|
<SafeAreaView style={styles.container} edges={['bottom']}>
|
||||||
<View style={styles.loadingWrap}>
|
<View style={styles.loadingWrap}>
|
||||||
<ActivityIndicator size="large" color={colors.primary.main} />
|
<ActivityIndicator size="large" color={colors.primary.main} />
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -363,7 +363,7 @@ export const ProfileScreen: React.FC = () => {
|
|||||||
|
|
||||||
if (!currentUser) {
|
if (!currentUser) {
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={styles.container}>
|
<SafeAreaView style={styles.container} edges={['top', 'bottom']}>
|
||||||
<EmptyState
|
<EmptyState
|
||||||
title="未登录"
|
title="未登录"
|
||||||
description="请先登录"
|
description="请先登录"
|
||||||
|
|||||||
@@ -416,7 +416,7 @@ export const UserScreen: React.FC = () => {
|
|||||||
|
|
||||||
if (!user) {
|
if (!user) {
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={styles.container}>
|
<SafeAreaView style={styles.container} edges={['bottom']}>
|
||||||
<EmptyState
|
<EmptyState
|
||||||
title="用户不存在"
|
title="用户不存在"
|
||||||
description="该用户可能已被删除"
|
description="该用户可能已被删除"
|
||||||
|
|||||||
@@ -718,7 +718,7 @@ export const ScheduleScreen: React.FC = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={styles.container} edges={['top']}>
|
<SafeAreaView style={styles.container} edges={['top', 'bottom']}>
|
||||||
<StatusBar barStyle="light-content" backgroundColor={colors.primary.main} />
|
<StatusBar barStyle="light-content" backgroundColor={colors.primary.main} />
|
||||||
|
|
||||||
{/* 周选择器 */}
|
{/* 周选择器 */}
|
||||||
|
|||||||
Reference in New Issue
Block a user