-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* hooks webln * no return bot type to fix build * fork pixel quests art peace example * fix limit feed + bookmark profile * typo * lint fix * lint fix
- Loading branch information
Showing
73 changed files
with
2,246 additions
and
879 deletions.
There are no files selected for viewing
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
71 changes: 38 additions & 33 deletions
71
apps/mobile/src/components/PrivateMessages/Chat/index.tsx
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 |
---|---|---|
@@ -1,42 +1,47 @@ | ||
import React from 'react'; | ||
import { ConversationType } from '../../../types/messages'; | ||
import { useStyles } from '../../../hooks'; | ||
import { View, Image, Text } from 'react-native'; | ||
import { MessageInput } from '../PrivateMessageInput'; | ||
import { MessagesList } from '../MessagesList.tsx'; | ||
import {Image, Text, View} from 'react-native'; | ||
|
||
import {useStyles} from '../../../hooks'; | ||
import {ConversationType} from '../../../types/messages'; | ||
import {IconButton} from '../../IconButton'; | ||
import {MessagesList} from '../MessagesList.tsx'; | ||
import {MessageInput} from '../PrivateMessageInput'; | ||
import stylesheet from './styles'; | ||
import { IconButton } from '../../IconButton'; | ||
|
||
export type ChatProps = { | ||
conversation: ConversationType; | ||
handleGoBack: () => void; | ||
conversation: ConversationType; | ||
handleGoBack: () => void; | ||
}; | ||
|
||
export const Chat: React.FC<ChatProps> = ({ conversation, handleGoBack }) => { | ||
|
||
const styles = useStyles(stylesheet); | ||
const user = conversation.user; | ||
const avatar = user.avatar ? {uri: user.avatar } : require('../../../assets/pepe-logo.png'); | ||
export const Chat: React.FC<ChatProps> = ({conversation, handleGoBack}) => { | ||
const styles = useStyles(stylesheet); | ||
const user = conversation.user; | ||
const avatar = user.avatar ? {uri: user.avatar} : require('../../../assets/pepe-logo.png'); | ||
|
||
const handleSendMessage = (message: string) => { | ||
//todo: integrate hook here | ||
//todo: encrypt message | ||
//todo: send message | ||
}; | ||
const handleSendMessage = (message: string) => { | ||
//todo: integrate hook here | ||
//todo: encrypt message | ||
//todo: send message | ||
}; | ||
|
||
return ( | ||
<> | ||
<View style={styles.header}> | ||
<IconButton icon="ChevronLeftIcon" size={20} onPress={handleGoBack} style={styles.backButton} /> | ||
<View style={styles.headerContent}> | ||
<Image source={avatar} style={styles.avatar} /> | ||
<Text style={styles.name}>{user.name}</Text> | ||
</View> | ||
</View> | ||
<View style={styles.container}> | ||
<MessagesList messages={conversation.messages} /> | ||
<MessageInput onSend={handleSendMessage} /> | ||
</View> | ||
</> | ||
); | ||
return ( | ||
<> | ||
<View style={styles.header}> | ||
<IconButton | ||
icon="ChevronLeftIcon" | ||
size={20} | ||
onPress={handleGoBack} | ||
style={styles.backButton} | ||
/> | ||
<View style={styles.headerContent}> | ||
<Image source={avatar} style={styles.avatar} /> | ||
<Text style={styles.name}>{user.name}</Text> | ||
</View> | ||
</View> | ||
<View style={styles.container}> | ||
<MessagesList messages={conversation.messages} /> | ||
<MessageInput onSend={handleSendMessage} /> | ||
</View> | ||
</> | ||
); | ||
}; |
66 changes: 33 additions & 33 deletions
66
apps/mobile/src/components/PrivateMessages/Chat/styles.ts
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 |
---|---|---|
@@ -1,36 +1,36 @@ | ||
import { ThemedStyleSheet } from "../../../styles"; | ||
import {ThemedStyleSheet} from '../../../styles'; | ||
|
||
export default ThemedStyleSheet((theme) => ({ | ||
container: { | ||
flex: 1, | ||
backgroundColor: theme.colors.background, | ||
}, | ||
header: { | ||
padding: 10, | ||
borderBottomWidth: 1, | ||
borderBottomColor: theme.colors.divider, | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
position: 'relative', | ||
}, | ||
headerContent: { | ||
flex: 1, | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}, | ||
backButton: { | ||
position: 'absolute', | ||
left: 10, | ||
}, | ||
avatar: { | ||
width: 50, | ||
height: 50, | ||
borderRadius: 25, | ||
marginBottom: 5, | ||
}, | ||
name: { | ||
fontSize: 16, | ||
fontWeight: 'bold', | ||
color: theme.colors.text, | ||
}, | ||
container: { | ||
flex: 1, | ||
backgroundColor: theme.colors.background, | ||
}, | ||
header: { | ||
padding: 10, | ||
borderBottomWidth: 1, | ||
borderBottomColor: theme.colors.divider, | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
position: 'relative', | ||
}, | ||
headerContent: { | ||
flex: 1, | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}, | ||
backButton: { | ||
position: 'absolute', | ||
left: 10, | ||
}, | ||
avatar: { | ||
width: 50, | ||
height: 50, | ||
borderRadius: 25, | ||
marginBottom: 5, | ||
}, | ||
name: { | ||
fontSize: 16, | ||
fontWeight: 'bold', | ||
color: theme.colors.text, | ||
}, | ||
})); |
36 changes: 18 additions & 18 deletions
36
apps/mobile/src/components/PrivateMessages/Conversation/index.tsx
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 |
---|---|---|
@@ -1,28 +1,28 @@ | ||
import React from 'react'; | ||
import { Pressable, View, Text, Image } from 'react-native'; | ||
import {Image, Pressable, Text, View} from 'react-native'; | ||
|
||
import {useStyles} from '../../../hooks'; | ||
import {ConversationType} from '../../../types/messages'; | ||
import stylesheet from './styles'; | ||
import { useStyles } from '../../../hooks'; | ||
import { ConversationType } from '../../../types/messages'; | ||
|
||
export type ConversationPreviewProps = { | ||
conversation: ConversationType; | ||
onPressed: () => void; | ||
conversation: ConversationType; | ||
onPressed: () => void; | ||
}; | ||
|
||
export const Conversation: React.FC<ConversationPreviewProps> = ({conversation, onPressed}) => { | ||
const styles = useStyles(stylesheet); | ||
|
||
const styles = useStyles(stylesheet); | ||
|
||
const user = conversation.user; | ||
const avatar = user.avatar ? {uri: user.avatar } : require('../../../assets/pepe-logo.png'); | ||
const user = conversation.user; | ||
const avatar = user.avatar ? {uri: user.avatar} : require('../../../assets/pepe-logo.png'); | ||
|
||
return ( | ||
<Pressable style={styles.container} onPress={onPressed}> | ||
<Image source={avatar} style={styles.avatar} /> | ||
<View style={styles.textContainer}> | ||
<Text style={styles.name}>{user.name}</Text> | ||
<Text style={styles.handle}>{user.handle}</Text> | ||
</View> | ||
</Pressable> | ||
); | ||
return ( | ||
<Pressable style={styles.container} onPress={onPressed}> | ||
<Image source={avatar} style={styles.avatar} /> | ||
<View style={styles.textContainer}> | ||
<Text style={styles.name}>{user.name}</Text> | ||
<Text style={styles.handle}>{user.handle}</Text> | ||
</View> | ||
</Pressable> | ||
); | ||
}; |
Oops, something went wrong.