chahinebrini 14452b2a46 refactor(native): Pressable → TouchableOpacity sweep (style-fn swallows Android styles)
Alle <Pressable style={({pressed}) => ({...})}> ersetzt — style-Funktion
droppt auf Android (New Arch) intermittierend width/height, führt zu 0×0
unsichtbaren Elementen. TouchableOpacity mit activeOpacity ist stabil.

Außerdem übrige Pressables (plain style) aus components/ und app/
migriert sowie zwei überschüssige </View>-Tags in chat.tsx + RoomCard.tsx
entfernt die TS-Fehler verursacht haben.

64 Dateien, typecheck sauber.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 15:43:10 +02:00

100 lines
2.3 KiB
TypeScript

import { View, Text, TouchableOpacity } from 'react-native';
import { useColors } from '../../lib/theme';
type Props = {
postsCount: number;
followersCount: number;
approvedDomainsCount: number;
onPostsPress?: () => void;
onFollowersPress?: () => void;
onApprovedDomainsPress?: () => void;
};
type CardProps = {
value: string;
label: string;
onPress?: () => void;
};
function StatPill({ value, label, onPress }: CardProps) {
const colors = useColors();
return (
<TouchableOpacity
onPress={onPress}
activeOpacity={0.6}
>
<View
style={{
backgroundColor: colors.surface,
borderWidth: 1,
borderColor: colors.border,
borderRadius: 999,
paddingVertical: 10,
paddingHorizontal: 18,
alignItems: 'center',
minWidth: 88,
shadowColor: '#000',
shadowOffset: { width: 0, height: 1 },
shadowOpacity: 0.05,
shadowRadius: 2,
elevation: 1,
}}
>
<Text
style={{
fontSize: 18,
color: colors.text,
fontFamily: 'Nunito_700Bold',
letterSpacing: -0.2,
}}
>
{value}
</Text>
<Text
style={{
marginTop: 1,
fontSize: 10,
color: colors.textMuted,
fontFamily: 'Nunito_600SemiBold',
textAlign: 'center',
}}
numberOfLines={1}
>
{label}
</Text>
</View>
</TouchableOpacity>
);
}
export function StatsBar({
postsCount,
followersCount,
approvedDomainsCount,
onPostsPress,
onFollowersPress,
onApprovedDomainsPress,
}: Props) {
return (
<View style={{ paddingHorizontal: 16 }}>
<View
style={{
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
gap: 10,
flexWrap: 'wrap',
}}
>
<StatPill value={String(postsCount)} label="Posts" onPress={onPostsPress} />
<StatPill value={String(followersCount)} label="Follower" onPress={onFollowersPress} />
<StatPill
value={String(approvedDomainsCount)}
label="Domains"
onPress={onApprovedDomainsPress}
/>
</View>
</View>
);
}