Skip to content

Commit d7bd73c

Browse files
committed
refactor: extract new text style
1 parent 4bdcde7 commit d7bd73c

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

app/src/main/java/to/bitkit/ui/components/Text.kt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,25 @@ fun Display(
6060
)
6161
}
6262

63+
@Composable
64+
fun Display34(
65+
text: String,
66+
modifier: Modifier = Modifier,
67+
color: Color = MaterialTheme.colorScheme.primary,
68+
maxLines: Int = Int.MAX_VALUE,
69+
overflow: TextOverflow = if (maxLines == 1) TextOverflow.Ellipsis else TextOverflow.Clip,
70+
) {
71+
Text(
72+
text = text,
73+
style = AppTextStyles.Display34.merge(
74+
color = color,
75+
),
76+
maxLines = maxLines,
77+
overflow = overflow,
78+
modifier = modifier
79+
)
80+
}
81+
6382
@Composable
6483
fun Headline(
6584
text: AnnotatedString,

app/src/main/java/to/bitkit/ui/theme/Type.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ object AppTextStyles {
5050
letterSpacing = (-1).sp,
5151
fontFamily = InterFontFamily,
5252
)
53+
val Display34 = TextStyle(
54+
fontWeight = FontWeight.Bold,
55+
fontSize = 34.sp,
56+
lineHeight = 34.sp,
57+
letterSpacing = (-1).sp,
58+
fontFamily = InterFontFamily,
59+
)
5360
val Headline = TextStyle(
5461
fontWeight = FontWeight.Black,
5562
fontSize = 30.sp,

0 commit comments

Comments
 (0)