-
Notifications
You must be signed in to change notification settings - Fork 54
/
SeriesEpisodePicker.js
executable file
·58 lines (49 loc) · 1.33 KB
/
SeriesEpisodePicker.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import React, { Component } from 'react';
import { StyleSheet, ScrollView } from 'react-native';
import { ListItem } from 'react-native-elements';
const styles = StyleSheet.create({
listContainer: {
flex: 1,
},
});
class SeriesEpisodePickerScreen extends Component {
render() {
const { url, username, password, serie } = this.props.navigation.state.params;
const listItems = [];
serie.episodes.forEach((s) => {
let serieItem = null;
if (!s.title.length) {
return;
}
serieItem = s.info.movie_image.startsWith('http') || s.info.movie_image.startsWith('https') ? (
<ListItem
key={s.id}
avatar={{ uri: s.info.movie_image }}
containerStyle={{ borderBottomWidth: 0 }}
onPress={() => this.props.navigation.navigate('SeriesEpisodeViewer', {
url, username, password, s,
})}
roundAvatar
title={s.title} />
) : (
<ListItem
key={s.id}
containerStyle={{ borderBottomWidth: 0 }}
onPress={() => this.props.navigation.navigate('SeriesEpisodeViewer', {
url, username, password, s,
})}
roundAvatar
title={s.title} />
);
listItems.push(serieItem);
});
return (
<ScrollView contentContainerStyle={styles.listContainer}>
<ScrollView>
{listItems}
</ScrollView>
</ScrollView>
);
}
}
export default SeriesEpisodePickerScreen;