Skip to content

Commit 60b5d50

Browse files
committed
chore(fc): overload ConversationTitle component
Signed-off-by: Brandon McAnsh <[email protected]>
1 parent 0d4fe43 commit 60b5d50

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

flipchatApp/src/main/kotlin/xyz/flipchat/app/features/chat/conversation/ConversationTitle.kt

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,25 @@ import xyz.flipchat.app.R
2929
internal fun ConversationTitle(
3030
modifier: Modifier = Modifier,
3131
state: ConversationViewModel.State,
32+
) {
33+
val memberCount = remember(state.members) {
34+
state.members
35+
}
36+
37+
ConversationTitle(
38+
modifier = modifier,
39+
imageUri = state.imageUri ?: state.conversationId,
40+
title = state.title,
41+
memberCount = memberCount,
42+
)
43+
}
44+
45+
@Composable
46+
internal fun ConversationTitle(
47+
modifier: Modifier = Modifier,
48+
imageUri: Any?,
49+
title: String,
50+
memberCount: Int?,
3251
) {
3352
Row(
3453
modifier = modifier,
@@ -40,7 +59,7 @@ internal fun ConversationTitle(
4059
.padding(start = CodeTheme.dimens.grid.x2)
4160
.size(CodeTheme.dimens.staticGrid.x6)
4261
.clip(CircleShape),
43-
data = state.imageUri ?: state.conversationId,
62+
data = imageUri,
4463
overlay = {
4564
Image(
4665
modifier = Modifier.padding(5.dp),
@@ -53,17 +72,12 @@ internal fun ConversationTitle(
5372
Column {
5473
Text(
5574
modifier = Modifier.fillMaxWidth(),
56-
text = state.title,
75+
text = title,
5776
maxLines = 1,
5877
overflow = TextOverflow.Ellipsis,
5978
style = CodeTheme.typography.screenTitle.copy(fontSize = 18.sp)
6079
)
6180

62-
val memberCount = remember(state.members) {
63-
state.members
64-
}
65-
66-
6781
Text(
6882
text = if (memberCount != null) {
6983
pluralStringResource(

0 commit comments

Comments
 (0)