From 3849deec5147a8882a6f9c10e66ef199d615ce2a Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 31 May 2019 13:40:19 -0300 Subject: [PATCH 01/18] Criado componente para Conversas --- src/Components/Conversa/conversa.js | 110 ++++++++++++++++++++++++++++ src/Screens/Conversas/conversas.js | 91 +---------------------- 2 files changed, 113 insertions(+), 88 deletions(-) create mode 100644 src/Components/Conversa/conversa.js diff --git a/src/Components/Conversa/conversa.js b/src/Components/Conversa/conversa.js new file mode 100644 index 0000000..b54fd0f --- /dev/null +++ b/src/Components/Conversa/conversa.js @@ -0,0 +1,110 @@ +import React from "react" + +import { View, StyleSheet, Text } from "react-native" +import LinearGradient from "react-native-linear-gradient" +import getTime from "~/functions/getTime" +import firebase from "react-native-firebase" +import { Avatar } from "react-native-elements" + +const conversa = props => { + const { item } = props + + const parseTime = dateNanoScds => { + const date = dateNanoScds.toDate() + const atualDate = firebase.database().getServerTime() + let textDate = "" + if (atualDate.getDate() - date.getDate() === 0) { + textDate = getTime(date) + } else if (atualDate.getDate() - date.getDate() === 1) { + textDate = "Ontem" + } else if (atualDate.getDate() - date.getDate() >= 2) { + textDate = `${date + .getDate() + .toString()}/${date + .getMonth() + .toString()}/${date.getFullYear().toString()}` + } + return textDate + } + + return ( + + + + {item.contactName} + {item.lastMessage} + + + {parseTime(item.dateLastMessage)} + {item.unreadMsgs && ( + + {item.numUnreadMsgs} + + )} + + + ) +} + +const styles = StyleSheet.create({ + conversa: { + flexDirection: "row", + width: "100%", + backgroundColor: "#FFF", + marginBottom: 1 + }, + avatar: { + marginTop: 10, + marginLeft: 10, + marginBottom: 10 + }, + mainInformation: { + flex: 1, + marginRight: 60, + marginTop: 15, + marginBottom: 15, + marginLeft: 10 + }, + name: { + position: "absolute", + top: 0 + }, + lastMsg: { + position: "absolute", + bottom: 0, + color: "#a9a9a9", + fontSize: 13 + }, + cont: { + width: 20, + height: 20, + borderRadius: 10, + justifyContent: "center", + marginTop: 5 + }, + data: { + fontSize: 8 + }, + unread: { + fontWeight: "bold", + fontSize: 8, + alignSelf: "center", + color: "white" + }, + rightInformation: { + position: "absolute", + alignItems: "center", + justifyContent: "center", + right: 0, + marginRight: 10, + top: "50%", + bottom: "50%" + } +}) + +export default conversa diff --git a/src/Screens/Conversas/conversas.js b/src/Screens/Conversas/conversas.js index cc4db38..13af730 100644 --- a/src/Screens/Conversas/conversas.js +++ b/src/Screens/Conversas/conversas.js @@ -11,11 +11,11 @@ import { Alert, AppState } from "react-native" -import { ListItem, Icon } from "react-native-elements" +import Conversa from "~/Components/Conversa/conversa" +import { Icon } from "react-native-elements" import LinearGradient from "react-native-linear-gradient" import firebase from "react-native-firebase" import AsyncStorage from "@react-native-community/async-storage" -import getTime from "~/functions/getTime" import NetInfo from "@react-native-community/netinfo" import SearchBar from "~/Components/SearchBar" @@ -231,26 +231,6 @@ export default class Conversas extends Component { navigation.navigate("ContactsScreen") } - search = () => {} - - parseTime = dateNanoScds => { - const date = dateNanoScds.toDate() - const atualDate = firebase.database().getServerTime() - let textDate = "" - if (atualDate.getDate() - date.getDate() === 0) { - textDate = getTime(date) - } else if (atualDate.getDate() - date.getDate() === 1) { - textDate = "Ontem" - } else if (atualDate.getDate() - date.getDate() >= 2) { - textDate = `${date - .getDate() - .toString()}/${date - .getMonth() - .toString()}/${date.getFullYear().toString()}` - } - return textDate - } - searchFilterFunction = text => { this.setState({ text }) const { conversas } = this.state @@ -314,34 +294,7 @@ export default class Conversas extends Component { this.confirmDelete(item) }} > - - {item.contactName} - {item.lastMessage} - - - {this.parseTime(item.dateLastMessage)} - - {item.unreadMsgs && ( - - - {item.numUnreadMsgs} - - - )} - - - } - leftAvatar={{ - source: { uri: item.contactPhoto }, - size: "medium" - }} - /> + ) }} @@ -368,10 +321,6 @@ const styles = StyleSheet.create({ fontFamily: "OpenSans", backgroundColor: "#F4F5F8" }, - containerSub: { - position: "absolute", - width: "100%" - }, header: { backgroundColor: "#fff", elevation: 5, @@ -395,11 +344,6 @@ const styles = StyleSheet.create({ searchIcon: { justifyContent: "center" }, - conversa: { - width: "100%", - backgroundColor: "#E8E3E3", - marginBottom: 1 - }, button: { elevation: 5, alignItems: "center", @@ -411,35 +355,6 @@ const styles = StyleSheet.create({ bottom: 5, right: 5 }, - cont: { - width: 20, - height: 20, - borderRadius: 10, - justifyContent: "center", - marginTop: 5 - }, - data: { - fontSize: 8 - }, - unread: { - fontWeight: "bold", - fontSize: 8, - alignSelf: "center", - color: "white" - }, - rightInformation: { - position: "absolute", - alignItems: "center", - justifyContent: "center", - right: 0, - top: "50%", - bottom: "50%" - }, - lastMsg: { - marginTop: 10, - color: "#a9a9a9", - fontSize: 13 - }, myPicture: { width: 40, height: 40, From 256bb9dd9e9a20eeab70b8e734b31b8e6daafd74 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 31 May 2019 14:42:52 -0300 Subject: [PATCH 02/18] Criado componente para contatos + ajustes --- src/Components/Contato/contato.js | 54 +++++++++++++++++++++++++++++ src/Components/Conversa/conversa.js | 2 +- src/Screens/Contacts/contacts.js | 30 ++-------------- 3 files changed, 57 insertions(+), 29 deletions(-) create mode 100644 src/Components/Contato/contato.js diff --git a/src/Components/Contato/contato.js b/src/Components/Contato/contato.js new file mode 100644 index 0000000..f0513e2 --- /dev/null +++ b/src/Components/Contato/contato.js @@ -0,0 +1,54 @@ +import React from "react" + +import { View, StyleSheet, Text } from "react-native" +import { Avatar } from "react-native-elements" + +const Contato = props => { + const { item } = props + + return ( + + + + {item.contactName} + {item.phoneNumbers[0].number} + + + ) +} +const styles = StyleSheet.create({ + contato: { + flexDirection: "row", + width: "100%", + backgroundColor: "#FFF", + marginBottom: 1 + }, + avatar: { + marginTop: 10, + marginLeft: 10, + marginBottom: 10 + }, + mainInformation: { + flex: 1, + marginTop: 15, + marginBottom: 15, + marginLeft: 15 + }, + name: { + position: "absolute", + top: 0 + }, + phone: { + position: "absolute", + bottom: 0, + color: "#a9a9a9", + fontSize: 13 + } +}) + +export default Contato diff --git a/src/Components/Conversa/conversa.js b/src/Components/Conversa/conversa.js index b54fd0f..bb60054 100644 --- a/src/Components/Conversa/conversa.js +++ b/src/Components/Conversa/conversa.js @@ -68,7 +68,7 @@ const styles = StyleSheet.create({ marginRight: 60, marginTop: 15, marginBottom: 15, - marginLeft: 10 + marginLeft: 15 }, name: { position: "absolute", diff --git a/src/Screens/Contacts/contacts.js b/src/Screens/Contacts/contacts.js index a12361a..76a7e9b 100644 --- a/src/Screens/Contacts/contacts.js +++ b/src/Screens/Contacts/contacts.js @@ -8,7 +8,7 @@ import { ToastAndroid, TouchableOpacity } from "react-native" -import { ListItem, Avatar } from "react-native-elements" +import Contato from "~/Components/Contato/contato" import Contacts from "react-native-contacts" import AsyncStorage from "@react-native-community/async-storage" import firebase from "react-native-firebase" @@ -155,29 +155,7 @@ export default class Contatos extends Component { navigation.navigate("ChatScreen", { item })} > - 0 - ? item.phoneNumbers[0].number - : null - } - leftAvatar={ - item.contactPhoto === "" ? ( - - ) : ( - { - source: { uri: item.contactPhoto }, - size: "medium" - } - ) - } - /> + ) }} @@ -194,9 +172,5 @@ const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: "#F4F5F8" - }, - contact: { - backgroundColor: "#F4F5F8", - marginBottom: 1 } }) From 0dfd70f3f150a1e2dcb73879657c9cc8eff2f85a Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 31 May 2019 16:10:05 -0300 Subject: [PATCH 03/18] Instalado modulo platform-touchable --- package-lock.json | 5 +++++ package.json | 1 + 2 files changed, 6 insertions(+) diff --git a/package-lock.json b/package-lock.json index 7e6c70f..a85f285 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7875,6 +7875,11 @@ "resolved": "https://registry.npmjs.org/react-native-linear-gradient/-/react-native-linear-gradient-2.5.4.tgz", "integrity": "sha512-FF1NhlerA4uBiS0gFIHa4FBp8/aftv4vPj14Y47lGNkYjSI94tnI6oYO3EfUxXjEyCUPiOVNKZOB9kScyjc5Ew==" }, + "react-native-platform-touchable": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/react-native-platform-touchable/-/react-native-platform-touchable-1.1.1.tgz", + "integrity": "sha1-/eSsxl7qWF0osWTQw3FqQhKaaOQ=" + }, "react-native-power-translator": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/react-native-power-translator/-/react-native-power-translator-1.1.1.tgz", diff --git a/package.json b/package.json index 150994f..2e5eec7 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "react-native-gesture-handler": "^1.1.0", "react-native-image-picker": "^0.28.1", "react-native-linear-gradient": "^2.5.4", + "react-native-platform-touchable": "^1.1.1", "react-native-power-translator": "^1.1.1", "react-native-size-matters": "^0.1.7", "react-native-svg": "^9.3.7", From 8cd094f7093ae7ec56343cd5299ffab1959d7639 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 31 May 2019 16:12:29 -0300 Subject: [PATCH 04/18] Efeito de click no componente conversa --- src/Components/Conversa/conversa.js | 56 +++++++++++++++++------------ src/Screens/Conversas/conversas.js | 26 +++++++------- 2 files changed, 46 insertions(+), 36 deletions(-) diff --git a/src/Components/Conversa/conversa.js b/src/Components/Conversa/conversa.js index bb60054..f861c8b 100644 --- a/src/Components/Conversa/conversa.js +++ b/src/Components/Conversa/conversa.js @@ -5,9 +5,10 @@ import LinearGradient from "react-native-linear-gradient" import getTime from "~/functions/getTime" import firebase from "react-native-firebase" import { Avatar } from "react-native-elements" +import Touchable from "react-native-platform-touchable" const conversa = props => { - const { item } = props + const { item, onPress, onLongPress } = props const parseTime = dateNanoScds => { const date = dateNanoScds.toDate() @@ -28,35 +29,44 @@ const conversa = props => { } return ( - - - - {item.contactName} - {item.lastMessage} + onPress(item)} + onLongPress={() => onLongPress(item)} + > + + + + {item.contactName} + {item.lastMessage} + + + {parseTime(item.dateLastMessage)} + {item.unreadMsgs && ( + + {item.numUnreadMsgs} + + )} + - - {parseTime(item.dateLastMessage)} - {item.unreadMsgs && ( - - {item.numUnreadMsgs} - - )} - - + ) } const styles = StyleSheet.create({ + button: { + backgroundColor: "white", + marginBottom: 1 + }, conversa: { flexDirection: "row", - width: "100%", - backgroundColor: "#FFF", - marginBottom: 1 + width: "100%" }, avatar: { marginTop: 10, diff --git a/src/Screens/Conversas/conversas.js b/src/Screens/Conversas/conversas.js index 13af730..c8d15df 100644 --- a/src/Screens/Conversas/conversas.js +++ b/src/Screens/Conversas/conversas.js @@ -6,11 +6,11 @@ import { StyleSheet, Text, Image, - TouchableOpacity, BackHandler, Alert, AppState } from "react-native" +import Touchable from "react-native-platform-touchable" import Conversa from "~/Components/Conversa/conversa" import { Icon } from "react-native-elements" import LinearGradient from "react-native-linear-gradient" @@ -267,7 +267,8 @@ export default class Conversas extends Component { {myName} - { this.setState({ isSerchable: true }) }} @@ -275,7 +276,7 @@ export default class Conversas extends Component { - + ) @@ -286,29 +287,28 @@ export default class Conversas extends Component { data={arrayholder} renderItem={({ item }) => { return ( - { - this.goToChat(item) + { + this.goToChat(param) }} - onLongPress={() => { - this.confirmDelete(item) + onLongPress={param => { + this.confirmDelete(param) }} - > - - + /> ) }} keyExtractor={i => i.key} keyboardShouldPersistTaps="always" /> - { this.newConversa() }} > - + ) From 13b2851f91f2f6b82226b681aeb018dd0356390f Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 31 May 2019 16:17:56 -0300 Subject: [PATCH 05/18] Efeito de clique no search em conversas --- src/Screens/Conversas/conversas.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Screens/Conversas/conversas.js b/src/Screens/Conversas/conversas.js index c8d15df..35af2a8 100644 --- a/src/Screens/Conversas/conversas.js +++ b/src/Screens/Conversas/conversas.js @@ -268,7 +268,7 @@ export default class Conversas extends Component { {myName} { this.setState({ isSerchable: true }) }} From 840560bc9d6f6b94581f8671a194123fb78c5bcc Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 31 May 2019 17:01:16 -0300 Subject: [PATCH 06/18] =?UTF-8?q?Anima=C3=A7=C3=B5es=20nos=20botoes=20e=20?= =?UTF-8?q?ajuste=20na=20estiliza=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Components/Contacts/contactHeader.js | 38 ++++++++++-------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/src/Components/Contacts/contactHeader.js b/src/Components/Contacts/contactHeader.js index c971e63..8d0ea9f 100644 --- a/src/Components/Contacts/contactHeader.js +++ b/src/Components/Contacts/contactHeader.js @@ -1,13 +1,8 @@ import React from "react" -import { - View, - StyleSheet, - Text, - TouchableOpacity, - Dimensions -} from "react-native" +import { View, StyleSheet, Text, Dimensions } from "react-native" import { Icon } from "react-native-elements" +import Touchable from "react-native-platform-touchable" const contactsHeader = props => { const { syncronize, onPressSearch } = props @@ -16,19 +11,21 @@ const contactsHeader = props => { Contatos - + - + - - + - + background={Touchable.Ripple("black", true)} + > + + + ) @@ -59,11 +56,8 @@ const styles = StyleSheet.create({ }, Icon: { justifyContent: "center", - marginRight: 10, - marginLeft: 10 - }, - syncIcon: { - justifyContent: "center" + marginRight: 5, + marginLeft: 5 } }) From 6991a8a2025420afa4bc43b51708048115c7261a Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 31 May 2019 17:06:10 -0300 Subject: [PATCH 07/18] =?UTF-8?q?Anima=C3=A7=C3=A3o=20de=20clique=20no=20c?= =?UTF-8?q?omponente=20contato?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Components/Contato/contato.js | 36 ++++++++++++++++++++----------- src/Screens/Contacts/contacts.js | 19 ++++++---------- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/src/Components/Contato/contato.js b/src/Components/Contato/contato.js index f0513e2..ab729b0 100644 --- a/src/Components/Contato/contato.js +++ b/src/Components/Contato/contato.js @@ -2,30 +2,40 @@ import React from "react" import { View, StyleSheet, Text } from "react-native" import { Avatar } from "react-native-elements" +import Touchable from "react-native-platform-touchable" const Contato = props => { - const { item } = props + const { item, onPress } = props return ( - - - - {item.contactName} - {item.phoneNumbers[0].number} + onPress(item)} + > + + + + {item.contactName} + {item.phoneNumbers[0].number} + - + ) } const styles = StyleSheet.create({ + button: { + backgroundColor: "white", + marginBottom: 1 + }, contato: { flexDirection: "row", width: "100%", - backgroundColor: "#FFF", marginBottom: 1 }, avatar: { diff --git a/src/Screens/Contacts/contacts.js b/src/Screens/Contacts/contacts.js index 76a7e9b..0fc9b8f 100644 --- a/src/Screens/Contacts/contacts.js +++ b/src/Screens/Contacts/contacts.js @@ -1,13 +1,7 @@ /* eslint-disable camelcase */ /* eslint-disable react-native/split-platform-components */ import React, { Component } from "react" -import { - View, - FlatList, - StyleSheet, - ToastAndroid, - TouchableOpacity -} from "react-native" +import { View, FlatList, StyleSheet, ToastAndroid } from "react-native" import Contato from "~/Components/Contato/contato" import Contacts from "react-native-contacts" import AsyncStorage from "@react-native-community/async-storage" @@ -152,11 +146,12 @@ export default class Contatos extends Component { data={arrayholder.sort((a, b) => a.givenName.localeCompare(b))} renderItem={({ item }) => { return ( - navigation.navigate("ChatScreen", { item })} - > - - + { + navigation.navigate("ChatScreen", { item: param }) + }} + /> ) }} keyExtractor={i => i.recordID} From 0c0eb6acac59d4119471492eca4842160aa957df Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 31 May 2019 17:22:17 -0300 Subject: [PATCH 08/18] =?UTF-8?q?Anima=C3=A7=C3=A3o=20de=20click=20no=20ch?= =?UTF-8?q?at?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Components/Chat/chatHeader.js | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/Components/Chat/chatHeader.js b/src/Components/Chat/chatHeader.js index 2f2e95d..f6d9702 100644 --- a/src/Components/Chat/chatHeader.js +++ b/src/Components/Chat/chatHeader.js @@ -1,7 +1,8 @@ import React from "react" -import { View, StyleSheet, Text, TouchableOpacity } from "react-native" +import { View, StyleSheet, Text } from "react-native" import { Avatar, Icon } from "react-native-elements" +import Touchable from "react-native-platform-touchable" const chatHeader = props => { const { userName, userPhoto, navigation, status } = props @@ -9,18 +10,21 @@ const chatHeader = props => { return ( - navigation.goBack()} > - - - + + + + + Date: Fri, 31 May 2019 18:49:51 -0300 Subject: [PATCH 09/18] =?UTF-8?q?Anima=C3=A7=C3=B5es=20de=20cliques=20tela?= =?UTF-8?q?=20de=20perfil=20e=20SearchBar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Components/Chat/chatHeader.js | 2 +- src/Components/Contacts/contactHeader.js | 4 ++-- src/Components/Contato/contato.js | 2 +- src/Components/Conversa/conversa.js | 2 +- src/Components/SearchBar.js | 7 ++++--- src/Screens/Conversas/conversas.js | 3 ++- src/Screens/EditPerfil/editperfil.js | 19 +++++++++++++------ 7 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/Components/Chat/chatHeader.js b/src/Components/Chat/chatHeader.js index f6d9702..dbcef15 100644 --- a/src/Components/Chat/chatHeader.js +++ b/src/Components/Chat/chatHeader.js @@ -11,7 +11,7 @@ const chatHeader = props => { navigation.goBack()} > diff --git a/src/Components/Contacts/contactHeader.js b/src/Components/Contacts/contactHeader.js index 8d0ea9f..5b6fd1a 100644 --- a/src/Components/Contacts/contactHeader.js +++ b/src/Components/Contacts/contactHeader.js @@ -13,7 +13,7 @@ const contactsHeader = props => { @@ -21,7 +21,7 @@ const contactsHeader = props => { diff --git a/src/Components/Contato/contato.js b/src/Components/Contato/contato.js index ab729b0..b90b12d 100644 --- a/src/Components/Contato/contato.js +++ b/src/Components/Contato/contato.js @@ -10,7 +10,7 @@ const Contato = props => { return ( onPress(item)} > diff --git a/src/Components/Conversa/conversa.js b/src/Components/Conversa/conversa.js index f861c8b..5689802 100644 --- a/src/Components/Conversa/conversa.js +++ b/src/Components/Conversa/conversa.js @@ -31,7 +31,7 @@ const conversa = props => { return ( onPress(item)} onLongPress={() => onLongPress(item)} > diff --git a/src/Components/SearchBar.js b/src/Components/SearchBar.js index 72846ef..53248a3 100644 --- a/src/Components/SearchBar.js +++ b/src/Components/SearchBar.js @@ -1,21 +1,22 @@ import React from "react" -import { View, TextInput, StyleSheet, TouchableOpacity } from "react-native" +import { View, TextInput, StyleSheet } from "react-native" import { Icon } from "react-native-elements" +import Touchable from "react-native-platform-touchable" const Components = props => { const { onChangeText, value, onBackPressHandler } = props return ( - + - + {myName} { this.setState({ isSerchable: true }) }} @@ -303,6 +303,7 @@ export default class Conversas extends Component { /> { this.newConversa() }} diff --git a/src/Screens/EditPerfil/editperfil.js b/src/Screens/EditPerfil/editperfil.js index de5b31f..eda6f48 100644 --- a/src/Screens/EditPerfil/editperfil.js +++ b/src/Screens/EditPerfil/editperfil.js @@ -12,6 +12,7 @@ import { ActivityIndicator, TextInput } from "react-native" +import Touchable from "react-native-platform-touchable" import AsyncStorage from "@react-native-community/async-storage" import firebase from "react-native-firebase" import LinearGradient from "react-native-linear-gradient" @@ -183,12 +184,13 @@ export default class Conversas extends Component { - - + Perfil @@ -286,22 +288,24 @@ export default class Conversas extends Component { Nome {myName} - - + Email {email} - - + Telefone @@ -449,7 +453,10 @@ const styles = StyleSheet.create({ backgroundColor: "#fff" }, back: { + // position: "absolute", justifyContent: "center" + // height: 40, + // width: 40 }, editNameContainer: { elevation: 6, From 459aa115ab51118894dde326b45659d1527988e6 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 31 May 2019 19:10:07 -0300 Subject: [PATCH 10/18] =?UTF-8?q?Tamanho=20bot=C3=A3o=20voltar=20EditPerfi?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Screens/EditPerfil/editperfil.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Screens/EditPerfil/editperfil.js b/src/Screens/EditPerfil/editperfil.js index eda6f48..b29c338 100644 --- a/src/Screens/EditPerfil/editperfil.js +++ b/src/Screens/EditPerfil/editperfil.js @@ -185,6 +185,7 @@ export default class Conversas extends Component { Date: Thu, 6 Jun 2019 11:35:07 -0300 Subject: [PATCH 11/18] =?UTF-8?q?Efeito=20ao=20clicar=20em=20ver=20perfil?= =?UTF-8?q?=20do=20usu=C3=A1rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Components/Chat/chatHeader.js | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/Components/Chat/chatHeader.js b/src/Components/Chat/chatHeader.js index dbcef15..fe2d9c3 100644 --- a/src/Components/Chat/chatHeader.js +++ b/src/Components/Chat/chatHeader.js @@ -25,21 +25,22 @@ const chatHeader = props => { /> - - - navigation.navigate("PreviewImage", { - img: userPhoto, - name: userName, - isLoggedIn: true - }) - } - > - {userName} - - {status} - + + navigation.navigate("PreviewImage", { + img: userPhoto, + name: userName, + isLoggedIn: true + }) + } + > + + {userName} + {status} + + Date: Thu, 6 Jun 2019 11:44:07 -0300 Subject: [PATCH 12/18] Efeito na mensagem para ver a lingua original --- src/Components/mensagem.js | 42 ++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/Components/mensagem.js b/src/Components/mensagem.js index 8853bb9..ab7a8da 100644 --- a/src/Components/mensagem.js +++ b/src/Components/mensagem.js @@ -1,6 +1,7 @@ import React, { PureComponent } from "react" import { Svg, Path } from "react-native-svg" -import { View, Text, StyleSheet, TouchableOpacity, Alert } from "react-native" +import { View, Text, StyleSheet, Alert } from "react-native" +import Touchable from "react-native-platform-touchable" import { moderateScale } from "react-native-size-matters" import getColor from "~/functions/getColor" import firebase from "react-native-firebase" @@ -45,7 +46,7 @@ const styles = StyleSheet.create({ marginRight: 10, alignItems: "center" }, - + // Estilo para a mensagem do destinatario dest: { flexDirection: "row", @@ -215,27 +216,28 @@ export default class Mensagem extends PureComponent { // Destinatario message = ( - + + + + + { this.verLinguaOriginal() }} > - - - - - - + {nomeRemetente && ( {nomeRemetente} @@ -243,7 +245,7 @@ export default class Mensagem extends PureComponent { )} {content} - + {date} From e83228dfc77a909ad4bd10e6f158673f6d7569ae Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 6 Jun 2019 12:19:05 -0300 Subject: [PATCH 13/18] Status bar adicionada --- src/Screens/Conversas/conversas.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Screens/Conversas/conversas.js b/src/Screens/Conversas/conversas.js index 85e68bc..511c05f 100644 --- a/src/Screens/Conversas/conversas.js +++ b/src/Screens/Conversas/conversas.js @@ -8,7 +8,8 @@ import { Image, BackHandler, Alert, - AppState + AppState, + StatusBar } from "react-native" import Touchable from "react-native-platform-touchable" import Conversa from "~/Components/Conversa/conversa" @@ -303,6 +304,7 @@ export default class Conversas extends Component { ) return ( + {toolbar} Date: Thu, 6 Jun 2019 13:32:04 -0300 Subject: [PATCH 14/18] =?UTF-8?q?Altera=C3=A7=C3=B5es=20nas=20telas=20de?= =?UTF-8?q?=20idiomas=20e=20perfil?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Components/About/aboutHeader.js | 2 +- src/Components/Chat/chatHeader.js | 2 +- src/Components/Languages/languagesHeader.js | 29 +++++++-------- .../PreviewImage/previewImageHeader.js | 23 ++++++------ src/Components/SearchBar.js | 9 +++-- src/Screens/EditPerfil/editperfil.js | 17 ++------- src/Screens/Languages/languages.js | 37 +++++++++++-------- 7 files changed, 59 insertions(+), 60 deletions(-) diff --git a/src/Components/About/aboutHeader.js b/src/Components/About/aboutHeader.js index bf3b21a..c917f7f 100644 --- a/src/Components/About/aboutHeader.js +++ b/src/Components/About/aboutHeader.js @@ -15,7 +15,7 @@ const aboutHeader = props => { }} hitSlop={{ top: 20, bottom: 20, left: 20, right: 20 }} > - + Sobre diff --git a/src/Components/Chat/chatHeader.js b/src/Components/Chat/chatHeader.js index fe2d9c3..7cacc3f 100644 --- a/src/Components/Chat/chatHeader.js +++ b/src/Components/Chat/chatHeader.js @@ -16,7 +16,7 @@ const chatHeader = props => { onPress={() => navigation.goBack()} > - + { return ( - { const { navigation } = props @@ -15,8 +17,10 @@ const languagesHeader = props => { }} hitSlop={{ top: 20, bottom: 20, left: 20, right: 20 }} > - - + + + + Idiomas @@ -31,23 +35,18 @@ const styles = StyleSheet.create({ fontFamily: "OpenSans" }, headerContent: { - backgroundColor: "#fff", + flexDirection: "row", + alignContent: "center", marginBottom: 15, - marginTop: 15, - paddingLeft: 15, - marginRight: 10, - flexDirection: "row" + marginTop: 15 }, backButton: { - justifyContent: "center" + justifyContent: "center", + width: 40 }, languagesInfo: { - flex: 1, fontSize: 22, - textAlign: "left", - backgroundColor: "#fff", - marginLeft: 20, - paddingRight: 20 + textAlign: "left" } }) diff --git a/src/Components/PreviewImage/previewImageHeader.js b/src/Components/PreviewImage/previewImageHeader.js index 56446fa..63d3b19 100644 --- a/src/Components/PreviewImage/previewImageHeader.js +++ b/src/Components/PreviewImage/previewImageHeader.js @@ -1,12 +1,7 @@ import React from "react" -import { - View, - StyleSheet, - Text, - TouchableOpacity, - StatusBar -} from "react-native" +import { View, StyleSheet, Text, StatusBar } from "react-native" +import Touchable from "react-native-platform-touchable" import { Icon } from "react-native-elements" const previewImageHeader = props => { @@ -17,14 +12,16 @@ const previewImageHeader = props => { - { navigation.goBack() }} hitSlop={{ top: 20, bottom: 20, left: 20, right: 20 }} > - - + + {userName} @@ -44,15 +41,19 @@ const styles = StyleSheet.create({ marginTop: 15, marginRight: 10, paddingLeft: 15, + justifyContent: "center", flexDirection: "row" }, previewImageInfo: { flex: 1, fontSize: 22, - textAlign: "left", + // textAlign: "left", color: "#fff", backgroundColor: "#000", marginLeft: 20 + }, + backButton: { + justifyContent: "center" } }) diff --git a/src/Components/SearchBar.js b/src/Components/SearchBar.js index 53248a3..f2e7209 100644 --- a/src/Components/SearchBar.js +++ b/src/Components/SearchBar.js @@ -9,11 +9,14 @@ const Components = props => { return ( - + diff --git a/src/Screens/EditPerfil/editperfil.js b/src/Screens/EditPerfil/editperfil.js index b90839f..5963bd8 100644 --- a/src/Screens/EditPerfil/editperfil.js +++ b/src/Screens/EditPerfil/editperfil.js @@ -193,13 +193,12 @@ export default class Conversas extends Component { - + Perfil @@ -342,19 +341,14 @@ const styles = StyleSheet.create({ fontFamily: "OpenSans" }, headerContent: { - justifyContent: "space-between", + flexDirection: "row", alignContent: "center", marginBottom: 15, - marginTop: 15, - marginRight: 10, - paddingLeft: 15, - flexDirection: "row" + marginTop: 15 }, perfilInfo: { - flex: 1, fontSize: 22, - textAlign: "left", - marginLeft: 20 + textAlign: "left" }, editImage: { justifyContent: "center", @@ -464,11 +458,8 @@ const styles = StyleSheet.create({ backgroundColor: "#fff" }, back: { - // position: "absolute", justifyContent: "center", width: 40 - // height: 40, - // width: 40 }, editNameContainer: { elevation: 6, diff --git a/src/Screens/Languages/languages.js b/src/Screens/Languages/languages.js index a1206a6..3ac8c37 100644 --- a/src/Screens/Languages/languages.js +++ b/src/Screens/Languages/languages.js @@ -5,10 +5,10 @@ import { Text, FlatList, StyleSheet, - TouchableOpacity, ToastAndroid, BackHandler } from "react-native" +import Touchable from "react-native-platform-touchable" import LanguagesHeader from "~/Components/Languages/languagesHeader" import { CheckBox } from "react-native-elements" import firebase from "react-native-firebase" @@ -105,22 +105,25 @@ export default class Languages extends Component { extraData={this.state} renderItem={({ item, index }) => { return ( - this.changeLanguage(item)} > - {item.name} - - this.changeLanguage(item)} - /> + + {item.name} + + this.changeLanguage(item)} + /> + - + ) }} /> @@ -155,11 +158,13 @@ const styles = StyleSheet.create({ paddingBottom: 10, paddingLeft: 20 }, - buttonStyle: { + touchableStyle: { backgroundColor: "#fff", + marginBottom: 2 + }, + buttonStyle: { flexDirection: "row", alignItems: "center", - marginBottom: 2, paddingLeft: 20 }, checkBoxView: { From 949ced307037c1882405ef5765e194d9e86236d1 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 6 Jun 2019 13:58:51 -0300 Subject: [PATCH 15/18] =?UTF-8?q?Efeito=20de=20clique=20na=20tela=20de=20c?= =?UTF-8?q?onfigura=C3=A7=C3=B5es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Components/Config/configBody.js | 146 ++++++++++++++++------------ 1 file changed, 83 insertions(+), 63 deletions(-) diff --git a/src/Components/Config/configBody.js b/src/Components/Config/configBody.js index 62082c9..cfb211f 100644 --- a/src/Components/Config/configBody.js +++ b/src/Components/Config/configBody.js @@ -3,12 +3,12 @@ import { View, StyleSheet, Text, - TouchableOpacity, ScrollView, Switch, Linking, Share } from "react-native" +import Touchable from "react-native-platform-touchable" import { Icon } from "react-native-elements" import firebase from "react-native-firebase" @@ -46,63 +46,71 @@ export default class configBody extends Component { Conta - { navigation.navigate("LanguagesScreen") }} > - - Idiomas - - + + + Idiomas + + + - + - { navigation.navigate("EditPerfilScreen") }} > - - Perfil - - + + + Perfil + + + - + - - - Notificação - - + + + + Notificação + + + - + Aplicativo - - - Enviar Feedback - + + + + Enviar Feedback + + - { Share.share({ message: @@ -110,39 +118,49 @@ export default class configBody extends Component { }) }} > - - Compartilhar App - + + + Compartilhar App + + - - - Avaliar App - - + + + Avaliar App + + + { Linking.openURL( "https://github.com/ES2-UFPI/Unichat/blob/dev/PRIVACY-POLICY.md" ) }} > - - Política de Privacidade - + + + + Política de Privacidade + + + - { navigation.navigate("AboutScreen") }} > - - Sobre - + + + Sobre + + - + Excluir Conta - + ) @@ -162,17 +180,16 @@ const styles = StyleSheet.create({ }, innerBody: { marginTop: 10, - marginLeft: 30 + marginLeft: 20, + marginRight: 20 }, chevronStyle: { flex: 1, - marginRight: 10, alignItems: "flex-end" }, touchableIcon: { flexDirection: "row", - alignItems: "center", - marginTop: 10 + alignItems: "center" }, touchableStyle: { fontFamily: "OpenSans", @@ -202,5 +219,8 @@ const styles = StyleSheet.create({ borderTopColor: "#dce1ea", borderTopWidth: 2, marginRight: 20 + }, + platformTouchable: { + marginBottom: 5 } }) From 251dad31af77a47411cfc39fa8187ddba4287bf2 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 6 Jun 2019 14:08:01 -0300 Subject: [PATCH 16/18] =?UTF-8?q?Mais=20altera=C3=A7=C3=B5es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Components/About/aboutHeader.js | 20 +++++++++---------- src/Components/Languages/languagesHeader.js | 6 ++++-- .../PreviewImage/previewImageHeader.js | 14 +++++-------- src/Screens/EditPerfil/editperfil.js | 6 ++++-- 4 files changed, 22 insertions(+), 24 deletions(-) diff --git a/src/Components/About/aboutHeader.js b/src/Components/About/aboutHeader.js index c917f7f..d4be29f 100644 --- a/src/Components/About/aboutHeader.js +++ b/src/Components/About/aboutHeader.js @@ -1,13 +1,15 @@ import React from "react" -import { View, StyleSheet, Text, TouchableOpacity } from "react-native" +import { View, StyleSheet, Text } from "react-native" +import Touchable from "react-native-platform-touchable" import { Icon } from "react-native-elements" const aboutHeader = props => { return ( - { const { navigation } = props @@ -16,7 +18,7 @@ const aboutHeader = props => { hitSlop={{ top: 20, bottom: 20, left: 20, right: 20 }} > - + Sobre @@ -31,23 +33,19 @@ const styles = StyleSheet.create({ fontFamily: "OpenSans" }, headerContent: { - backgroundColor: "#fff", marginBottom: 15, marginTop: 15, - marginRight: 10, - paddingLeft: 15, flexDirection: "row" }, backButton: { - justifyContent: "center" + justifyContent: "center", + width: 40, + marginLeft: 10 }, languagesInfo: { - flex: 1, fontSize: 22, textAlign: "left", - backgroundColor: "#fff", - marginLeft: 20, - paddingRight: 20 + marginLeft: 10 } }) diff --git a/src/Components/Languages/languagesHeader.js b/src/Components/Languages/languagesHeader.js index 453e5e5..095aa59 100644 --- a/src/Components/Languages/languagesHeader.js +++ b/src/Components/Languages/languagesHeader.js @@ -42,11 +42,13 @@ const styles = StyleSheet.create({ }, backButton: { justifyContent: "center", - width: 40 + width: 40, + marginLeft: 10 }, languagesInfo: { fontSize: 22, - textAlign: "left" + textAlign: "left", + marginLeft: 10 } }) diff --git a/src/Components/PreviewImage/previewImageHeader.js b/src/Components/PreviewImage/previewImageHeader.js index 63d3b19..db6f9b4 100644 --- a/src/Components/PreviewImage/previewImageHeader.js +++ b/src/Components/PreviewImage/previewImageHeader.js @@ -36,24 +36,20 @@ const styles = StyleSheet.create({ fontFamily: "OpenSans" }, headerContent: { - backgroundColor: "#000", marginBottom: 15, marginTop: 15, - marginRight: 10, - paddingLeft: 15, - justifyContent: "center", + alignContent: "center", flexDirection: "row" }, previewImageInfo: { - flex: 1, fontSize: 22, - // textAlign: "left", color: "#fff", - backgroundColor: "#000", - marginLeft: 20 + marginLeft: 10 }, backButton: { - justifyContent: "center" + justifyContent: "center", + width: 40, + marginLeft: 10 } }) diff --git a/src/Screens/EditPerfil/editperfil.js b/src/Screens/EditPerfil/editperfil.js index 5963bd8..46b66da 100644 --- a/src/Screens/EditPerfil/editperfil.js +++ b/src/Screens/EditPerfil/editperfil.js @@ -348,7 +348,8 @@ const styles = StyleSheet.create({ }, perfilInfo: { fontSize: 22, - textAlign: "left" + textAlign: "left", + marginLeft: 10 }, editImage: { justifyContent: "center", @@ -459,7 +460,8 @@ const styles = StyleSheet.create({ }, back: { justifyContent: "center", - width: 40 + width: 40, + marginLeft: 10 }, editNameContainer: { elevation: 6, From 811bd1b9956bc7f89ab96740da477f9e1a8b1ce9 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 6 Jun 2019 14:57:01 -0300 Subject: [PATCH 17/18] Ajustes finais para melhorar UX --- src/Components/Config/configBody.js | 6 ++++-- src/Screens/Auth/auth.js | 9 ++++++--- src/Screens/EditPerfil/editperfil.js | 1 + src/Screens/PerfilSettings/perfilsettings.js | 7 ++++--- src/Screens/Verification/verification.js | 11 ++++++++--- 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/Components/Config/configBody.js b/src/Components/Config/configBody.js index cfb211f..4a43aa8 100644 --- a/src/Components/Config/configBody.js +++ b/src/Components/Config/configBody.js @@ -1,3 +1,4 @@ +/* eslint-disable react-native/no-inline-styles */ import React, { Component } from "react" import { View, @@ -6,6 +7,7 @@ import { ScrollView, Switch, Linking, + TouchableOpacity, Share } from "react-native" import Touchable from "react-native-platform-touchable" @@ -158,9 +160,9 @@ export default class configBody extends Component { - + Excluir Conta - + ) diff --git a/src/Screens/Auth/auth.js b/src/Screens/Auth/auth.js index 2b103cf..c9241ee 100644 --- a/src/Screens/Auth/auth.js +++ b/src/Screens/Auth/auth.js @@ -235,6 +235,7 @@ export default class Auth extends Component { this.confirmPhone()} disabled={notValid} + style={styles.touchable} > Enviar @@ -316,9 +317,11 @@ const styles = StyleSheet.create({ button: { height: 60, borderRadius: 20, - justifyContent: "center", + justifyContent: "center" + }, + touchable: { + marginTop: 20, marginLeft: 40, - marginRight: 40, - marginTop: 20 + marginRight: 40 } }) diff --git a/src/Screens/EditPerfil/editperfil.js b/src/Screens/EditPerfil/editperfil.js index 46b66da..d6d1249 100644 --- a/src/Screens/EditPerfil/editperfil.js +++ b/src/Screens/EditPerfil/editperfil.js @@ -236,6 +236,7 @@ export default class Conversas extends Component { Digite o email + Configurações de Perfil Email: this.setState({ eMail: text })} placeholder="Digite seu e-mail" @@ -214,7 +215,7 @@ export default class PerfilSettings extends Component { Cadastrar - + ) } } diff --git a/src/Screens/Verification/verification.js b/src/Screens/Verification/verification.js index 5bac6ad..f43aae9 100644 --- a/src/Screens/Verification/verification.js +++ b/src/Screens/Verification/verification.js @@ -86,7 +86,10 @@ export default class Verificacao extends Component { }} /> - this.submitCode()}> + this.submitCode()} + > Verificar @@ -128,8 +131,6 @@ const styles = StyleSheet.create({ fontWeight: "bold" }, button: { - marginLeft: 40, - marginRight: 40, height: 60, borderRadius: 20, justifyContent: "center" @@ -142,5 +143,9 @@ const styles = StyleSheet.create({ alignSelf: "center", fontSize: 25, color: "white" + }, + touchable: { + marginLeft: 40, + marginRight: 40 } }) From 0e7dedeaef4ec6cf2aa3384e6c903bb217147d0f Mon Sep 17 00:00:00 2001 From: Max Lima Date: Thu, 6 Jun 2019 14:59:28 -0300 Subject: [PATCH 18/18] Update conversa.js --- src/Components/Conversa/conversa.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Components/Conversa/conversa.js b/src/Components/Conversa/conversa.js index 5689802..ca41c54 100644 --- a/src/Components/Conversa/conversa.js +++ b/src/Components/Conversa/conversa.js @@ -21,8 +21,8 @@ const conversa = props => { } else if (atualDate.getDate() - date.getDate() >= 2) { textDate = `${date .getDate() - .toString()}/${date - .getMonth() + .toString()}/${(date + .getMonth() + 1) .toString()}/${date.getFullYear().toString()}` } return textDate