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

Commit

Permalink
merge dev and solve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
netochaves committed Jun 1, 2019
2 parents ae3d062 + d8eea26 commit 7690ba2
Show file tree
Hide file tree
Showing 10 changed files with 245 additions and 50 deletions.
40 changes: 40 additions & 0 deletions PRIVACY-POLICY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Privacy Policy

[["We" or "I", or Website or App name]] takes your privacy seriously. To better protect your privacy [["we" or "I"]] provide this privacy policy notice explaining the way your personal information is collected and used.


## Collection of Routine Information

This [["website" or "app"]] track basic information about their [["visitors" or "users"]]. This information includes, but is not limited to, IP addresses, [["browser" or "app"]] details, timestamps and referring pages. None of this information can personally identify specific [["visitors" or "user"]] to this [["website" or "app"]]. The information is tracked for routine administration and maintenance purposes.


## Cookies

Where necessary, this [["website" or "app"]] uses cookies to store information about a visitor’s preferences and history in order to better serve the [["visitor" or "user"]] and/or present the [["visitor" or "user"]] with customized content.


## Advertisement and Other Third Parties

Advertising partners and other third parties may use cookies, scripts and/or web beacons to track [["visitors" or "user"]] activities on this [["website" or "app"]] in order to display advertisements and other useful information. Such tracking is done directly by the third parties through their own servers and is subject to their own privacy policies. This [["website" or "app"]] has no access or control over these cookies, scripts and/or web beacons that may be used by third parties. Learn how to [opt out of Google’s cookie usage](http://www.google.com/privacy_ads.html).


## Links to Third Party Websites

[["We" or "I"]] have included links on this [["website" or "app"]] for your use and reference. [["We" or "I"]] are not responsible for the privacy policies on these websites. You should be aware that the privacy policies of these websites may differ from [["our" or "my"]] own.


## Security

The security of your personal information is important to [["us" or "me"]], but remember that no method of transmission over the Internet, or method of electronic storage, is 100% secure. While [["we" or "I"]] strive to use commercially acceptable means to protect your personal information, [["we" or "I"]] cannot guarantee its absolute security.


## Changes To This Privacy Policy

This Privacy Policy is effective as of [[Date]] and will remain in effect except with respect to any changes in its provisions in the future, which will be in effect immediately after being posted on this page.

[["We" or "I"]] reserve the right to update or change [["our" or "my"]] Privacy Policy at any time and you should check this Privacy Policy periodically. If [["we" or "I"]] make any material changes to this Privacy Policy, [["we" or "I"]] will notify you either through the email address you have provided [["us" or "me"]], or by placing a prominent notice on [["our" or "my"]] [["website" or "app"]].


## Contact Information

For any questions or concerns regarding the privacy policy, please send [["us" or "me"]] an email to [[Contact Email Address]].
38 changes: 20 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dependencies": {
"@react-native-community/async-storage": "^1.3.4",
"@react-native-community/netinfo": "^2.0.10",
"axios": "^0.18.0",
"axios": "^0.19.0",
"eslint-config-prettier": "^4.1.0",
"eslint-plugin-prettier": "^3.0.1",
"prop-types": "^15.7.2",
Expand Down
4 changes: 3 additions & 1 deletion src/Components/Chat/chatContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import getTime from "~/functions/getTime"
import Message from "../mensagem"

const Chat = props => {
const { messages } = props
const { messages, destUserUid } = props
return (
<View>
<FlatList
Expand All @@ -15,6 +15,8 @@ const Chat = props => {
renderItem={({ item }) => {
return (
<Message
chave={item.key}
destUserUid={destUserUid}
content={
item.source === "1" ? item.content : item.contentTranslated
}
Expand Down
25 changes: 23 additions & 2 deletions src/Components/Config/configBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import {
Text,
TouchableOpacity,
ScrollView,
Switch
Switch,
Linking,
Share
} from "react-native"
import { Icon } from "react-native-elements"
import firebase from "react-native-firebase"
Expand Down Expand Up @@ -99,7 +101,15 @@ export default class configBody extends Component {
<Text style={styles.touchableStyle}>Enviar Feedback</Text>
</TouchableOpacity>

<TouchableOpacity style={styles.touchableIcon}>
<TouchableOpacity
style={styles.touchableIcon}
onPress={() => {
Share.share({
message:
"Olá, já instalou o Unichat? Se não, é bem fácil. Apenas clique no link a seguir https://github.com/ES2-UFPI/Unichat/releases"
})
}}
>
<Icon name="share" size={28} color="#14d2e8" />
<Text style={styles.touchableStyle}>Compartilhar App</Text>
</TouchableOpacity>
Expand All @@ -108,6 +118,17 @@ export default class configBody extends Component {
<Icon name="star" size={28} color="#deea2e" />
<Text style={styles.touchableStyle}>Avaliar App</Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.touchableIcon}
onPress={() => {
Linking.openURL(
"https://github.com/ES2-UFPI/Unichat/blob/dev/PRIVACY-POLICY.md"
)
}}
>
<Icon name="notifications" size={28} color="#25e01f" />
<Text style={styles.touchableStyle}>Política de Privacidade</Text>
</TouchableOpacity>

<TouchableOpacity style={styles.touchableIcon}>
<Icon name="notifications" size={28} color="#25e01f" />
Expand Down
54 changes: 54 additions & 0 deletions src/Components/Languages/languagesHeader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import React from "react"

import { View, StyleSheet, Text, TouchableOpacity } from "react-native"
import { Icon } from "react-native-elements"

const languagesHeader = props => {
return (
<View style={styles.header}>
<View style={styles.headerContent}>
<TouchableOpacity
style={styles.backButton}
onPress={() => {
const { navigation } = props
navigation.navigate("SettingsScreen")
}}
hitSlop={{ top: 20, bottom: 20, left: 20, right: 20 }}
>
<Icon name="ios-arrow-back" color="#00aced" type="ionicon" />
</TouchableOpacity>
<Text style={styles.languagesInfo}>Idiomas</Text>
</View>
</View>
)
}

const styles = StyleSheet.create({
header: {
backgroundColor: "#fff",
elevation: 5,
marginTop: 0,
fontFamily: "OpenSans"
},
headerContent: {
backgroundColor: "#fff",
marginBottom: 15,
marginTop: 15,
marginLeft: 15,
marginRight: 10,
flexDirection: "row"
},
backButton: {
justifyContent: "center"
},
languagesInfo: {
flex: 1,
fontSize: 22,
textAlign: "center",
backgroundColor: "#fff",
marginLeft: 20,
paddingRight: 20
}
})

export default languagesHeader
84 changes: 70 additions & 14 deletions src/Components/mensagem.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { PureComponent } from "react"
import { Svg, Path } from "react-native-svg"
import { View, Text, StyleSheet, TouchableOpacity, Alert } from "react-native"
import { moderateScale } from "react-native-size-matters"
import firebase from "react-native-firebase"

const styles = StyleSheet.create({
// Estilo para a mensagem do remetente
Expand Down Expand Up @@ -85,33 +86,88 @@ const styles = StyleSheet.create({
})

export default class Mensagem extends PureComponent {
constructor() {
super()
constructor(props) {
super(props)
this.state = {
chave: "",
content: "",
date: "",
source: "",
original: ""
}
const userUid = firebase.auth().currentUser.uid
const { destUserUid } = this.props
this.ref = firebase
.firestore()
.collection("users")
.doc(userUid)
.collection("conversas")
.doc(destUserUid)
.collection("messages")
}

componentDidMount() {
const { content, date, source, original } = this.props
const { chave, content, date, source, original } = this.props

this.setState({ content, date, source, original })
this.setState({ chave, content, date, source, original })
}

alterarIdioma = chave => {
const { content, original } = this.state
const translated = content
const noTranslated = original
this.ref
.doc(chave)
.get()
.then(doc => {
const { isChanged } = doc.data()
if (isChanged) {
this.ref.doc(chave).update({
content: translated,
contentTranslated: noTranslated,
isChanged: false
})
} else {
this.ref.doc(chave).update({
content: translated,
contentTranslated: noTranslated,
isChanged: true
})
}
this.setState({ content: noTranslated, original: translated })
})
}

verLinguaOriginal = () => {
const { original } = this.state
Alert.alert(
"Confirmar",
"Deseja ver a mensagem na linguagem original?",
[
{ text: "Sim", onPress: () => this.setState({ content: original }) },
{ text: "Não" }
],
{ cancelable: false }
)
const { chave } = this.state

this.ref
.doc(chave)
.get()
.then(doc => {
const { isChanged } = doc.data()
if (isChanged) {
Alert.alert(
"Confirmar",
"Deseja ver a tradução da mensagem?",
[
{ text: "Sim", onPress: () => this.alterarIdioma(chave) },
{ text: "Não" }
],
{ cancelable: false }
)
} else {
Alert.alert(
"Confirmar",
"Deseja ver a mensagem na linguagem original?",
[
{ text: "Sim", onPress: () => this.alterarIdioma(chave) },
{ text: "Não" }
],
{ cancelable: false }
)
}
})
}

render() {
Expand Down
5 changes: 3 additions & 2 deletions src/Screens/Chat/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ export default class Conversas extends Component {
content: newMessage.content,
date: newMessage.date,
contentTranslated: translated,
source: "2"
source: "2",
isChanged: false
})
.then(() => true)
.catch(error => error)
Expand Down Expand Up @@ -267,7 +268,7 @@ export default class Conversas extends Component {
status={status}
/>
<View style={styles.chatContainer}>
<ChatContainer messages={messages} />
<ChatContainer messages={messages} destUserUid={destUser.key}/>
</View>
<View style={styles.input}>
<ChatInput
Expand Down
Loading

0 comments on commit 7690ba2

Please sign in to comment.