Fixes size of custom reactions on the Stories feed.

This commit is contained in:
Vitor Pamplona
2023-07-13 21:19:08 -04:00
parent 2e7a955ada
commit 3b1533eb82
@@ -583,14 +583,22 @@ fun ClickableInLineIconRenderer(
style: SpanStyle, style: SpanStyle,
onClick: (Int) -> Unit onClick: (Int) -> Unit
) { ) {
val placeholderSize = remember(style) {
if (style.fontSize == TextUnit.Unspecified) {
22.sp
} else {
style.fontSize.times(1.1f)
}
}
val inlineContent = wordsInOrder.mapIndexedNotNull { idx, value -> val inlineContent = wordsInOrder.mapIndexedNotNull { idx, value ->
if (value is ImageUrlType) { if (value is ImageUrlType) {
Pair( Pair(
"inlineContent$idx", "inlineContent$idx",
InlineTextContent( InlineTextContent(
Placeholder( Placeholder(
width = 17.sp, width = placeholderSize,
height = 17.sp, height = placeholderSize,
placeholderVerticalAlign = PlaceholderVerticalAlign.Center placeholderVerticalAlign = PlaceholderVerticalAlign.Center
) )
) { ) {
@@ -651,14 +659,22 @@ fun InLineIconRenderer(
overflow: TextOverflow = TextOverflow.Clip, overflow: TextOverflow = TextOverflow.Clip,
modifier: Modifier = Modifier modifier: Modifier = Modifier
) { ) {
val placeholderSize = remember(fontSize) {
if (fontSize == TextUnit.Unspecified) {
22.sp
} else {
fontSize.times(1.1f)
}
}
val inlineContent = wordsInOrder.mapIndexedNotNull { idx, value -> val inlineContent = wordsInOrder.mapIndexedNotNull { idx, value ->
if (value is ImageUrlType) { if (value is ImageUrlType) {
Pair( Pair(
"inlineContent$idx", "inlineContent$idx",
InlineTextContent( InlineTextContent(
Placeholder( Placeholder(
width = 20.sp, width = placeholderSize,
height = 20.sp, height = placeholderSize,
placeholderVerticalAlign = PlaceholderVerticalAlign.Center placeholderVerticalAlign = PlaceholderVerticalAlign.Center
) )
) { ) {