diff options
Diffstat (limited to 'src/screens')
| -rw-r--r-- | src/screens/chat/ChatListScreen.tsx | 48 | ||||
| -rw-r--r-- | src/screens/chat/ChatScreen.tsx | 34 | ||||
| -rw-r--r-- | src/screens/chat/index.ts | 2 | ||||
| -rw-r--r-- | src/screens/index.ts | 1 | ||||
| -rw-r--r-- | src/screens/profile/IndividualMoment.tsx | 14 | ||||
| -rw-r--r-- | src/screens/profile/InviteFriendsScreen.tsx | 2 |
6 files changed, 93 insertions, 8 deletions
diff --git a/src/screens/chat/ChatListScreen.tsx b/src/screens/chat/ChatListScreen.tsx new file mode 100644 index 00000000..c49c790d --- /dev/null +++ b/src/screens/chat/ChatListScreen.tsx @@ -0,0 +1,48 @@ +import React from 'react'; +import {View, StyleSheet, Text, TouchableOpacity} from 'react-native'; +import {StackNavigationProp} from '@react-navigation/stack'; + +import {MainStackParams} from '../../routes'; + +type ChatListScreenNavigationProp = StackNavigationProp< + MainStackParams, + 'ChatList' +>; +interface ChatListScreenProps { + navigation: ChatListScreenNavigationProp; +} +/* + * Screen that displays all of the user's active conversations. + */ +const ChatListScreen: React.FC<ChatListScreenProps> = ({navigation}) => { + return ( + <View style={styles.container}> + <Text style={styles.placeholder}>I am the chat list.</Text> + <TouchableOpacity + style={styles.button} + onPress={() => navigation.navigate('Chat')}> + <Text>Let's go to a conversation!</Text> + </TouchableOpacity> + </View> + ); +}; + +const styles = StyleSheet.create({ + container: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + }, + placeholder: { + fontSize: 14, + fontWeight: 'bold', + marginBottom: 10, + }, + button: { + backgroundColor: '#CCE4FC', + padding: 15, + borderRadius: 5, + }, +}); + +export default ChatListScreen; diff --git a/src/screens/chat/ChatScreen.tsx b/src/screens/chat/ChatScreen.tsx new file mode 100644 index 00000000..af83f504 --- /dev/null +++ b/src/screens/chat/ChatScreen.tsx @@ -0,0 +1,34 @@ +import React from 'react'; +import {View, StyleSheet, Text} from 'react-native'; +import {StackNavigationProp} from '@react-navigation/stack'; + +import {MainStackParams} from '../../routes'; + +type ChatScreenNavigationProp = StackNavigationProp<MainStackParams, 'Chat'>; +interface ChatScreenProps { + navigation: ChatScreenNavigationProp; +} +/* + * Screen that displays all of the user's active conversations. + */ +const ChatScreen: React.FC<ChatScreenProps> = () => { + return ( + <View style={styles.container}> + <Text style={styles.placeholder}>I am a chat!</Text> + </View> + ); +}; + +const styles = StyleSheet.create({ + container: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + }, + placeholder: { + fontSize: 14, + fontWeight: 'bold', + }, +}); + +export default ChatScreen; diff --git a/src/screens/chat/index.ts b/src/screens/chat/index.ts new file mode 100644 index 00000000..d2ccb02b --- /dev/null +++ b/src/screens/chat/index.ts @@ -0,0 +1,2 @@ +export {default as ChatListScreen} from './ChatListScreen'; +export {default as ChatScreen} from './ChatScreen'; diff --git a/src/screens/index.ts b/src/screens/index.ts index 50ada3d1..44ae4b52 100644 --- a/src/screens/index.ts +++ b/src/screens/index.ts @@ -5,3 +5,4 @@ export * from './search'; export * from './suggestedPeople'; export * from './suggestedPeopleOnboarding'; export * from './badge'; +export * from './chat'; diff --git a/src/screens/profile/IndividualMoment.tsx b/src/screens/profile/IndividualMoment.tsx index 8c1dc327..871d62bf 100644 --- a/src/screens/profile/IndividualMoment.tsx +++ b/src/screens/profile/IndividualMoment.tsx @@ -27,7 +27,7 @@ interface IndividualMomentProps { navigation: IndividualMomentNavigationProp; } -const ITEM_HEIGHT = SCREEN_HEIGHT * (9 / 10); +const ITEM_HEIGHT = SCREEN_HEIGHT * 0.9; const IndividualMoment: React.FC<IndividualMomentProps> = ({ route, @@ -40,13 +40,13 @@ const IndividualMoment: React.FC<IndividualMomentProps> = ({ ); const { user: {username}, - } = userXId - ? useSelector((state: RootState) => state.userX[screenType][userXId]) - : useSelector((state: RootState) => state.user); + } = useSelector((state: RootState) => + userXId ? state.userX[screenType][userXId] : state.user, + ); - const {moments} = userXId - ? useSelector((state: RootState) => state.userX[screenType][userXId]) - : useSelector((state: RootState) => state.moments); + const {moments} = useSelector((state: RootState) => + userXId ? state.userX[screenType][userXId] : state.moments, + ); const isOwnProfile = username === loggedInUsername; const momentData = moments.filter( diff --git a/src/screens/profile/InviteFriendsScreen.tsx b/src/screens/profile/InviteFriendsScreen.tsx index a9fa1404..ad9e382e 100644 --- a/src/screens/profile/InviteFriendsScreen.tsx +++ b/src/screens/profile/InviteFriendsScreen.tsx @@ -203,7 +203,7 @@ const InviteFriendsScreen: React.FC<InviteFriendsScreenProps> = ({route}) => { </Animated.View> </View> <View style={styles.subheader}> - <Text style={styles.subheaderText}>Contacts on tagg</Text> + <Text style={styles.subheaderText}>Contacts on Tagg</Text> <UsersFromContacts /> </View> <View style={styles.subheader}> |
