Skip to content

Commit ba11ff0

Browse files
committed
chore: code cleaning
1 parent ec0eeda commit ba11ff0

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const GroupChannelSuggestedMentionList = ({
4646

4747
const isLandscape = screenWidth > screenHeight;
4848
const isShortened = isLandscape && keyboard.visible;
49+
const canRenderMembers = members.length > 0;
4950
const maxHeight = isShortened ? screenHeight - (topInset + inputHeight + keyboard.height) : styles.suggestion.height;
5051

5152
const renderLimitGuide = () => {
@@ -58,6 +59,7 @@ const GroupChannelSuggestedMentionList = ({
5859
</View>
5960
);
6061
};
62+
6163
const renderMembers = () => {
6264
return (
6365
<View>
@@ -91,7 +93,7 @@ const GroupChannelSuggestedMentionList = ({
9193
return (
9294
<Pressable
9395
onPress={reset}
94-
pointerEvents={members.length > 0 ? 'auto' : 'none'}
96+
pointerEvents={canRenderMembers ? 'auto' : 'none'}
9597
style={[styles.container, { bottom: inputHeight + bottomInset }]}
9698
>
9799
<ScrollView
@@ -105,14 +107,14 @@ const GroupChannelSuggestedMentionList = ({
105107
backgroundColor: colors.background,
106108
bottom: keyboard.bottomSpace,
107109
},
108-
members.length !== 0 && {
110+
canRenderMembers && {
109111
borderTopWidth: 1,
110112
borderTopColor: colors.onBackground04,
111113
},
112114
]}
113115
contentContainerStyle={{ paddingLeft: left, paddingRight: right }}
114116
>
115-
{conditionChaining([searchLimited, members.length !== 0], [renderLimitGuide(), renderMembers(), null])}
117+
{conditionChaining([searchLimited, canRenderMembers], [renderLimitGuide(), renderMembers(), null])}
116118
</ScrollView>
117119
</Pressable>
118120
);

packages/uikit-react-native/src/domain/groupChannel/module/createGroupChannelModule.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const createGroupChannelModule = ({
2121
Header,
2222
MessageList,
2323
Input,
24-
SuggestedMentionList: SuggestedMentionList,
24+
SuggestedMentionList,
2525
StatusEmpty,
2626
StatusLoading,
2727
Provider,

0 commit comments

Comments
 (0)