11import React from 'react' ;
2- import { View , Text } from 'react-native'
2+ import { View , Text , Linking } from 'react-native'
33import { Card } from 'react-native-elements'
44import { IGithubRepoItem } from './Home' ;
55import { NavigationStackProp } from 'react-navigation-stack' ;
@@ -8,32 +8,37 @@ const DetailCard = (props: {navigation: NavigationStackProp<{item: IGithubRepoIt
88 const repo = props . navigation . getParam ( 'item' ) ;
99 return (
1010 < Card titleStyle = { { fontSize : 24 } } title = { repo . name } image = { { uri : repo . owner . avatar_url } } >
11- < View >
11+ < >
1212 { repo . description ? (
13- < View >
13+ < >
1414 < Text style = { { fontSize : 18 , fontWeight : 'bold' } } > Description: </ Text >
1515 < Text style = { { fontSize : 16 } } > { repo . description } </ Text >
16- </ View >
16+ </ >
1717 ) : null }
1818 { repo . stargazers_count ? (
19- < View >
19+ < >
2020 < Text style = { { fontSize : 18 , fontWeight : 'bold' } } > Stars: </ Text >
2121 < Text style = { { fontSize : 16 } } > { repo . stargazers_count } </ Text >
22- </ View >
22+ </ >
2323 ) : null }
2424 { repo . language ? (
25- < View >
25+ < >
2626 < Text style = { { fontSize : 18 , fontWeight : 'bold' } } > Language: </ Text >
2727 < Text style = { { fontSize : 16 } } > { repo . language } </ Text >
28- </ View >
28+ </ >
2929 ) : null }
3030 { repo . owner . login ? (
31- < View >
31+ < >
3232 < Text style = { { fontSize : 18 , fontWeight : 'bold' } } > Owner: </ Text >
3333 < Text style = { { fontSize : 16 } } > { repo . owner . login } </ Text >
34- </ View >
34+ </ >
3535 ) : null }
36- </ View >
36+ < Text style = { { fontSize : 18 , fontWeight : 'bold' } } > Link To Repo: </ Text >
37+ < Text style = { { color : 'blue' , fontSize : 16 } }
38+ onPress = { ( ) => Linking . openURL ( repo . html_url ) } >
39+ { repo . html_url }
40+ </ Text >
41+ </ >
3742 </ Card >
3843 )
3944}
0 commit comments