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

Commit

Permalink
Merge branch 'dev' into neto#165
Browse files Browse the repository at this point in the history
  • Loading branch information
sosolidkk authored Jun 1, 2019
2 parents 57c13e3 + cb18ed4 commit 45e9f6c
Show file tree
Hide file tree
Showing 14 changed files with 458 additions and 172 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]].
10 changes: 6 additions & 4 deletions functions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ return (exports.sendPushNotification = functions.firestore
.catch(error => console.log(error))

const { contactName, contactPhoto } = data
if (source === "2") {
if (source === "1") {
const payload = {
data: {
conversaId
},
notification: {
title: contactName,
body: contentTranslated,
body: content,
sound: "default",
android_channel_id: "main-channel",
collapseKey: "unichat",
Expand All @@ -45,8 +45,10 @@ return (exports.sendPushNotification = functions.firestore
.doc(userId)
.get()
.then(doc => {
const { pushToken } = doc.data()
return admin.messaging().sendToDevice(pushToken, payload)
const { pushToken, notifications } = doc.data()
if (notifications)
return admin.messaging().sendToDevice(pushToken, payload)
else return null
})
}
}))
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
5 changes: 4 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,9 @@ const Chat = props => {
renderItem={({ item }) => {
return (
<Message
nomeRemetente={null}
chave={item.key}
destUserUid={destUserUid}
content={
item.source === "1" ? item.content : item.contentTranslated
}
Expand Down
207 changes: 126 additions & 81 deletions src/Components/Config/configBody.js
Original file line number Diff line number Diff line change
@@ -1,100 +1,147 @@
import React from "react"
import React, { Component } from "react"
import {
View,
StyleSheet,
Text,
TouchableOpacity,
ScrollView,
Switch
Switch,
Linking,
Share
} from "react-native"
import { Icon } from "react-native-elements"
import firebase from "react-native-firebase"

const configBody = props => {
const { navigation } = props
return (
<View style={styles.elevationBody}>
<ScrollView showsVerticalScrollIndicator={false}>
<View style={styles.innerBody}>
<Text style={styles.touchableStyleTitle}>Conta</Text>
<Text style={styles.line} />
<TouchableOpacity
style={styles.touchableIcon}
onPress={() => {
navigation.navigate("LanguagesScreen")
}}
>
<Icon name="language" size={28} color="#007AFF" />
<Text style={styles.touchableStyle}>Idiomas</Text>
<View style={styles.chevronStyle}>
<Icon
name="chevron-right"
size={28}
color="gray"
type="evilicon"
/>
</View>
</TouchableOpacity>
export default class configBody extends Component {
constructor() {
super()
this.state = {
switchState: false
}
this.ref = firebase
.firestore()
.collection("users")
.doc(firebase.auth().currentUser.uid)
}

<TouchableOpacity
style={styles.touchableIcon}
onPress={() => {
navigation.navigate("EditPerfilScreen")
}}
>
<Icon name="person" size={28} color="#c6056c" />
<Text style={styles.touchableStyle}>Perfil</Text>
<View style={styles.chevronStyle}>
<Icon
name="chevron-right"
size={28}
color="gray"
type="evilicon"
/>
</View>
</TouchableOpacity>
componentDidMount() {
this.ref.get().then(doc => {
const { notifications } = doc.data()
this.setState({ switchState: notifications })
})
}

<TouchableOpacity style={styles.touchableIcon}>
<Icon name="notifications" size={28} color="#ef2390" />
<Text style={styles.touchableStyle}>Notificação</Text>
<View style={styles.chevronStyle}>
<Switch />
</View>
</TouchableOpacity>
switchHandler = () => {
const { switchState } = this.state
this.ref.update({ notifications: !switchState })
this.setState(prevState => ({ switchState: !prevState.switchState }))
}

<Text style={styles.touchableStyleTitle}>Aplicativo</Text>
<Text style={styles.line} />
render() {
const { navigation } = this.props
const { switchState } = this.state
return (
<View style={styles.elevationBody}>
<ScrollView showsVerticalScrollIndicator={false}>
<View style={styles.innerBody}>
<Text style={styles.touchableStyleTitle}>Conta</Text>
<Text style={styles.line} />
<TouchableOpacity
style={styles.touchableIcon}
onPress={() => {
navigation.navigate("LanguagesScreen")
}}
>
<Icon name="language" size={28} color="#007AFF" />
<Text style={styles.touchableStyle}>Idiomas</Text>
<View style={styles.chevronStyle}>
<Icon
name="chevron-right"
size={28}
color="gray"
type="evilicon"
/>
</View>
</TouchableOpacity>

<TouchableOpacity style={styles.touchableIcon}>
<Icon name="chat" size={28} color="#e542f4" />
<Text style={styles.touchableStyle}>Enviar Feedback</Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.touchableIcon}
onPress={() => {
navigation.navigate("EditPerfilScreen")
}}
>
<Icon name="person" size={28} color="#c6056c" />
<Text style={styles.touchableStyle}>Perfil</Text>
<View style={styles.chevronStyle}>
<Icon
name="chevron-right"
size={28}
color="gray"
type="evilicon"
/>
</View>
</TouchableOpacity>

<TouchableOpacity style={styles.touchableIcon}>
<Icon name="share" size={28} color="#14d2e8" />
<Text style={styles.touchableStyle}>Compartilhar App</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.touchableIcon}>
<Icon name="notifications" size={28} color="#ef2390" />
<Text style={styles.touchableStyle}>Notificação</Text>
<View style={styles.chevronStyle}>
<Switch
onValueChange={this.switchHandler}
value={switchState}
/>
</View>
</TouchableOpacity>

<TouchableOpacity style={styles.touchableIcon}>
<Icon name="star" size={28} color="#deea2e" />
<Text style={styles.touchableStyle}>Avaliar App</Text>
</TouchableOpacity>
<Text style={styles.touchableStyleTitle}>Aplicativo</Text>
<Text style={styles.line} />

<TouchableOpacity style={styles.touchableIcon}>
<Icon name="notifications" size={28} color="#25e01f" />
<Text style={styles.touchableStyle}>Política de Privacidade</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.touchableIcon}>
<Icon name="chat" size={28} color="#e542f4" />
<Text style={styles.touchableStyle}>Enviar Feedback</Text>
</TouchableOpacity>

<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>

<TouchableOpacity style={styles.touchableIcon}>
<Icon name="info" size={28} color="#ef9739" />
<Text style={styles.touchableStyle}>Sobre</Text>
<TouchableOpacity style={styles.touchableIcon}>
<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="info" size={28} color="#ef9739" />
<Text style={styles.touchableStyle}>Sobre</Text>
</TouchableOpacity>
</View>
<TouchableOpacity>
<Text style={styles.touchableStyleExit}>Excluir Conta</Text>
</TouchableOpacity>
</View>
<TouchableOpacity>
<Text style={styles.touchableStyleExit}>Excluir Conta</Text>
</TouchableOpacity>
</ScrollView>
</View>
)
</ScrollView>
</View>
)
}
}

const styles = StyleSheet.create({
Expand Down Expand Up @@ -152,5 +199,3 @@ const styles = StyleSheet.create({
marginRight: 20
}
})

export default configBody
Loading

0 comments on commit 45e9f6c

Please sign in to comment.