@@ -8,10 +8,12 @@ import {
8
8
ScrollView ,
9
9
ActivityIndicator ,
10
10
Dimensions ,
11
+ StatusBar ,
11
12
} from "react-native" ;
12
13
import { client } from "../lib/contentful" ;
13
14
import { formatedDate } from "../lib/date" ;
14
15
import Categories from "../components/Categories" ;
16
+ import StatusBarHead from "../components/StatusBarHead" ;
15
17
16
18
const HomeScreen = ( { navigation } : any ) => {
17
19
const [ blog , setBlog ] = useState < any | ( ( ) => any ) > ( [ ] ) ;
@@ -30,42 +32,51 @@ const HomeScreen = ({ navigation }: any) => {
30
32
const deviceWidth = Dimensions . get ( "window" ) . width ;
31
33
return (
32
34
< View >
35
+ < StatusBarHead />
33
36
< Categories navigation = { navigation } />
34
- < ScrollView >
37
+ < ScrollView
38
+ contentContainerStyle = { styles . scrollContainer }
39
+ showsVerticalScrollIndicator = { false }
40
+ >
35
41
< View style = { styles . container } >
36
42
{ blog ? (
37
43
blog . map ( ( item : any ) => (
38
- < TouchableOpacity
39
- key = { item . sys . id }
40
- onPress = { ( ) => navigation . navigate ( "Blog" , { id : item . sys . id } ) }
41
- >
42
- < View style = { styles . card } >
43
- < View style = { styles . list } >
44
- < View style = { styles . separator } >
45
- < Text style = { styles . title } > { item . fields . title } </ Text >
46
- < Image
47
- style = { styles . cardImage }
48
- source = { {
49
- uri : `https://${ item . fields . coverImage . fields . file . url } ` ,
50
- } }
51
- />
44
+ < View key = { item . sys . id } >
45
+ < TouchableOpacity
46
+ key = { item . sys . id }
47
+ onPress = { ( ) =>
48
+ navigation . navigate ( "Blog" , { id : item . sys . id } )
49
+ }
50
+ >
51
+ < View style = { styles . card } >
52
+ < View style = { styles . list } >
53
+ < View style = { styles . separator } >
54
+ < Text style = { styles . title } > { item . fields . title } </ Text >
55
+ < Image
56
+ style = { styles . cardImage }
57
+ source = { {
58
+ uri : `https://${ item . fields . coverImage . fields . file . url } ` ,
59
+ } }
60
+ />
52
61
53
- < View style = { styles . cardHeader } >
54
- < View >
55
- < Text style = { styles . description } >
56
- { item . fields . description }
57
- </ Text >
58
- < View style = { styles . timeContainer } >
59
- < Text style = { styles . time } >
60
- { formatedDate ( item . fields . publishedOn ) }
62
+ < View style = { styles . cardHeader } >
63
+ < View >
64
+ < Text style = { styles . description } >
65
+ { item . fields . description }
61
66
</ Text >
67
+ < View style = { styles . timeContainer } >
68
+ < Text style = { styles . time } >
69
+ { formatedDate ( item . fields . publishedOn ) }
70
+ </ Text >
71
+ </ View >
62
72
</ View >
63
73
</ View >
64
74
</ View >
65
75
</ View >
66
76
</ View >
67
- </ View >
68
- </ TouchableOpacity >
77
+ </ TouchableOpacity >
78
+ { /* <View style={styles.separator}></View> */ }
79
+ </ View >
69
80
) )
70
81
) : (
71
82
< ActivityIndicator
@@ -86,10 +97,14 @@ const HomeScreen = ({ navigation }: any) => {
86
97
} ;
87
98
88
99
const styles = StyleSheet . create ( {
100
+ scrollContainer : {
101
+ marginVertical : 1 ,
102
+ } ,
89
103
container : {
90
- flex : 1 ,
91
104
backgroundColor : "#fff" ,
105
+ paddingBottom : 45 ,
92
106
} ,
107
+
93
108
list : {
94
109
paddingHorizontal : 17 ,
95
110
backgroundColor : "#ffffff" ,
@@ -108,8 +123,6 @@ const styles = StyleSheet.create({
108
123
shadowOpacity : 0.5 ,
109
124
shadowRadius : 4 ,
110
125
marginVertical : 8 ,
111
- // backgroundColor: "",
112
- // borderRadius: 12,
113
126
} ,
114
127
cardHeader : {
115
128
paddingVertical : 17 ,
0 commit comments