Skip to content

Commit 5f7c6af

Browse files
committed
feat: added showUserId config to suggested mention list
1 parent b021c59 commit 5f7c6af

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

packages/uikit-react-native/src/components/ChannelInput/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ export type SuggestedMentionListProps = {
3737
inputHeight: number;
3838
onPressToMention: (user: SendbirdMember, searchStringRange: Range) => void;
3939
mentionedUsers: MentionedUser[];
40+
/**
41+
* Whether to show user id information on each item.
42+
* */
43+
showUserId?: boolean;
4044
};
4145

4246
export type ChannelInputProps = {

packages/uikit-react-native/src/domain/groupChannel/component/GroupChannelSuggestedMentionList.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const GroupChannelSuggestedMentionList = ({
2626
bottomInset,
2727
onPressToMention,
2828
mentionedUsers,
29+
showUserId = true,
2930
}: GroupChannelProps['SuggestedMentionList']) => {
3031
const { width: screenWidth, height: screenHeight } = useWindowDimensions();
3132
const { channel } = useContext(GroupChannelContexts.Fragment);
@@ -79,9 +80,11 @@ const GroupChannelSuggestedMentionList = ({
7980
<Text body2 color={colors.onBackground01} numberOfLines={1} style={styles.userNickname}>
8081
{member.nickname || STRINGS.LABELS.USER_NO_NAME}
8182
</Text>
82-
<Text body3 color={colors.onBackground03} numberOfLines={1} style={styles.userId}>
83-
{member.userId}
84-
</Text>
83+
{!!showUserId && (
84+
<Text body3 color={colors.onBackground03} numberOfLines={1} style={styles.userId}>
85+
{member.userId}
86+
</Text>
87+
)}
8588
<Divider style={{ position: 'absolute', bottom: 0 }} />
8689
</Box>
8790
</Pressable>

packages/uikit-react-native/src/domain/groupChannelThread/component/GroupChannelThreadSuggestedMentionList.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const GroupChannelThreadSuggestedMentionList = ({
2525
bottomInset,
2626
onPressToMention,
2727
mentionedUsers,
28+
showUserId = true,
2829
}: GroupChannelThreadProps['SuggestedMentionList']) => {
2930
const { width: screenWidth, height: screenHeight } = useWindowDimensions();
3031
const { channel } = useContext(GroupChannelThreadContexts.Fragment);
@@ -78,9 +79,11 @@ const GroupChannelThreadSuggestedMentionList = ({
7879
<Text body2 color={colors.onBackground01} numberOfLines={1} style={styles.userNickname}>
7980
{member.nickname || STRINGS.LABELS.USER_NO_NAME}
8081
</Text>
81-
<Text body3 color={colors.onBackground03} numberOfLines={1} style={styles.userId}>
82-
{member.userId}
83-
</Text>
82+
{!!showUserId && (
83+
<Text body3 color={colors.onBackground03} numberOfLines={1} style={styles.userId}>
84+
{member.userId}
85+
</Text>
86+
)}
8487
<Divider style={{ position: 'absolute', bottom: 0 }} />
8588
</View>
8689
</Pressable>

0 commit comments

Comments
 (0)