Browse Source

Merge branch 'main' of https://github.com/IGSD-UoW/WPD-MobileApp into main

master
Daniel D'Angelo Resende Barros 4 years ago
parent
commit
f0e394befb
  1. 2
      .gitignore
  2. 5
      src/app/components/ImageInput.js
  3. 2135
      src/package-lock.json
  4. 3
      src/package.json

2
.gitignore

@ -10,5 +10,7 @@ src/*.orig.*
src/web-build/ src/web-build/
src/*.lock src/*.lock
src/package-lock.json src/package-lock.json
.fdignore
src/.eslintrc.json
# macOS # macOS
.DS_Store .DS_Store

5
src/app/components/ImageInput.js

@ -11,6 +11,7 @@ import {
} from "react-native"; } from "react-native";
import { MaterialCommunityIcons } from "@expo/vector-icons"; import { MaterialCommunityIcons } from "@expo/vector-icons";
import * as ImagePicker from "expo-image-picker"; import * as ImagePicker from "expo-image-picker";
import * as Permissions from "expo-permissions";
import colors from "../config/colors"; import colors from "../config/colors";
function ImageInput({ imageUri, onChangeImage }) { function ImageInput({ imageUri, onChangeImage }) {
@ -21,11 +22,11 @@ function ImageInput({ imageUri, onChangeImage }) {
const [modalVisible, setModalVisible] = useState(false); const [modalVisible, setModalVisible] = useState(false);
const requestPermission = async () => { const requestPermission = async () => {
const { granted } = await ImagePicker.requestCameraRollPermissionsAsync();
const { granted } = await Permissions.askAsync(Permissions.CAMERA_ROLL);
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 requestPermissionCamera = async () => { const requestPermissionCamera = async () => {
const { granted } = await ImagePicker.requestCameraPermissionsAsync();
const { granted } = await Permissions.askAsync(Permissions.CAMERA);
if(granted) { if(granted) {
launchCamera(); launchCamera();
} }

2135
src/package-lock.json
File diff suppressed because it is too large
View File

3
src/package.json

@ -51,7 +51,10 @@
"@babel/core": "^7.12.10", "@babel/core": "^7.12.10",
"babel-core": "^6.26.3", "babel-core": "^6.26.3",
"babel-loader": "^8.2.2", "babel-loader": "^8.2.2",
"eslint": "^7.17.0",
"eslint-plugin-react": "^7.22.0",
"jest-expo": "^40.0.1", "jest-expo": "^40.0.1",
"jest-expo-enzyme": "^1.0.4",
"react-test-renderer": "^17.0.1" "react-test-renderer": "^17.0.1"
}, },
"private": true "private": true

Loading…
Cancel
Save