Browse Source

disabling launchCamera

master
analuizaff 4 years ago
parent
commit
82f088f72c
  1. 12
      src/app/components/ImageInput.js

12
src/app/components/ImageInput.js

@ -19,7 +19,7 @@ function ImageInput({ imageUri, onChangeImage }) {
requestPermission();
//requestPermissionCamera();
}, []);
const [modalVisible, setModalVisible] = useState(false);
/* const [modalVisible, setModalVisible] = useState(false);
const requestPermissionCamera = async () => {
const { granted } = await Permissions.askAsync(Permissions.CAMERA);
@ -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 && <Image source={{ uri: imageUri }} style={styles.image} />}
</View>
</TouchableWithoutFeedback>
<View >
{/*<View >
<Modal style={styles.centeredView}
animationType="slide"
transparent={true}
@ -110,7 +112,7 @@ function ImageInput({ imageUri, onChangeImage }) {
</View>
</TouchableWithoutFeedback>
</Modal>
</View>
</View>*/}
</View>
);
}

Loading…
Cancel
Save