- Updated App entry point to utilize Expo Router, simplifying the navigation setup. - Removed legacy navigation components and services to streamline the codebase. - Adjusted package.json to reflect the new entry point and updated dependencies for compatibility. - Enhanced overall application structure by consolidating navigation logic and improving maintainability.
27 lines
775 B
TypeScript
27 lines
775 B
TypeScript
/**
|
||
* 用户主页 UserScreen
|
||
* 胡萝卜BBS - 查看其他用户资料
|
||
* 使用统一的 UserProfileScreen 组件,mode='other'
|
||
*/
|
||
|
||
import React from 'react';
|
||
import { useLocalSearchParams } from 'expo-router';
|
||
import UserProfileScreen from './UserProfileScreen';
|
||
import { useCurrentUser } from '../../stores/authStore';
|
||
|
||
export const UserScreen: React.FC = () => {
|
||
const { userId: userIdParam } = useLocalSearchParams<{ userId?: string }>();
|
||
const userId = userIdParam || '';
|
||
const currentUser = useCurrentUser();
|
||
const isSelfProfile = !!currentUser?.id && currentUser.id === userId;
|
||
|
||
return (
|
||
<UserProfileScreen
|
||
mode={isSelfProfile ? 'self' : 'other'}
|
||
userId={isSelfProfile ? undefined : userId}
|
||
/>
|
||
);
|
||
};
|
||
|
||
export default UserScreen;
|