This commit is contained in:
imeepos
2025-11-12 13:19:06 +08:00
parent a7d922b535
commit 3ebcc24e9b
14 changed files with 483 additions and 265 deletions

View File

@@ -20,6 +20,8 @@ export type CommunityItem = {
image: string;
chip: string;
actionLabel: string;
width?: number;
height?: number;
};
type CommunityGridProps = {
@@ -83,10 +85,16 @@ type CommunityCardProps = {
};
const CommunityCard = memo(({ item, style, onPressCard, onPressAction }: CommunityCardProps) => {
const aspectRatio = item.width && item.height ? item.width / item.height : 9 / 16;
return (
<Pressable onPress={() => onPressCard?.(item)} style={[styles.card, style]}>
<View style={styles.imageWrapper}>
<ExpoImage source={{ uri: item.image }} style={styles.cardImage} contentFit="cover" />
<ExpoImage
source={{ uri: item.image }}
style={[styles.cardImage, { aspectRatio }]}
contentFit="cover"
/>
<LinearGradient
colors={['rgba(12, 14, 20, 0)', 'rgba(12, 14, 20, 0.85)']}
style={styles.imageGradient}
@@ -169,7 +177,6 @@ const styles = StyleSheet.create({
},
cardImage: {
width: '100%',
aspectRatio: 9 / 16,
height: undefined,
},
imageGradient: {