chore: remove IDE config files and improve web platform compatibility
- Remove `.idea/` IntelliJ configuration files from version control - Add web-specific touch handling for swipeable message bubbles and schedule screen - Fix CSS touch-action rules for better web scrolling behavior - Add nestedScrollEnabled to ScrollViews for proper gesture handling - Improve null safety checks in profile screens - Add horizontal ScrollView wrapper for notification filter tags - Add hasHeader prop support for embedded profile screens
This commit is contained in:
@@ -586,10 +586,10 @@ export const EditProfileScreen: React.FC = () => {
|
||||
{/* 用户名和简介 */}
|
||||
<View style={styles.userInfo}>
|
||||
<Text variant="h2" style={styles.nickname}>
|
||||
{nickname || currentUser?.nickname}
|
||||
{nickname || currentUser?.nickname || ''}
|
||||
</Text>
|
||||
<Text variant="caption" color={colors.text.secondary} style={styles.username}>
|
||||
@{currentUser?.username}
|
||||
@{currentUser?.username || ''}
|
||||
</Text>
|
||||
|
||||
{bio ? (
|
||||
@@ -624,7 +624,7 @@ export const EditProfileScreen: React.FC = () => {
|
||||
<View style={styles.metaTag}>
|
||||
<MaterialCommunityIcons name="link-variant" size={12} color={colors.info.main} />
|
||||
<Text variant="caption" color={colors.info.main} style={styles.metaTagText}>
|
||||
{website.replace(/^https?:\/\//, '')}
|
||||
{typeof website === 'string' ? website.replace(/^https?:\/\//, '') : ''}
|
||||
</Text>
|
||||
</View>
|
||||
) : (
|
||||
@@ -638,7 +638,7 @@ export const EditProfileScreen: React.FC = () => {
|
||||
<View style={styles.metaTag}>
|
||||
<MaterialCommunityIcons name="calendar-outline" size={12} color={colors.text.secondary} />
|
||||
<Text variant="caption" color={colors.text.secondary} style={styles.metaTagText}>
|
||||
加入于 {new Date(currentUser?.created_at || Date.now()).getFullYear()}年
|
||||
{`加入于 ${new Date(currentUser?.created_at || Date.now()).getFullYear()}年`}
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@@ -186,7 +186,7 @@ const FollowListScreen: React.FC = () => {
|
||||
</Text>
|
||||
) : null}
|
||||
</View>
|
||||
{!isSelf && (
|
||||
{isCurrentUser && !isSelf && (
|
||||
<Button
|
||||
title={buttonConfig.title}
|
||||
variant={buttonConfig.variant}
|
||||
@@ -230,7 +230,7 @@ const FollowListScreen: React.FC = () => {
|
||||
</Text>
|
||||
) : null}
|
||||
</View>
|
||||
{!isSelf && (
|
||||
{isCurrentUser && !isSelf && (
|
||||
<View style={styles.userCardFooter}>
|
||||
<Button
|
||||
title={buttonConfig.title}
|
||||
@@ -278,7 +278,9 @@ const FollowListScreen: React.FC = () => {
|
||||
</View>
|
||||
</View>
|
||||
<Text variant="caption" color={colors.text.secondary} style={styles.headerSubtitle}>
|
||||
{type === 'following' ? '你已关注的用户' : '关注你的用户'}
|
||||
{type === 'following'
|
||||
? (isCurrentUser ? '你已关注的用户' : 'TA关注的用户')
|
||||
: (isCurrentUser ? '关注你的用户' : 'TA的粉丝')}
|
||||
</Text>
|
||||
</View>
|
||||
);
|
||||
@@ -298,7 +300,7 @@ const FollowListScreen: React.FC = () => {
|
||||
// 宽屏使用网格布局
|
||||
if (isWideScreen && columnCount > 1) {
|
||||
return (
|
||||
<SafeAreaView style={styles.container} edges={['bottom']}>
|
||||
<SafeAreaView style={styles.container} edges={['top', 'bottom']}>
|
||||
<ResponsiveContainer maxWidth={1200}>
|
||||
<FlatList
|
||||
data={users}
|
||||
@@ -333,7 +335,7 @@ const FollowListScreen: React.FC = () => {
|
||||
|
||||
// 移动端使用列表布局
|
||||
return (
|
||||
<SafeAreaView style={styles.container} edges={['bottom']}>
|
||||
<SafeAreaView style={styles.container} edges={['top', 'bottom']}>
|
||||
<FlatList
|
||||
data={users}
|
||||
renderItem={renderUserListItem}
|
||||
|
||||
@@ -21,10 +21,11 @@ import { useUserProfile, ProfileMode, TABS, TAB_ICONS, createSharedProfileStyles
|
||||
|
||||
interface UserProfileScreenProps {
|
||||
mode: ProfileMode;
|
||||
userId?: string; // 仅 other 模式需要
|
||||
userId?: string;
|
||||
hasHeader?: boolean;
|
||||
}
|
||||
|
||||
export const UserProfileScreen: React.FC<UserProfileScreenProps> = ({ mode, userId }) => {
|
||||
export const UserProfileScreen: React.FC<UserProfileScreenProps> = ({ mode, userId, hasHeader = false }) => {
|
||||
const colors = useAppColors();
|
||||
const sharedStyles = useMemo(() => createSharedProfileStyles(colors), [colors]);
|
||||
const { isDesktop, isTablet } = useResponsive();
|
||||
@@ -148,7 +149,7 @@ export const UserProfileScreen: React.FC<UserProfileScreenProps> = ({ mode, user
|
||||
// 未登录/用户不存在状态
|
||||
if (mode === 'self' && !currentUser) {
|
||||
return (
|
||||
<SafeAreaView style={sharedStyles.container} edges={['top', 'bottom']}>
|
||||
<SafeAreaView style={sharedStyles.container} edges={hasHeader ? ['bottom'] : ['top', 'bottom']}>
|
||||
<EmptyState
|
||||
title="未登录"
|
||||
description="请先登录"
|
||||
@@ -170,10 +171,12 @@ export const UserProfileScreen: React.FC<UserProfileScreenProps> = ({ mode, user
|
||||
);
|
||||
}
|
||||
|
||||
const safeAreaEdges = hasHeader ? ['bottom'] : (mode === 'self' ? ['top', 'bottom'] : ['bottom']);
|
||||
|
||||
// 桌面端使用双栏布局
|
||||
if (isDesktop || isTablet) {
|
||||
return (
|
||||
<SafeAreaView style={sharedStyles.container} edges={mode === 'self' ? ['top', 'bottom'] : ['bottom']}>
|
||||
<SafeAreaView style={sharedStyles.container} edges={safeAreaEdges as any}>
|
||||
<ResponsiveContainer maxWidth={1400}>
|
||||
<View style={sharedStyles.desktopContainer}>
|
||||
{/* 左侧:用户信息 */}
|
||||
@@ -211,7 +214,7 @@ export const UserProfileScreen: React.FC<UserProfileScreenProps> = ({ mode, user
|
||||
|
||||
// 移动端使用单栏布局
|
||||
return (
|
||||
<SafeAreaView style={sharedStyles.container} edges={mode === 'self' ? ['top', 'bottom'] : ['bottom']}>
|
||||
<SafeAreaView style={sharedStyles.container} edges={safeAreaEdges as any}>
|
||||
<ScrollView
|
||||
showsVerticalScrollIndicator={false}
|
||||
refreshControl={
|
||||
|
||||
@@ -19,6 +19,7 @@ export const UserScreen: React.FC = () => {
|
||||
<UserProfileScreen
|
||||
mode={isSelfProfile ? 'self' : 'other'}
|
||||
userId={isSelfProfile ? undefined : userId}
|
||||
hasHeader
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user