Crossfades changes in Reactions and Zaps

This commit is contained in:
Vitor Pamplona
2023-06-25 19:17:48 -04:00
parent b4a81c137c
commit d7bce4414d
@@ -726,10 +726,12 @@ fun LikeIcon(
} }
} }
if (reactionType != null) { Crossfade(targetState = reactionType) {
RenderReactionType(reactionType!!, iconSize, iconFontSize) if (it != null) {
} else { RenderReactionType(it, iconSize, iconFontSize)
RenderLikeIcon(iconSize, grayTint) } else {
RenderLikeIcon(iconSize, grayTint)
}
} }
} }
@@ -1023,20 +1025,22 @@ private fun ZapIcon(
} }
} }
if (wasZappedByLoggedInUser) { Crossfade(targetState = wasZappedByLoggedInUser) {
Icon( if (it) {
imageVector = Icons.Default.Bolt, Icon(
contentDescription = stringResource(R.string.zaps), imageVector = Icons.Default.Bolt,
modifier = remember { Modifier.size(iconSize) }, contentDescription = stringResource(R.string.zaps),
tint = BitcoinOrange modifier = remember { Modifier.size(iconSize) },
) tint = BitcoinOrange
} else { )
Icon( } else {
imageVector = Icons.Outlined.Bolt, Icon(
contentDescription = stringResource(id = R.string.zaps), imageVector = Icons.Outlined.Bolt,
modifier = remember { Modifier.size(iconSize) }, contentDescription = stringResource(id = R.string.zaps),
tint = grayTint modifier = remember { Modifier.size(iconSize) },
) tint = grayTint
)
}
} }
} }