File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import { StyleSheet , Text , View } from "react-native" ;
3+
4+ const About = ( ) => {
5+ return (
6+ < View style = { styles . container } >
7+ < Text > About Screen</ Text >
8+ </ View >
9+ ) ;
10+ } ;
11+
12+ const styles = StyleSheet . create ( {
13+ container : {
14+ padding : 24 ,
15+ } ,
16+ } ) ;
17+
18+ export default About ;
Original file line number Diff line number Diff line change 1+ import React , { useState } from "react" ;
2+ import {
3+ Button ,
4+ FlatList ,
5+ StyleSheet ,
6+ Text ,
7+ TouchableOpacity ,
8+ View ,
9+ } from "react-native" ;
10+ import { globalStyles } from "../styles/global" ;
11+ import { useNavigation } from "@react-navigation/native" ;
12+ const Home = ( ) => {
13+ const navigation = useNavigation ( ) ;
14+ const [ reviews , setReviews ] = useState ( [
15+ {
16+ title : "Zelda, Breath of Fresh Air" ,
17+ rating : 5 ,
18+ body : "lorem ipsum" ,
19+ key : "1" ,
20+ } ,
21+ {
22+ title : "Gotta Catch Them All (again)" ,
23+ rating : 4 ,
24+ body : "lorem ipsum" ,
25+ key : "2" ,
26+ } ,
27+ {
28+ title : 'Not So "Final" Fantasy' ,
29+ rating : 3 ,
30+ body : "lorem ipsum" ,
31+ key : "3" ,
32+ } ,
33+ ] ) ;
34+ return (
35+ < View style = { globalStyles . container } >
36+ < FlatList
37+ data = { reviews }
38+ renderItem = { ( { item } ) => (
39+ < TouchableOpacity
40+ onPress = { ( ) => {
41+ navigation . navigate ( "ReviewDetails" , item ) ;
42+ } }
43+ >
44+ < Text style = { globalStyles . titleText } > { item . title } </ Text >
45+ </ TouchableOpacity >
46+ ) }
47+ />
48+ </ View >
49+ ) ;
50+ } ;
51+
52+ export default Home ;
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import { StyleSheet , Text , View } from "react-native" ;
3+ import { useRoute } from "@react-navigation/native" ;
4+ const ReviewDetails = ( ) => {
5+ const route = useRoute ( ) ;
6+ return (
7+ < View style = { styles . container } >
8+ < Text > { route . params . title } </ Text >
9+ </ View >
10+ ) ;
11+ } ;
12+
13+ const styles = StyleSheet . create ( {
14+ container : {
15+ padding : 24 ,
16+ } ,
17+ } ) ;
18+
19+ export default ReviewDetails ;
You can’t perform that action at this time.
0 commit comments