2026-04-22 16:54:51 +08:00
|
|
|
|
/**
|
2026-03-24 04:23:13 +08:00
|
|
|
|
* 用户主页 UserScreen
|
2026-04-22 16:54:51 +08:00
|
|
|
|
* 威友 - 查看其他用户资料
|
2026-03-24 04:23:13 +08:00
|
|
|
|
* 使用统一的 UserProfileScreen 组件,mode='other'
|
2026-03-09 21:29:03 +08:00
|
|
|
|
*/
|
|
|
|
|
|
|
2026-03-24 04:23:13 +08:00
|
|
|
|
import React from 'react';
|
2026-03-24 14:21:31 +08:00
|
|
|
|
import { useLocalSearchParams } from 'expo-router';
|
2026-03-24 04:23:13 +08:00
|
|
|
|
import UserProfileScreen from './UserProfileScreen';
|
2026-04-13 04:56:58 +08:00
|
|
|
|
import { useCurrentUser } from '../../stores/auth';
|
2026-03-09 21:29:03 +08:00
|
|
|
|
|
|
|
|
|
|
export const UserScreen: React.FC = () => {
|
2026-03-24 14:21:31 +08:00
|
|
|
|
const { userId: userIdParam } = useLocalSearchParams<{ userId?: string }>();
|
|
|
|
|
|
const userId = userIdParam || '';
|
2026-03-09 21:29:03 +08:00
|
|
|
|
const currentUser = useCurrentUser();
|
2026-03-24 04:23:13 +08:00
|
|
|
|
const isSelfProfile = !!currentUser?.id && currentUser.id === userId;
|
2026-03-09 21:29:03 +08:00
|
|
|
|
|
|
|
|
|
|
return (
|
2026-03-24 04:23:13 +08:00
|
|
|
|
<UserProfileScreen
|
|
|
|
|
|
mode={isSelfProfile ? 'self' : 'other'}
|
|
|
|
|
|
userId={isSelfProfile ? undefined : userId}
|
2026-04-14 02:12:53 +08:00
|
|
|
|
hasHeader
|
2026-03-24 04:23:13 +08:00
|
|
|
|
/>
|
2026-03-09 21:29:03 +08:00
|
|
|
|
);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export default UserScreen;
|