-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
87 lines (78 loc) · 2.14 KB
/
Copy pathApp.js
File metadata and controls
87 lines (78 loc) · 2.14 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*import React, {Component} from 'react';
import { View, Text } from 'react-native';
import MenuOne from './src/components';
export class SpringRolls extends Component {
render(props) {
return (
<View style = {{
height : 50,
width : 100,
flexDirection : 'row',
}}
>
<Text>Day la {this.props.threeCourseMeal}. Do la Cha Gio</Text>
<Text>Cong thuc gom co :</Text>
</View>
);
}
}
export default class App extends Component {
render = () => {
return (
<MenuOne
width = {100}
height = {50}
backgroundColor = {'red'}
>
<SpringRolls threeCourseMeal = "mon Starter"/>
</MenuOne>
);
}
};*/
import * as React from 'react';
import { Button, View, Text } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
function HomeScreen({ navigation }) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Ga nuong muoi ot</Text>
<Button
title="Xem cach che bien"
onPress={() => navigation.navigate('Details1')}
/>
<Text>Thit heo quay</Text>
<Button
title="Xem cach che bien"
onPress={() => navigation.navigate('Details2')}
/>
</View>
);
}
function DetailsScreen1({ navigation }) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Thit ga + muoi ot</Text>
</View>
);
}
function DetailsScreen2({ navigation }) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Thit heo</Text>
</View>
);
}
const Stack = createStackNavigator();
function App() {
return (
<NavigationContainer>
<Stack.Navigator initialRouteName="Home">
<Stack.Screen name="Home" component={HomeScreen} />
<Stack.Screen name="Details1" component={DetailsScreen1} />
<Stack.Screen name="Details2" component={DetailsScreen2} />
</Stack.Navigator>
</NavigationContainer>
);
}
export default App;