fix: bug
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user