|
1 |
| -import { View, Text,Button } from 'react-native' |
| 1 | +import { View, Text, Button } from 'react-native' |
2 | 2 | import React, { useEffect } from 'react'
|
3 | 3 | import FirstComp from './components/FirstComp'
|
4 | 4 | import ButtonEvent from './components/ButtonEvent'
|
@@ -29,27 +29,19 @@ import PostApiComp from './components/apiInNative/PostApiComp'
|
29 | 29 | import APIListComp from './components/apiInNative/APIListComp'
|
30 | 30 | import HeaderComp from './components/reduxComponentUiTest/HeaderComp'
|
31 | 31 | import ProductComp from './components/reduxComponentUiTest/ProductComp'
|
| 32 | +import { NavigationContainer } from '@react-navigation/native'; |
| 33 | +import { createNativeStackNavigator } from '@react-navigation/native-stack'; |
| 34 | +import HeaderAndProduct from './HeaderAndProduct' |
| 35 | +import UserListNavigationRedux from './components/reduxComponentUiTest/UserListNavigationRedux' |
| 36 | + |
| 37 | + |
| 38 | +const Stack = createNativeStackNavigator(); |
32 | 39 |
|
33 | 40 | const App = () => {
|
34 | 41 | useEffect(() => {
|
35 | 42 | console.log("hello")
|
36 | 43 | }, [])
|
37 |
| - const products = [{ |
38 |
| - name: 'POCO M2 Pro', |
39 |
| - price: '20000', |
40 |
| - color: 'Navy Blue' |
41 |
| - }, |
42 |
| - { |
43 |
| - name: 'POCO M3 Pro', |
44 |
| - price: '20000', |
45 |
| - color: 'Navy Blue' |
46 |
| - }, |
47 |
| - { |
48 |
| - name: 'Mi 11 Pro', |
49 |
| - price: '20000', |
50 |
| - color: 'Navy Blue' |
51 |
| - } |
52 |
| - ] |
| 44 | + |
53 | 45 | return (
|
54 | 46 | <View style={{ flex: 1 }}>
|
55 | 47 | <Text style={{ fontSize: 30, textAlign: 'center', color: "blue", marginTop: 10, fontWeight: "bold" }}>
|
@@ -85,12 +77,13 @@ const App = () => {
|
85 | 77 | {/* <SimpleFreeApi/> */}
|
86 | 78 | {/* <PostApiComp/> */}
|
87 | 79 | {/* <APIListComp/> */}
|
88 |
| - <HeaderComp /> |
89 |
| - <View style={{ flex: 13, backgroundColor: 'pink' }}> |
90 |
| - {products.map((item) => |
91 |
| - <ProductComp item={item}/> |
92 |
| - )} |
93 |
| - </View> |
| 80 | + |
| 81 | + <NavigationContainer> |
| 82 | + <Stack.Navigator> |
| 83 | + <Stack.Screen name="HeaderAndProduct" component={HeaderAndProduct} /> |
| 84 | + <Stack.Screen name="UserListNavigationRedux" component={UserListNavigationRedux} /> |
| 85 | + </Stack.Navigator> |
| 86 | + </NavigationContainer> |
94 | 87 | </View>
|
95 | 88 | )
|
96 | 89 | }
|
|
0 commit comments