11import * as React from "react" ;
2- import { View , Text , TouchableOpacity , Pressable , FlatList , ScrollView } from "react-native" ;
2+ import {
3+ View ,
4+ Text ,
5+ TouchableOpacity ,
6+ Pressable ,
7+ FlatList ,
8+ ScrollView ,
9+ SafeAreaView ,
10+ } from "react-native" ;
311import VideoComponent from "../../components/videoComponent" ;
412
513import { NativeStackNavigationProp } from "@react-navigation/native-stack" ;
@@ -15,24 +23,65 @@ type MainScreenNavigationProp = NativeStackNavigationProp<
1523 navigation : MainScreenNavigationProp ;
1624 } ;
1725
26+ const IMAGE_DATA = [
27+ "https://storage.googleapis.com/gtv-videos-bucket/sample/images/BigBuckBunny.jpg" ,
28+ "https://storage.googleapis.com/gtv-videos-bucket/sample/images/ElephantsDream.jpg" ,
29+ "https://storage.googleapis.com/gtv-videos-bucket/sample/images/ForBiggerBlazes.jpg" ,
30+ "https://storage.googleapis.com/gtv-videos-bucket/sample/images/ForBiggerEscapes.jpg" ,
31+ "https://storage.googleapis.com/gtv-videos-bucket/sample/images/ForBiggerFun.jpg" ,
32+ "https://storage.googleapis.com/gtv-videos-bucket/sample/images/ForBiggerJoyrides.jpg" ,
33+ "https://storage.googleapis.com/gtv-videos-bucket/sample/images/ForBiggerMeltdowns.jpg" ,
34+ "https://storage.googleapis.com/gtv-videos-bucket/sample/images/Sintel.jpg" ,
35+ "https://storage.googleapis.com/gtv-videos-bucket/sample/images/SubaruOutbackOnStreetAndDirt.jpg" ,
36+ "https://storage.googleapis.com/gtv-videos-bucket/sample/images/TearsOfSteel.jpg" ,
37+ ] ;
38+
39+ const videos = [
40+ "https://storage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ,
41+ "https://storage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ,
42+ "https://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4" ,
43+ "https://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4" ,
44+ "https://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerFun.mp4" ,
45+ "https://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerJoyrides.mp4" ,
46+ "https://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerMeltdowns.mp4" ,
47+ "https://storage.googleapis.com/gtv-videos-bucket/sample/Sintel.jpg" ,
48+ "https://storage.googleapis.com/gtv-videos-bucket/sample/SubaruOutbackOnStreetAndDirt.mp4" ,
49+ "https://storage.googleapis.com/gtv-videos-bucket/sample/TearsOfSteel.mp4" ,
50+ ] ;
51+
1852function FollowingScreen ( { navigation } : Props ) {
19- return (
20- < View style = { { flex : 1 , justifyContent : "flex-start" } } >
21- < ScrollView >
22- < Pressable onPress = { ( ) => navigation . navigate ( "Live" ) } >
23- < ThumbNailComponent uri = "https://storage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" />
24- </ Pressable >
25-
26- < Pressable onPress = { ( ) => navigation . navigate ( "Live" ) } >
27- < ThumbNailComponent uri = "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" />
28- </ Pressable >
29-
30- { /* <Pressable onPress={() => navigation.navigate("Live")}>
31- <BoxContainer url="https://upload.wikimedia.org/wikipedia/commons/transcoded/a/a2/Elephants_Dream_%282006%29.webm/Elephants_Dream_%282006%29.webm.480p.vp9.webm" />
32- </Pressable> */ }
33- </ ScrollView >
34- </ View >
53+ const renderItem = ( { item } : { item : string } ) => (
54+ < Pressable onPress = { ( ) => navigation . navigate ( "Live" ) } >
55+ < ThumbNailComponent uri = { item } />
56+ </ Pressable >
3557 ) ;
58+ // return (
59+ // <View style={{ flex: 1, justifyContent: "flex-start" }}>
60+ // <ScrollView>
61+ // <Pressable onPress={() => navigation.navigate("Live")}>
62+ // <ThumbNailComponent uri="https://storage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" />
63+ // </Pressable>
64+
65+ // <Pressable onPress={() => navigation.navigate("Live")}>
66+ // <ThumbNailComponent uri="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" />
67+ // </Pressable>
68+
69+ // {/* <Pressable onPress={() => navigation.navigate("Live")}>
70+ // <BoxContainer url="https://upload.wikimedia.org/wikipedia/commons/transcoded/a/a2/Elephants_Dream_%282006%29.webm/Elephants_Dream_%282006%29.webm.480p.vp9.webm" />
71+ // </Pressable> */}
72+ // </ScrollView>
73+ // </View>
74+ // );
75+
76+ return (
77+ < SafeAreaView >
78+ < FlatList
79+ data = { IMAGE_DATA }
80+ renderItem = { renderItem }
81+ keyExtractor = { ( item ) => item }
82+ />
83+ </ SafeAreaView >
84+ ) ;
3685}
3786
3887export default FollowingScreen ;
0 commit comments