Skip to content

Commit efd9cc2

Browse files
committed
feat: apply rtl to channel preview component
1 parent 8c00832 commit efd9cc2

File tree

1 file changed

+32
-34
lines changed
  • packages/uikit-react-native-foundation/src/ui/GroupChannelPreview

1 file changed

+32
-34
lines changed

packages/uikit-react-native-foundation/src/ui/GroupChannelPreview/index.tsx

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from 'react';
2-
import { View } from 'react-native';
32

43
import { conditionChaining } from '@sendbird/uikit-utils';
54

5+
import Box from '../../components/Box';
66
import Icon from '../../components/Icon';
77
import Image from '../../components/Image';
88
import Text from '../../components/Text';
@@ -54,8 +54,8 @@ const GroupChannelPreview = ({
5454
const color = colors.ui.groupChannelPreview;
5555

5656
return (
57-
<View style={[styles.container, { backgroundColor: color.default.none.background }]}>
58-
<View style={styles.coverContainer}>
57+
<Box style={[styles.container, { backgroundColor: color.default.none.background }]}>
58+
<Box style={styles.coverContainer}>
5959
{conditionChaining(
6060
[Boolean(customCover)],
6161
[
@@ -67,10 +67,10 @@ const GroupChannelPreview = ({
6767
/>,
6868
],
6969
)}
70-
</View>
71-
<View style={styles.rightSection}>
72-
<View style={styles.rightTopSection}>
73-
<View style={styles.channelInfoContainer}>
70+
</Box>
71+
<Box style={styles.rightSection}>
72+
<Box style={styles.rightTopSection}>
73+
<Box style={styles.channelInfoContainer}>
7474
{broadcast && (
7575
<Icon
7676
size={16}
@@ -91,18 +91,18 @@ const GroupChannelPreview = ({
9191
<Icon size={16} icon={'freeze'} color={colors.primary} containerStyle={styles.channelInfoFrozen} />
9292
)}
9393
{notificationOff && <Icon size={16} icon={'notifications-off-filled'} color={colors.onBackground03} />}
94-
</View>
95-
<View style={styles.titleCaptionContainer}>
94+
</Box>
95+
<Box style={styles.titleCaptionContainer}>
9696
{titleCaptionLeft}
9797
<Text caption2 color={color.default.none.textTitleCaption} style={styles.titleCaptionText}>
9898
{titleCaption}
9999
</Text>
100-
</View>
101-
</View>
100+
</Box>
101+
</Box>
102102

103-
<View style={styles.rightBottomSection}>
104-
<View style={styles.body}>
105-
<View style={styles.bodyWrapper}>
103+
<Box style={styles.rightBottomSection}>
104+
<Box style={styles.body}>
105+
<Box style={styles.bodyWrapper}>
106106
{bodyIcon && (
107107
<Icon
108108
size={18}
@@ -114,34 +114,35 @@ const GroupChannelPreview = ({
114114
]}
115115
/>
116116
)}
117-
<Text
118-
body3
119-
numberOfLines={1}
120-
ellipsizeMode={bodyIcon ? 'middle' : 'tail'}
121-
style={styles.bodyText}
122-
color={color.default.none.textBody}
123-
>
124-
{body}
125-
</Text>
126-
</View>
127-
</View>
128-
<View style={styles.unreadContainer}>
117+
<Box flex={1} alignItems={'flex-start'}>
118+
<Text
119+
body3
120+
numberOfLines={1}
121+
ellipsizeMode={bodyIcon ? 'middle' : 'tail'}
122+
color={color.default.none.textBody}
123+
>
124+
{body}
125+
</Text>
126+
</Box>
127+
</Box>
128+
</Box>
129+
<Box style={styles.unreadContainer}>
129130
{mentioned && (
130131
<Text h2 color={colors.ui.badge.default.none.background} style={styles.unreadMention}>
131132
{mentionTrigger}
132133
</Text>
133134
)}
134135
{badgeCount > 0 && <Badge count={badgeCount} maxCount={maxBadgeCount} />}
135-
</View>
136-
</View>
136+
</Box>
137+
</Box>
137138
<Separator color={color.default.none.separator} />
138-
</View>
139-
</View>
139+
</Box>
140+
</Box>
140141
);
141142
};
142143

143144
type SeparatorProps = { color: string };
144-
const Separator = ({ color }: SeparatorProps) => <View style={[styles.separator, { backgroundColor: color }]} />;
145+
const Separator = ({ color }: SeparatorProps) => <Box style={[styles.separator, { backgroundColor: color }]} />;
145146

146147
const styles = createStyleSheet({
147148
container: {
@@ -212,9 +213,6 @@ const styles = createStyleSheet({
212213
flexDirection: 'row',
213214
alignItems: 'center',
214215
},
215-
bodyText: {
216-
flex: 1,
217-
},
218216
bodyIcon: {
219217
borderRadius: 8,
220218
width: 26,

0 commit comments

Comments
 (0)