|
@ -1,4 +1,4 @@ |
|
|
import React, { useEffect, useState } from "react"; |
|
|
|
|
|
|
|
|
import React, { useEffect, useState } from "react"; |
|
|
import { |
|
|
import { |
|
|
View, |
|
|
View, |
|
|
StyleSheet, |
|
|
StyleSheet, |
|
@ -20,7 +20,7 @@ function ImageInput({ imageUri, onChangeImage }) { |
|
|
//requestPermissionCamera();
|
|
|
//requestPermissionCamera();
|
|
|
}, []); |
|
|
}, []); |
|
|
|
|
|
|
|
|
/* const requestPermissionCamera = async () => { |
|
|
|
|
|
|
|
|
/* const requestPermissionCamera = async () => { |
|
|
const { granted } = await Permissions.askAsync(Permissions.CAMERA); |
|
|
const { granted } = await Permissions.askAsync(Permissions.CAMERA); |
|
|
if(granted) { |
|
|
if(granted) { |
|
|
launchCamera(); |
|
|
launchCamera(); |
|
@ -42,7 +42,8 @@ function ImageInput({ imageUri, onChangeImage }) { |
|
|
|
|
|
|
|
|
const requestPermission = async () => { |
|
|
const requestPermission = async () => { |
|
|
const { granted } = await ImagePicker.requestCameraRollPermissionsAsync(); |
|
|
const { granted } = await ImagePicker.requestCameraRollPermissionsAsync(); |
|
|
if (!granted) alert("Você precisa habilitar permissão para acessar a biblioteca."); |
|
|
|
|
|
|
|
|
if (!granted) |
|
|
|
|
|
alert("Você precisa habilitar permissão para acessar a biblioteca."); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const handlePress = () => { |
|
|
const handlePress = () => { |
|
@ -77,7 +78,9 @@ function ImageInput({ imageUri, onChangeImage }) { |
|
|
size={40} |
|
|
size={40} |
|
|
/> |
|
|
/> |
|
|
)} |
|
|
)} |
|
|
{imageUri && <Image source={{ uri: imageUri }} style={styles.image} />} |
|
|
|
|
|
|
|
|
{imageUri && ( |
|
|
|
|
|
<Image source={{ uri: imageUri }} style={styles.image} /> |
|
|
|
|
|
)} |
|
|
</View> |
|
|
</View> |
|
|
</TouchableWithoutFeedback> |
|
|
</TouchableWithoutFeedback> |
|
|
</View> |
|
|
</View> |
|
@ -101,17 +104,17 @@ const styles = StyleSheet.create({ |
|
|
}, |
|
|
}, |
|
|
centeredView: { |
|
|
centeredView: { |
|
|
flex: 1, |
|
|
flex: 1, |
|
|
justifyContent: 'center', |
|
|
|
|
|
alignItems: 'center', |
|
|
|
|
|
|
|
|
justifyContent: "center", |
|
|
|
|
|
alignItems: "center", |
|
|
marginTop: 22, |
|
|
marginTop: 22, |
|
|
}, |
|
|
}, |
|
|
modalView: { |
|
|
modalView: { |
|
|
margin: 20, |
|
|
margin: 20, |
|
|
backgroundColor: '#d3d3d3', |
|
|
|
|
|
|
|
|
backgroundColor: colors.lightGray, |
|
|
borderRadius: 20, |
|
|
borderRadius: 20, |
|
|
padding: 30, |
|
|
padding: 30, |
|
|
alignItems: 'center', |
|
|
|
|
|
shadowColor: 'grey', |
|
|
|
|
|
|
|
|
alignItems: "center", |
|
|
|
|
|
shadowColor: "grey", |
|
|
shadowOffset: { |
|
|
shadowOffset: { |
|
|
width: 10, |
|
|
width: 10, |
|
|
height: 2, |
|
|
height: 2, |
|
@ -123,7 +126,7 @@ const styles = StyleSheet.create({ |
|
|
}, |
|
|
}, |
|
|
modalText: { |
|
|
modalText: { |
|
|
marginTop: 15, |
|
|
marginTop: 15, |
|
|
textAlign: 'center', |
|
|
|
|
|
|
|
|
textAlign: "center", |
|
|
fontSize: 16, |
|
|
fontSize: 16, |
|
|
color: colors.primary, |
|
|
color: colors.primary, |
|
|
}, |
|
|
}, |
|
@ -135,7 +138,7 @@ const styles = StyleSheet.create({ |
|
|
fontSize: 18, |
|
|
fontSize: 18, |
|
|
textAlign: "center", |
|
|
textAlign: "center", |
|
|
fontWeight: "bold", |
|
|
fontWeight: "bold", |
|
|
height: 35 |
|
|
|
|
|
|
|
|
height: 35, |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|