-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[MentionsV2] Room mentions suggestions #39697
Merged
rlinoz
merged 15 commits into
Expensify:main
from
software-mansion-labs:39532-mentionsV2-roomMentionsSuggestions
Apr 12, 2024
Merged
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
1ec5cc3
make icons optional inside mentions render component
robertKozik f9635d0
implement room mentions suggestions
robertKozik d411dfe
Merge remote-tracking branch 'upstream/main' into 39532-mentionsV2-ro…
robertKozik 23b1e92
adress review comments
robertKozik 8a0a9ad
Merge remote-tracking branch 'upstream/main' into 39532-mentionsV2-ro…
robertKozik 398b32f
use canReportBeMentionedWithinPolicy function
robertKozik 3c6ff59
additional review changes (typos & variable name changes)
robertKozik 5dfe2b5
Update update policyID comment
robertKozik 1af1b58
run prettier
robertKozik 8836cf2
generalize mention type to be less user specific
robertKozik f834530
sort room mentions
robertKozik 45cd559
prettier
robertKozik 117a093
update mentions comments
robertKozik 1a6cfa9
Merge branch 'main' into 39532-mentionsV2-roomMentionsSuggestions
robertKozik 8b64eb2
Make capitalization consistent
robertKozik 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 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 |
---|---|---|
|
@@ -12,17 +12,17 @@ import Avatar from './Avatar'; | |
import Text from './Text'; | ||
|
||
type Mention = { | ||
/** Display name of the user */ | ||
/** Display name of the mention */ | ||
text: string; | ||
|
||
/** The formatted email/phone number of the user */ | ||
/** The formatted text of the mention */ | ||
alternateText: string; | ||
|
||
/** Email/phone number of the user */ | ||
login?: string; | ||
/** handle of the mention */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not totally understanding from these prop descriptions what the difference between text, alternateText, and handle is. Maybe we could make these comments a bit more descriptive? |
||
handle?: string; | ||
|
||
/** Array of icons of the user. We use the first element of this array */ | ||
icons: Icon[]; | ||
/** Array of icons of the user. If present, we use the first element of this array. For room suggestions, the icons are not used */ | ||
icons?: Icon[]; | ||
}; | ||
|
||
type MentionSuggestionsProps = { | ||
|
@@ -67,16 +67,18 @@ function MentionSuggestions({prefix, mentions, highlightedMentionIndex = 0, onSe | |
|
||
return ( | ||
<View style={[styles.autoCompleteSuggestionContainer, styles.ph2]}> | ||
<View style={styles.mentionSuggestionsAvatarContainer}> | ||
<Avatar | ||
source={item.icons[0].source} | ||
size={isIcon ? CONST.AVATAR_SIZE.MENTION_ICON : CONST.AVATAR_SIZE.SMALLER} | ||
name={item.icons[0].name} | ||
type={item.icons[0].type} | ||
fill={isIcon ? theme.success : undefined} | ||
fallbackIcon={item.icons[0].fallbackIcon} | ||
/> | ||
</View> | ||
{item.icons && !!item.icons.length && ( | ||
<View style={styles.mentionSuggestionsAvatarContainer}> | ||
<Avatar | ||
source={item.icons[0].source} | ||
size={isIcon ? CONST.AVATAR_SIZE.MENTION_ICON : CONST.AVATAR_SIZE.SMALLER} | ||
name={item.icons[0].name} | ||
type={item.icons[0].type} | ||
fill={isIcon ? theme.success : undefined} | ||
fallbackIcon={item.icons[0].fallbackIcon} | ||
/> | ||
</View> | ||
)} | ||
<Text | ||
style={[styles.mentionSuggestionsText, styles.flexShrink1]} | ||
numberOfLines={1} | ||
|
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think? Actually not sure.