diff --git a/src/components/Chat.js b/src/components/Chat.js index 041f5a8..55f62df 100644 --- a/src/components/Chat.js +++ b/src/components/Chat.js @@ -21,6 +21,9 @@ export default class Chat extends React.Component { }); }); } + componentWillUnmount() { + Backend.closeChat(); + } render() { return ( diff --git a/src/libs/Backend.js b/src/libs/Backend.js index 3d78d49..d6b1c2e 100644 --- a/src/libs/Backend.js +++ b/src/libs/Backend.js @@ -12,10 +12,10 @@ class Backend { } init() { firebase.initializeApp({ - apiKey: 'AIzaSyBgsuwd_NGUlrYvE1zkJEdQeWCgtIb6paE', - authDomain: 'slackrn-8aa2a.firebaseapp.com', - databaseURL: 'https://slackrn-8aa2a.firebaseio.com', - storageBucket: 'slackrn-8aa2a.appspot.com', + apiKey: 'AIzaSyAiuvZgc9iLMezprc5zYLBw9PsrgRkXjrE', + authDomain: 'meetupchat-dbce1.firebaseapp.com', + databaseURL: 'https://meetupchat-dbce1.firebaseio.com', + storageBucket: 'meetupchat-dbce1.appspot.com', }); firebase.auth().onAuthStateChanged((user) => { if (user) { @@ -54,6 +54,11 @@ class Backend { }); } } + closeChat() { + if (this.messagesRef) { + this.messagesRef.off(); + } + } } export default new Backend(); diff --git a/src/libs/Layout.js b/src/libs/Layout.js index c73a2cc..1ad0be7 100644 --- a/src/libs/Layout.js +++ b/src/libs/Layout.js @@ -9,6 +9,9 @@ import { import { Bubble, Send } from 'react-native-gifted-chat'; +const mainColor = '#7768B8'; +const darkColor = '#534395'; + const screen = { flex: 1, paddingTop: Platform.OS === 'ios' ? 64 : 54, @@ -17,12 +20,12 @@ const screen = { export default { homeContainer: { ...screen, - backgroundColor: '#019DE6', + backgroundColor: mainColor, paddingTop: Platform.OS === 'ios' ? 22 : 0, }, channelsContainer: { ...screen, - backgroundColor: '#50364D', + backgroundColor: mainColor, }, chatContainer: { ...screen, @@ -30,18 +33,15 @@ export default { }, navigationBar: { navigationBarStyle: { - backgroundColor: '#422E41', + backgroundColor: darkColor, borderBottomWidth: 0, }, titleStyle: { - color: '#826F81', + color: '#FFFFFF', fontSize: 13, fontWeight: '600', fontFamily: 'Lato-Semibold', - marginTop: Platform.select({ - ios: 12, - android: 14, - }), + lineHeight: 18, }, }, textInput: { @@ -56,7 +56,7 @@ export default { marginRight: 15, fontFamily: 'Lato-Semibold', }, - placeholderTextColor: '#71CBF9', + placeholderTextColor: '#A89ED1', clearButtonMode: 'while-editing', underlineColorAndroid: 'transparent', }, @@ -91,8 +91,8 @@ export default { {...props} wrapperStyle={{ right: { - backgroundColor: '#50364D' - } + backgroundColor: mainColor, + }, }} /> @@ -101,7 +101,7 @@ export default { renderAvatar(props) { return ( );