Skip to content

Commit

Permalink
Merge pull request #220 from sendbird/feat/mention-list-showUserId
Browse files Browse the repository at this point in the history
[CLNP-5902] feat: added showUserId config to suggested mention list
  • Loading branch information
bang9 authored Nov 28, 2024
2 parents b021c59 + 5f7c6af commit f229033
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export type SuggestedMentionListProps = {
inputHeight: number;
onPressToMention: (user: SendbirdMember, searchStringRange: Range) => void;
mentionedUsers: MentionedUser[];
/**
* Whether to show user id information on each item.
* */
showUserId?: boolean;
};

export type ChannelInputProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const GroupChannelSuggestedMentionList = ({
bottomInset,
onPressToMention,
mentionedUsers,
showUserId = true,
}: GroupChannelProps['SuggestedMentionList']) => {
const { width: screenWidth, height: screenHeight } = useWindowDimensions();
const { channel } = useContext(GroupChannelContexts.Fragment);
Expand Down Expand Up @@ -79,9 +80,11 @@ const GroupChannelSuggestedMentionList = ({
<Text body2 color={colors.onBackground01} numberOfLines={1} style={styles.userNickname}>
{member.nickname || STRINGS.LABELS.USER_NO_NAME}
</Text>
<Text body3 color={colors.onBackground03} numberOfLines={1} style={styles.userId}>
{member.userId}
</Text>
{!!showUserId && (
<Text body3 color={colors.onBackground03} numberOfLines={1} style={styles.userId}>
{member.userId}
</Text>
)}
<Divider style={{ position: 'absolute', bottom: 0 }} />
</Box>
</Pressable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const GroupChannelThreadSuggestedMentionList = ({
bottomInset,
onPressToMention,
mentionedUsers,
showUserId = true,
}: GroupChannelThreadProps['SuggestedMentionList']) => {
const { width: screenWidth, height: screenHeight } = useWindowDimensions();
const { channel } = useContext(GroupChannelThreadContexts.Fragment);
Expand Down Expand Up @@ -78,9 +79,11 @@ const GroupChannelThreadSuggestedMentionList = ({
<Text body2 color={colors.onBackground01} numberOfLines={1} style={styles.userNickname}>
{member.nickname || STRINGS.LABELS.USER_NO_NAME}
</Text>
<Text body3 color={colors.onBackground03} numberOfLines={1} style={styles.userId}>
{member.userId}
</Text>
{!!showUserId && (
<Text body3 color={colors.onBackground03} numberOfLines={1} style={styles.userId}>
{member.userId}
</Text>
)}
<Divider style={{ position: 'absolute', bottom: 0 }} />
</View>
</Pressable>
Expand Down

0 comments on commit f229033

Please sign in to comment.