Skip to content

Commit 7148b53

Browse files
committed
style(fc): "pill" announcement messages in chat
Signed-off-by: Brandon McAnsh <[email protected]>
1 parent 16ea952 commit 7148b53

File tree

1 file changed

+31
-20
lines changed

1 file changed

+31
-20
lines changed
Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,54 @@
11
package com.getcode.ui.components.chat.messagecontents
22

3-
import androidx.compose.foundation.border
43
import androidx.compose.foundation.layout.Arrangement
4+
import androidx.compose.foundation.layout.Box
55
import androidx.compose.foundation.layout.BoxWithConstraints
66
import androidx.compose.foundation.layout.Column
7-
import androidx.compose.foundation.layout.padding
7+
import androidx.compose.foundation.layout.PaddingValues
8+
import androidx.compose.foundation.layout.fillMaxWidth
89
import androidx.compose.foundation.layout.widthIn
910
import androidx.compose.material.Text
1011
import androidx.compose.runtime.Composable
1112
import androidx.compose.ui.Alignment
1213
import androidx.compose.ui.Modifier
13-
import androidx.compose.ui.text.font.FontWeight
1414
import androidx.compose.ui.text.style.TextAlign
1515
import com.getcode.theme.CodeTheme
16-
import com.getcode.ui.components.chat.MessageNodeDefaults
16+
import com.getcode.ui.components.Pill
1717

1818
@Composable
1919
internal fun AnnouncementMessage(
2020
modifier: Modifier = Modifier,
2121
text: String,
2222
) {
2323
BoxWithConstraints(modifier = modifier) {
24-
Column(
24+
Pill(
2525
modifier = Modifier
2626
.align(Alignment.Center)
27-
.widthIn(max = maxWidth * 0.78f)
28-
.border(
29-
width = CodeTheme.dimens.border,
30-
color = CodeTheme.colors.tertiary,
31-
shape = MessageNodeDefaults.DefaultShape
32-
)
33-
.padding(CodeTheme.dimens.grid.x2),
34-
verticalArrangement = Arrangement.Center
35-
) {
36-
Text(
37-
text = text,
38-
textAlign = TextAlign.Center,
39-
style = CodeTheme.typography.textMedium.copy(fontWeight = FontWeight.W500)
40-
)
41-
}
27+
.widthIn(max = maxWidth * 0.78f),
28+
text = text,
29+
textStyle = CodeTheme.typography.caption.copy(textAlign = TextAlign.Center),
30+
contentPadding = PaddingValues(CodeTheme.dimens.grid.x1),
31+
backgroundColor = CodeTheme.colors.surfaceVariant,
32+
contentColor = CodeTheme.colors.textSecondary
33+
)
34+
// Box(modifier = modifier.fillMaxWidth(), contentAlignment = Alignment.Center) {
35+
// Pill(
36+
// text = date,
37+
// backgroundColor = CodeTheme.colors.surfaceVariant
38+
// )
39+
// }
40+
// Column(
41+
// modifier = Modifier
42+
// .align(Alignment.Center)
43+
// .widthIn(max = maxWidth * 0.78f),
44+
// verticalArrangement = Arrangement.Center
45+
// ) {
46+
// Text(
47+
// text = text,
48+
// textAlign = TextAlign.Center,
49+
// style = CodeTheme.typography.caption,
50+
// color = CodeTheme.colors.textSecondary
51+
// )
52+
// }
4253
}
4354
}

0 commit comments

Comments
 (0)