Skip to content

Commit

Permalink
update colors
Browse files Browse the repository at this point in the history
  • Loading branch information
FaridSafi committed Sep 4, 2016
1 parent ac8f974 commit 30b321a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
3 changes: 3 additions & 0 deletions src/components/Chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export default class Chat extends React.Component {
});
});
}
componentWillUnmount() {
Backend.closeChat();
}
render() {
return (
<View style={Layout.chatContainer}>
Expand Down
13 changes: 9 additions & 4 deletions src/libs/Backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -54,6 +54,11 @@ class Backend {
});
}
}
closeChat() {
if (this.messagesRef) {
this.messagesRef.off();
}
}
}

export default new Backend();
26 changes: 13 additions & 13 deletions src/libs/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -17,31 +20,28 @@ const screen = {
export default {
homeContainer: {
...screen,
backgroundColor: '#019DE6',
backgroundColor: mainColor,
paddingTop: Platform.OS === 'ios' ? 22 : 0,
},
channelsContainer: {
...screen,
backgroundColor: '#50364D',
backgroundColor: mainColor,
},
chatContainer: {
...screen,
backgroundColor: '#FFFFFF',
},
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: {
Expand All @@ -56,7 +56,7 @@ export default {
marginRight: 15,
fontFamily: 'Lato-Semibold',
},
placeholderTextColor: '#71CBF9',
placeholderTextColor: '#A89ED1',
clearButtonMode: 'while-editing',
underlineColorAndroid: 'transparent',
},
Expand Down Expand Up @@ -91,8 +91,8 @@ export default {
{...props}
wrapperStyle={{
right: {
backgroundColor: '#50364D'
}
backgroundColor: mainColor,
},
}}
/>
</View>
Expand All @@ -101,7 +101,7 @@ export default {
renderAvatar(props) {
return (
<Image
source={{uri: `https://firebasestorage.googleapis.com/v0/b/slackrn-8aa2a.appspot.com/o/${props.currentMessage.user.avatar.replace('/', '%2F')}?alt=media`}}
source={{uri: `https://firebasestorage.googleapis.com/v0/b/meetupchat-dbce1.appspot.com/o/${props.currentMessage.user.avatar.replace('/', '%2F')}?alt=media`}}
style={{
height: 36,
width: 36,
Expand All @@ -126,7 +126,7 @@ export default {
<Send
{...props}
textStyle={{
color: '#50364D',
color: darkColor,
}}
/>
);
Expand Down

0 comments on commit 30b321a

Please sign in to comment.