Skip to content

Commit 869850c

Browse files
committed
style(fc): use the correct textStyle for ChatNode
Signed-off-by: Brandon McAnsh <[email protected]>
1 parent 1c694fb commit 869850c

File tree

3 files changed

+9
-3
lines changed
  • flipchatApp/src/main/kotlin/xyz/flipchat/app/features/chat/list
  • ui/components/src/main/kotlin/com/getcode/ui/components

3 files changed

+9
-3
lines changed

flipchatApp/src/main/kotlin/xyz/flipchat/app/features/chat/list/ChatNode.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ fun ChatNode(
8181
modifier = modifier.background(CodeTheme.colors.background),
8282
title = chat.title,
8383
messagePreview = chat.messagePreview,
84+
messageTextStyle = CodeTheme.typography.textSmall,
8485
avatar = chat.imageUri ?: chat.id,
8586
avatarIconWhenFallback = {
8687
Image(

ui/components/src/main/kotlin/com/getcode/ui/components/Badge.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import androidx.compose.runtime.Composable
1414
import androidx.compose.ui.Modifier
1515
import androidx.compose.ui.draw.drawBehind
1616
import androidx.compose.ui.graphics.Color
17+
import androidx.compose.ui.text.TextStyle
1718
import androidx.compose.ui.text.font.FontWeight
1819
import androidx.compose.ui.unit.dp
1920
import com.getcode.theme.CodeTheme
@@ -25,6 +26,7 @@ fun Badge(
2526
count: Int,
2627
color: Color = CodeTheme.colors.brand,
2728
contentColor: Color = Color.White,
29+
textStyle: TextStyle = CodeTheme.typography.textMedium.copy(fontWeight = FontWeight.W700),
2830
enterTransition: EnterTransition = scaleIn(tween(durationMillis = 300)) + fadeIn(),
2931
exitTransition: ExitTransition = fadeOut() + scaleOut(tween(durationMillis = 300))
3032
) {
@@ -38,7 +40,7 @@ fun Badge(
3840
Text(
3941
text = text,
4042
color = contentColor,
41-
style = CodeTheme.typography.textMedium.copy(fontWeight = FontWeight.W700),
43+
style = textStyle,
4244
modifier = Modifier
4345
.drawBehind {
4446
drawCircle(

ui/components/src/main/kotlin/com/getcode/ui/components/chat/ChatNode.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import androidx.compose.ui.graphics.Color
2727
import androidx.compose.ui.graphics.ColorFilter
2828
import androidx.compose.ui.res.painterResource
2929
import androidx.compose.ui.text.AnnotatedString
30+
import androidx.compose.ui.text.TextStyle
3031
import androidx.compose.ui.text.style.TextOverflow
3132
import androidx.compose.ui.unit.dp
3233
import com.getcode.theme.CodeTheme
@@ -44,6 +45,8 @@ fun ChatNode(
4445
avatar: Any? = null,
4546
avatarIconWhenFallback: @Composable BoxScope.() -> Unit = { },
4647
messagePreview: Pair<AnnotatedString, Map<String, InlineTextContent>>,
48+
titleTextStyle: TextStyle = CodeTheme.typography.textMedium,
49+
messageTextStyle: TextStyle = CodeTheme.typography.textMedium,
4750
timestamp: Long? = null,
4851
isMuted: Boolean = false,
4952
showMuteByTitle: Boolean = false,
@@ -107,7 +110,7 @@ fun ChatNode(
107110
Text(
108111
text = title,
109112
maxLines = 1,
110-
style = CodeTheme.typography.textMedium
113+
style = titleTextStyle
111114
)
112115
if (isMuted && showMuteByTitle) {
113116
Icon(
@@ -148,7 +151,7 @@ fun ChatNode(
148151
modifier = Modifier.weight(1f),
149152
text = preview,
150153
inlineContent = inlineContent,
151-
style = CodeTheme.typography.textMedium,
154+
style = messageTextStyle,
152155
color = CodeTheme.colors.textSecondary,
153156
maxLines = 2,
154157
overflow = TextOverflow.Ellipsis

0 commit comments

Comments
 (0)