Files
frontend/src/screens/profile/UserScreen.tsx

27 lines
775 B
TypeScript
Raw Normal View History

/**
* 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;