-
Notifications
You must be signed in to change notification settings - Fork 0
feat:conversation screen layout and styling #217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
GitchalWoo
merged 5 commits into
main
from
feature/MPT-18950/conversation-screen-layout-and-styling
Mar 13, 2026
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c34f0f8
Conversation screen layout and styling
Tania-Roche-SWO 6f0a308
Merge branch 'main' into feature/MPT-18950/conversation-screen-layout…
Tania-Roche-SWO 25edb70
Fixing merge conflicts - adding code back
Tania-Roche-SWO 0b660b7
Fixing lint errors caused by any type in mock data
Tania-Roche-SWO 0126d03
Addressing PR comments
Tania-Roche-SWO File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,12 @@ | ||
| import { Path } from 'react-native-svg'; | ||
|
|
||
| const ArrowUpwardOutlined = ({ color }: { color: string }) => ( | ||
| <> | ||
| <Path | ||
| d="M450-180v-485.08L222.15-437.23 180-480l300-300 300 300-42.15 42.77L510-665.08V-180h-60Z" | ||
| fill={color} | ||
| /> | ||
| </> | ||
| ); | ||
|
|
||
| export default ArrowUpwardOutlined; |
This file contains hidden or 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,12 @@ | ||
| import { Path } from 'react-native-svg'; | ||
|
|
||
| const AttachFileOutlined = ({ color }: { color: string }) => ( | ||
| <> | ||
| <Path | ||
| d="M706.92-334.23q0 97.46-67.81 165.84Q571.31-100 474.23-100q-97.46 0-165.46-68.39-68-68.38-68-165.84v-359.62q0-69.23 48.08-117.69Q336.92-860 406.15-860q69.23 0 117.31 48.46t48.08 117.69v340.39q0 40.61-28.35 69.34-28.34 28.73-68.96 28.73-40.61 0-69.34-28.53-28.73-28.54-28.73-69.54v-351.15h59.99v351.15q0 16.08 10.81 27.08t26.89 11q16.07 0 26.88-11 10.81-11 10.81-27.08v-340.77q-.62-44.31-30.85-75.04Q450.46-800 406.15-800q-44.3 0-74.84 30.92-30.54 30.93-30.54 75.23v359.62q-.62 72.54 50.15 123.38Q401.69-160 474.23-160q71.54 0 121.5-50.85 49.96-50.84 51.19-123.38v-370.38h60v370.38Z" | ||
| fill={color} | ||
| /> | ||
| </> | ||
| ); | ||
|
|
||
| export default AttachFileOutlined; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,62 @@ | ||
| import { OutlinedIcons } from '@assets/icons'; | ||
| import { View, TextInput, StyleSheet } from 'react-native'; | ||
|
|
||
| import OutlinedIcon from '@/components/common/OutlinedIcon'; | ||
| import { buttonStyle, Color, inputStyle, chatStyle } from '@/styles'; | ||
|
|
||
| type Props = { | ||
| value: string; | ||
| onChangeText: (text: string) => void; | ||
| onSend: () => void; | ||
| }; | ||
|
|
||
| const ChatConversationFooter = ({ value, onChangeText, onSend }: Props) => { | ||
| return ( | ||
| <View style={styles.inputContainer}> | ||
| <View style={styles.iconContainer}> | ||
| <OutlinedIcon | ||
| name={'attach-file' as keyof typeof OutlinedIcons} | ||
| color={Color.brand.primary} | ||
| size={24} | ||
| /> | ||
| </View> | ||
|
|
||
| <View style={styles.textInputWrapper}> | ||
| <TextInput | ||
| placeholder="Type a message" | ||
Tania-Roche-SWO marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| style={styles.input} | ||
| value={value} | ||
| onChangeText={onChangeText} | ||
| onSubmitEditing={onSend} | ||
| returnKeyType="send" | ||
| multiline | ||
| scrollEnabled | ||
| /> | ||
| </View> | ||
|
|
||
| <View style={styles.buttonPrimaryIconOnly}> | ||
| <OutlinedIcon | ||
| name={'arrow-upward' as keyof typeof OutlinedIcons} | ||
| color={Color.brand.white} | ||
| size={24} | ||
| /> | ||
| </View> | ||
| </View> | ||
| ); | ||
| }; | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| textInputWrapper: chatStyle.textInputWrapper, | ||
| iconContainer: chatStyle.iconContainer, | ||
| inputContainer: chatStyle.inputContainer, | ||
| input: { | ||
| ...inputStyle.container, | ||
| ...inputStyle.inputChat, | ||
| }, | ||
| buttonPrimaryIconOnly: { | ||
| ...buttonStyle.primary, | ||
| ...buttonStyle.primaryIconOnly, | ||
| }, | ||
| }); | ||
|
|
||
| export default ChatConversationFooter; | ||
This file contains hidden or 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,66 @@ | ||
| import { useMemo } from 'react'; | ||
| import { View, Text, StyleSheet } from 'react-native'; | ||
|
|
||
| import OutlinedIcon from '../common/OutlinedIcon'; | ||
|
|
||
| import Avatar from '@/components/avatar/Avatar'; | ||
| import { chatMessageStyle } from '@/styles/components'; | ||
| import { Color } from '@/styles/tokens'; | ||
Tania-Roche-SWO marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| import type { Message, MessageType } from '@/types/chat'; | ||
| import { formatDateForChat, getTime } from '@/utils/formatting'; | ||
|
|
||
| type Props = { | ||
| message: Message; | ||
| currentUserId: string; | ||
| locale: string; | ||
| }; | ||
|
|
||
| const ChatMessage = ({ message, currentUserId, locale }: Props) => { | ||
| const isOwn = message.identity.id === currentUserId; | ||
| const type: MessageType = isOwn ? 'own' : 'other'; | ||
| const messageDate = formatDateForChat(message.audit.created?.at, locale); | ||
| const messageTime = getTime(message.audit.created?.at || ''); | ||
|
|
||
| const styles = useMemo( | ||
| () => | ||
| StyleSheet.create({ | ||
| /* eslint-disable react-native/no-unused-styles */ | ||
| container: chatMessageStyle[type].container, | ||
| messageWrapper: chatMessageStyle.messageWrapper, | ||
| textContainer: chatMessageStyle[type].textContainer, | ||
| text: chatMessageStyle[type].text, | ||
| info: chatMessageStyle[type].info, | ||
| infoText: chatMessageStyle.infoText, | ||
| avatarWrapper: chatMessageStyle.avatarWrapper, | ||
| }), | ||
| [type], | ||
| ); | ||
|
|
||
| const avatarId = message.identity.id; | ||
| const avatarPath = message.identity?.icon; | ||
|
|
||
| return ( | ||
| <View style={styles.container}> | ||
| {!isOwn && ( | ||
| <View style={styles.avatarWrapper}> | ||
| <Avatar id={avatarId} imagePath={avatarPath} variant="small" /> | ||
| </View> | ||
| )} | ||
| <View style={styles.messageWrapper}> | ||
| <View style={styles.info}> | ||
| {!isOwn && <Text style={styles.infoText}>{message.sender.identity.name}</Text>} | ||
| {messageDate !== messageTime && <Text style={styles.infoText}>{messageDate}</Text>} | ||
| <Text style={styles.infoText}>{messageTime}</Text> | ||
| <Text> | ||
Tania-Roche-SWO marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| {isOwn && <OutlinedIcon name="more-horiz" size={16} color={Color.brand.type} />} | ||
| </Text> | ||
| </View> | ||
| <View style={styles.textContainer}> | ||
| <Text style={styles.text}>{message.content}</Text> | ||
| </View> | ||
| </View> | ||
| </View> | ||
| ); | ||
| }; | ||
|
|
||
| export default ChatMessage; | ||
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.