feat(ui): redesign system message item with card-style layout and add title validation
- Refactor SystemMessageItem with modern card design, gradient colors, and improved visual hierarchy - Add unread indicator, status badges, and enhanced avatar badges for message types - Update CreatePostScreen to require title input and improve placeholder text - Add Android back button handling for notification screens in embedded mode - Replace manual shadow styles with theme shadow utilities across message screens
This commit is contained in:
@@ -22,6 +22,7 @@ import {
|
||||
Animated,
|
||||
TextInput,
|
||||
Keyboard,
|
||||
BackHandler,
|
||||
} from 'react-native';
|
||||
import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||
import { useNavigation, useIsFocused } from '@react-navigation/native';
|
||||
@@ -283,6 +284,19 @@ export const MessageListScreen: React.FC = () => {
|
||||
}
|
||||
}, [isFocused]);
|
||||
|
||||
// 处理 Android 物理返回键 - 当显示通知页面时,返回键关闭通知页面
|
||||
useEffect(() => {
|
||||
const backHandler = BackHandler.addEventListener('hardwareBackPress', () => {
|
||||
if (showNotifications) {
|
||||
setShowNotifications(false);
|
||||
return true; // 阻止默认行为
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
return () => backHandler.remove();
|
||||
}, [showNotifications]);
|
||||
|
||||
// 下拉刷新
|
||||
const onRefresh = useCallback(async () => {
|
||||
setRefreshing(true);
|
||||
|
||||
Reference in New Issue
Block a user