Skip to content
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

[CLNP-5902] feat: added showUserId config to suggested mention list #220

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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