-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
189 additions
and
30 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import React from 'react' | ||
import { TextInput, View, StyleSheet, Dimensions, Platform, TouchableOpacity } from 'react-native' | ||
import { ChatSendButton } from './CustomButtons' | ||
import { Smile, Image } from "react-native-feather"; | ||
|
||
interface ChatInputProps { | ||
value?: string, | ||
onChangeText?: (text: string) => void | ||
invalid?: boolean, | ||
onSend?: () => void, | ||
} | ||
|
||
export const ChatScreenFooter: React.FC<ChatInputProps> = ({ value, onChangeText, onSend }) => { | ||
|
||
|
||
|
||
return ( | ||
<View style={styles.container}> | ||
<View style={styles.iconContainer}> | ||
<TouchableOpacity> | ||
<Image color={"black"} strokeWidth={1.8} style={styles.icons}/> | ||
</TouchableOpacity> | ||
<TouchableOpacity> | ||
<Smile color={"black"} strokeWidth={1.8} style={styles.icons}/> | ||
</TouchableOpacity> | ||
</View> | ||
<TextInput | ||
placeholder='Say Something...' | ||
multiline={true} | ||
value={value} | ||
onChangeText={onChangeText} | ||
maxLength={500} | ||
style={styles.messageInput}/> | ||
<View style={styles.sendButtonContainer}> | ||
<ChatSendButton onPress={(onSend)} /> | ||
</View> | ||
</View> | ||
) | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
|
||
container: { | ||
flexDirection: 'row', | ||
flex: 1, | ||
alignItems: 'center', | ||
borderColor: "#8E8E8E", | ||
borderWidth: 1, | ||
borderRadius: Dimensions.get('window').width * 0.058, | ||
marginHorizontal: Dimensions.get('window').width * 0.005, | ||
marginBottom: Platform.OS === 'ios' ? 0 : 5, | ||
minHeight: Dimensions.get('window').width * 0.113, | ||
maxHeight: Dimensions.get('window').width * 0.3, | ||
}, | ||
messageInput: { | ||
fontSize: 16, | ||
flex: 1, | ||
marginBottom: Platform.OS === 'ios' ? 5 : 4, | ||
marginTop: Platform.OS === 'ios' ? 2 : 4, | ||
marginHorizontal: Dimensions.get('window').width * 0.018, | ||
|
||
|
||
}, | ||
icons: { | ||
marginHorizontal: Dimensions.get('window').width * 0.008, | ||
}, | ||
iconContainer: { | ||
marginLeft: Dimensions.get('window').width * 0.02, | ||
marginBottom: Dimensions.get('window').width * 0.025, | ||
marginTop: Dimensions.get('window').width * 0.025, | ||
flexDirection: 'row', | ||
alignItems: "flex-end", | ||
justifyContent: "flex-end", | ||
alignSelf: "stretch", | ||
|
||
|
||
}, | ||
sendButtonContainer: { | ||
alignItems: "flex-end", | ||
justifyContent: "flex-end", | ||
flexDirection: "row", | ||
alignSelf: "stretch", | ||
marginRight: Dimensions.get('window').width * 0.01, | ||
marginBottom: Dimensions.get('window').width * 0.01, | ||
marginTop: Dimensions.get('window').width * 0.01, | ||
} | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ export interface Message { | |
lon: number | ||
geohash?: string | ||
} | ||
visibleToUids?: Array<string> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const admin = require('firebase-admin'); | ||
const serviceAccount = require("../../.firebase-secrets.json"); | ||
|
||
export const adminApp = admin.initializeApp({ | ||
credential: admin.credential.cert(serviceAccount), | ||
}); | ||
|
||
export const db = admin.firestore(); | ||
export const connectedUsersCollection = db.collection('ConnectedUsers'); | ||
export const messagesCollection = db.collection('Messages'); | ||
|
||
console.log("[FIREBASE] Firestore synced.") | ||
|
||
// TODO: refactor file name to 'firebase' for accuracy. | ||
// TODO: move key info to .env |