Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Max#limitar imagem #173

Merged
merged 6 commits into from
Jun 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Components/mensagem.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const styles = StyleSheet.create({
marginRight: 10,
alignItems: "center"
},

// Estilo para a mensagem do destinatario
dest: {
flexDirection: "row",
Expand Down
14 changes: 11 additions & 3 deletions src/Screens/EditPerfil/editperfil.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {
TouchableOpacity,
Dimensions,
ActivityIndicator,
TextInput
TextInput,
Alert
} from "react-native"
import AsyncStorage from "@react-native-community/async-storage"
import firebase from "react-native-firebase"
Expand Down Expand Up @@ -110,8 +111,15 @@ export default class Conversas extends Component {

ImagePicker.showImagePicker(options, response => {
if (response.uri) {
this.setState({ myImage: response })
this.uploadphotos()
if (response.fileSize <= 600000) {
this.setState({ myImage: response })
this.uploadphotos()
} else {
Alert.alert(
"Erro",
"Selecione uma foto com tamanho inferior a 600 kB"
)
}
}
})
}
Expand Down
14 changes: 11 additions & 3 deletions src/Screens/PerfilSettings/perfilsettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {
BackHandler,
KeyboardAvoidingView,
ActivityIndicator,
Keyboard
Keyboard,
Alert
} from "react-native"
import AsyncStorage from "@react-native-community/async-storage"
import { Icon } from "react-native-elements"
Expand Down Expand Up @@ -123,8 +124,15 @@ export default class PerfilSettings extends Component {

ImagePicker.showImagePicker(options, response => {
if (response.uri) {
this.setState({ img: response })
this.uploadphotos()
if (response.fileSize <= 600000) {
this.setState({ img: response })
this.uploadphotos()
} else {
Alert.alert(
"Erro",
"Selecione uma foto com tamanho inferior a 600 kB"
)
}
}
})
}
Expand Down