@@ -13,6 +13,7 @@ import { Text, Button, Toggle } from 'react-native-ui-kitten'
13
13
import { SafeAreaView } from 'react-navigation'
14
14
import { FlatList } from 'react-native-gesture-handler' ;
15
15
import { stylesGen , LIGHT_THEME , DARK_THEME } from './styles'
16
+ import { data } from './dummyData'
16
17
17
18
const WINDOW_WIDTH = Dimensions . get ( 'window' ) . width
18
19
const WINDOW_HEIGHT = Dimensions . get ( 'window' ) . height
@@ -22,16 +23,8 @@ class HomeScreen extends Component {
22
23
constructor ( props ) {
23
24
super ( props )
24
25
25
- // TODO: replace with real data
26
26
this . state = {
27
- data : [ ] ,
28
- images : [
29
- { title : "Breaking Bad" , imageUrl : "https://www.thetvdb.com/banners/_cache/fanart/original/81189-1.jpg" } ,
30
- { title : "Breaking Bad" , imageUrl : "https://www.thetvdb.com/banners/_cache/fanart/original/81189-1.jpg" } ,
31
- { title : "Breaking Bad" , imageUrl : "https://www.thetvdb.com/banners/_cache/fanart/original/81189-1.jpg" } ,
32
- { title : "Breaking Bad" , imageUrl : "https://www.thetvdb.com/banners/_cache/fanart/original/81189-1.jpg" } ,
33
- { title : "Breaking Bad" , imageUrl : "https://www.thetvdb.com/banners/_cache/fanart/original/81189-1.jpg" } ,
34
- ] ,
27
+ data : data ,
35
28
activeImage : null ,
36
29
showCloseIcon : false ,
37
30
isModalVisible : false ,
@@ -109,7 +102,7 @@ class HomeScreen extends Component {
109
102
{ this . _showCloseIcon ( ) }
110
103
</ View >
111
104
< FlatList
112
- data = { this . state . images }
105
+ data = { this . state . data }
113
106
keyExtractor = { this . _keyExtractor }
114
107
renderItem = { this . _renderEpisodeItem }
115
108
showsVerticalScrollIndicator = { false }
@@ -139,7 +132,7 @@ class HomeScreen extends Component {
139
132
y : height
140
133
} )
141
134
142
- const img = this . state . images [ index ]
135
+ const img = this . state . data [ index ]
143
136
this . setState ( {
144
137
activeImage : img
145
138
} , ( ) => {
@@ -264,7 +257,7 @@ class HomeScreen extends Component {
264
257
</ Toggle >
265
258
</ View >
266
259
< FlatList
267
- data = { this . state . images }
260
+ data = { this . state . data }
268
261
renderItem = { this . _renderItem . bind ( this ) }
269
262
keyExtractor = { this . _keyExtractor . bind ( this ) }
270
263
showsVerticalScrollIndicator = { false }
0 commit comments