
카드를 누르면 디테일 페이지가 안열려요, 누르면 뿌옇게 되는것까지는 작동하는데
Hover 효과 나는거 빼곤 없어요... 그보다 카드의 상세페이지로 넘어가야하는데 그러지 않아요..
import React from "react"
import {View,Text,Image,StyleSheet} from "react-native";
import { TouchableOpacity } from "react-native-gesture-handler";
//비구조 할당 방식으로 넘긴 속성 데이터를 꺼내 사용함
export default function Card({content,navigation}) {
return (
<TouchableOpacity style={styles.card} onpress={()=>
{navigation.navigate(' DetailPage ')}}>
<Image style={styles.cardImage} source={
{uri:content.image}}/>
<View style={styles.cardText}>
<Text style={styles.cardTitle} numberOfLines={1}>{content.title}</Text>
<Text style={styles.cardDesc} numberOfLines={3}>{content.desc}</Text>
<Text style={styles.cardDate}>{content.date}</Text>
</View>
</TouchableOpacity>)
}
const styles = StyleSheet.create({
card:{
flex:1,
//컨텐츠들을 가로로 나열
//세로로 나열은 column <- 디폴트 값임
flexDirection:"row",
margin:10,
borderBottomWidth:0.5,
borderBottomColor:"#eee",
paddingBottom:10
},
cardImage: {
flex:1,
width:100,
height:100,
borderRadius:10,
},
cardText: {
flex:2,
flexDirection:"column",
marginLeft:10,
},
cardTitle: {
fontSize:20,
fontWeight:"700"
},
cardDesc: {
fontSize:15
},
cardDate: {
fontSize:10,
color:"#A6A6A6",
}
})
