Skip to content

Commit 9027aaf

Browse files
committed
chore: apply rtl to several components
1 parent ce246ee commit 9027aaf

File tree

5 files changed

+65
-30
lines changed

5 files changed

+65
-30
lines changed

packages/uikit-react-native/src/components/MessageSearchResultItem.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const MessageSearchResultItem: MessageSearchProps['List']['renderSearchResultIte
3232

3333
<Box flex={1} paddingEnd={16}>
3434
<Box style={styles.titleLine}>
35-
<Box flex={1} marginEnd={4} justifyContent={'center'}>
35+
<Box flex={1} marginEnd={4} justifyContent={'center'} alignItems={'flex-start'}>
3636
<Text subtitle2 color={colors.onBackground01} numberOfLines={1}>
3737
{STRINGS.MESSAGE_SEARCH.SEARCH_RESULT_ITEM_TITLE(message)}
3838
</Text>
@@ -58,15 +58,18 @@ const MessageSearchResultItem: MessageSearchProps['List']['renderSearchResultIte
5858
/>
5959
)}
6060

61-
<Text
62-
body3
63-
numberOfLines={fileIcon ? 1 : 2}
64-
ellipsizeMode={fileIcon ? 'middle' : 'tail'}
65-
style={styles.bodyText}
66-
color={colors.onBackground03}
67-
>
68-
{STRINGS.MESSAGE_SEARCH.SEARCH_RESULT_ITEM_BODY(message)}
69-
</Text>
61+
<Box flex={1} alignItems={'flex-start'}>
62+
<Text
63+
body3
64+
numberOfLines={fileIcon ? 1 : 2}
65+
ellipsizeMode={fileIcon ? 'middle' : 'tail'}
66+
style={styles.bodyText}
67+
color={colors.onBackground03}
68+
supportRTLAlign
69+
>
70+
{STRINGS.MESSAGE_SEARCH.SEARCH_RESULT_ITEM_BODY(message)}
71+
</Text>
72+
</Box>
7073
</Box>
7174
</Box>
7275

@@ -111,7 +114,6 @@ const styles = createStyleSheet({
111114
marginEnd: 4,
112115
},
113116
bodyText: {
114-
flex: 1,
115117
lineHeight: 16,
116118
},
117119
separator: {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Pressable, ScrollView, View, useWindowDimensions } from 'react-native';
33

44
import {
55
Avatar,
6+
Box,
67
Divider,
78
Icon,
89
Text,
@@ -74,15 +75,15 @@ const GroupChannelSuggestedMentionList = ({
7475
style={styles.userContainer}
7576
>
7677
<Avatar size={28} uri={member.profileUrl} containerStyle={styles.userAvatar} />
77-
<View style={styles.userInfo}>
78+
<Box style={styles.userInfo} >
7879
<Text body2 color={colors.onBackground01} numberOfLines={1} style={styles.userNickname}>
7980
{member.nickname || STRINGS.LABELS.USER_NO_NAME}
8081
</Text>
8182
<Text body3 color={colors.onBackground03} numberOfLines={1} style={styles.userId}>
8283
{member.userId}
8384
</Text>
8485
<Divider style={{ position: 'absolute', bottom: 0 }} />
85-
</View>
86+
</Box>
8687
</Pressable>
8788
);
8889
})}

packages/uikit-react-native/src/domain/groupChannelNotifications/component/GroupChannelNotificationsView.tsx

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
import React, { useContext } from 'react';
2-
import { Pressable, ScrollView, View } from 'react-native';
2+
import { Pressable, ScrollView } from 'react-native';
33

44
import { PushTriggerOption } from '@sendbird/chat';
5-
import { Divider, Icon, Switch, Text, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
5+
import {
6+
Box,
7+
Divider,
8+
Icon,
9+
Switch,
10+
Text,
11+
createStyleSheet,
12+
useUIKitTheme,
13+
} from '@sendbird/uikit-react-native-foundation';
614
import { useForceUpdate } from '@sendbird/uikit-utils';
715

816
import { useLocalization } from '../../../hooks/useContext';
@@ -89,14 +97,22 @@ const Bar = ({ title, onPress, description, component, subtitle2, body3 }: BarPr
8997
const { colors } = useUIKitTheme();
9098
return (
9199
<Pressable onPress={onPress} style={styles.barContainer}>
92-
<View style={styles.titleContainer}>
93-
<Text body3={body3} subtitle2={subtitle2} numberOfLines={1} color={colors.onBackground01} style={styles.title}>
94-
{title}
95-
</Text>
96-
<View>{component}</View>
97-
</View>
100+
<Box style={styles.titleContainer}>
101+
<Box flex={1} alignItems={'flex-start'}>
102+
<Text
103+
body3={body3}
104+
subtitle2={subtitle2}
105+
numberOfLines={1}
106+
color={colors.onBackground01}
107+
style={styles.title}
108+
>
109+
{title}
110+
</Text>
111+
</Box>
112+
<Box>{component}</Box>
113+
</Box>
98114
{Boolean(description) && (
99-
<Text body3 color={colors.onBackground02} style={styles.desc}>
115+
<Text body3 color={colors.onBackground02} style={styles.desc} supportRTLAlign>
100116
{description}
101117
</Text>
102118
)}
@@ -116,7 +132,6 @@ const styles = createStyleSheet({
116132
alignItems: 'center',
117133
},
118134
title: {
119-
flex: 1,
120135
marginEnd: 8,
121136
},
122137
desc: {

packages/uikit-react-native/src/domain/messageSearch/component/MessageSearchHeader.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import React, { useEffect, useRef } from 'react';
2-
import { Platform, TextInput } from 'react-native';
2+
import { Platform } from 'react-native';
33

44
import {
55
Box,
66
Icon,
77
PressBox,
88
Text,
9+
TextInput,
910
createStyleSheet,
1011
useHeaderStyle,
1112
useUIKitTheme,
@@ -60,6 +61,8 @@ const MessageSearchHeader = ({
6061
style={[styles.input, { color: inputColor.text }]}
6162
value={keyword}
6263
onChangeText={onChangeKeyword}
64+
supportRTLAlign
65+
originalText={keyword}
6366
/>
6467
{searchEnabled && (
6568
<PressBox onPress={() => onChangeKeyword('')}>

sample/src/screens/uikit/SettingsScreen.tsx

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,26 @@ const SettingsScreen = () => {
210210
};
211211

212212
const styles = StyleSheet.create({
213-
container: { flex: 1 },
214-
viewContainer: { paddingHorizontal: 16 },
215-
userInfoContainer: { paddingVertical: 24, alignItems: 'center' },
216-
avatarContainer: { marginBottom: 12 },
217-
userIdContainer: { paddingVertical: 16 },
218-
userIdLabel: { marginBottom: 4 },
213+
container: {
214+
flex: 1,
215+
},
216+
viewContainer: {
217+
paddingHorizontal: 16,
218+
},
219+
userInfoContainer: {
220+
paddingVertical: 24,
221+
alignItems: 'center',
222+
},
223+
avatarContainer: {
224+
marginBottom: 12,
225+
},
226+
userIdContainer: {
227+
paddingVertical: 16,
228+
alignItems: 'flex-start',
229+
},
230+
userIdLabel: {
231+
marginBottom: 4,
232+
},
219233
});
220234

221235
export default SettingsScreen;

0 commit comments

Comments
 (0)