diff --git a/src/app/components/ImageInput.js b/src/app/components/ImageInput.js index 4a2f2f1..41f9115 100644 --- a/src/app/components/ImageInput.js +++ b/src/app/components/ImageInput.js @@ -19,9 +19,9 @@ function ImageInput({ imageUri, onChangeImage }) { requestPermission(); //requestPermissionCamera(); }, []); - const [modalVisible, setModalVisible] = useState(false); + /* const [modalVisible, setModalVisible] = useState(false); - const requestPermissionCamera = async () => { + const requestPermissionCamera = async () => { const { granted } = await Permissions.askAsync(Permissions.CAMERA); if(granted) { launchCamera(); @@ -39,7 +39,7 @@ function ImageInput({ imageUri, onChangeImage }) { } catch (error) { console.log("Erro ao ler imagem", error); } - }; + };*/ const requestPermission = async () => { const { granted } = await ImagePicker.requestCameraRollPermissionsAsync(); @@ -48,7 +48,9 @@ function ImageInput({ imageUri, onChangeImage }) { }; const handlePress = () => { - if (!imageUri) setModalVisible(true); + if (!imageUri) + launchImageLibrary(); + //setModalVisible(true); else Alert.alert("Deletar", "Deseja deletar esta imagem?", [ { text: "Sim", onPress: () => onChangeImage(null) }, @@ -82,7 +84,7 @@ function ImageInput({ imageUri, onChangeImage }) { {imageUri && } - + {/* + */} - ); }