-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
105 lines (91 loc) · 3.25 KB
/
Copy pathApp.js
File metadata and controls
105 lines (91 loc) · 3.25 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import 'react-native-gesture-handler';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
// import React, { useState, useEffect } from 'react';
// import { Text, View, TouchableOpacity } from 'react-native';
// import { Camera } from 'expo-camera';
// export default function App() {
// const [hasPermission, setHasPermission] = useState(null);
// const [type, setType] = useState(Camera.Constants.Type.back);
// useEffect(() => {
// (async () => {
// const { status } = await Camera.requestPermissionsAsync();
// setHasPermission(status === 'granted');
// })();
// }, []);
// if (hasPermission === null) {
// return <View />;
// }
// if (hasPermission === false) {
// return <Text>No access to camera</Text>;
// }
// return (
// <View style={{ flex: 1 }}>
// <Camera style={{ flex: 1 }} type={type}>
// <View
// style={{
// flex: 1,
// backgroundColor: 'transparent',
// flexDirection: 'row',
// }}>
// <TouchableOpacity
// style={{
// flex: 0.1,
// alignSelf: 'flex-end',
// alignItems: 'center',
// }}
// onPress={() => {
// setType(
// type === Camera.Constants.Type.back
// ? Camera.Constants.Type.front
// : Camera.Constants.Type.back
// );
// }}>
// <Text style={{ fontSize: 18, marginBottom: 10, color: 'white' }}> Flip </Text>
// </TouchableOpacity>
// </View>
// </Camera>
// </View>
// );
// }
import React, {useState, useEffect} from 'react';
import { StyleSheet, Text, View } from 'react-native';
import SelectScreen from './components/SelectScreen'
import ImageInput from './components/ImageInput'
import ImageOutput from './components/ImageOutput'
import CameraRollPicker from 'react-native-camera-roll-picker';
import * as ImagePicker from 'expo-image-picker';
import * as Permissions from 'expo-permissions';
// import CameraRoll from './components/CameraRoll'
// import { RNCamera } from 'react-native-camera';
// import { Camera } from 'expo-camera';
function App() {
const [selectedModel,setSelectedModel] = useState(null)
const [hasPermission, setHasPermission] = useState(null);
// const [type, setType] = useState(Camera.Constants.Type.back);
return (
<View style={styles.container} justifyContent = 'center'>
{selectedModel}
<ImageOutput uri="https://d384u2mq2suvbq.cloudfront.net/public/spree/products/1594/jumbo/Tomato-Leaf-Fragrance-Oil.jpg?1529607054" />
</View>
);
}
const MainStack = createStackNavigator();
export default function MainStackScreen() {
return (
<NavigationContainer >
<MainStack.Navigator initialRouteName="ImageInput">
<MainStack.Screen name="ImageInput" component={ImageInput} />
<MainStack.Screen name="ImageOutput" component={ImageOutput} />
</MainStack.Navigator>
</NavigationContainer>
)
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
// justifyContent: 'center',
},
});