Skip to content

Commit

Permalink
[QA] 스켈레톤때 shape 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
hyejin12-ju committed Sep 19, 2024
1 parent fc96494 commit fd0a274
Showing 1 changed file with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.SideEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
Expand Down Expand Up @@ -99,7 +99,8 @@ internal fun DetailContent(
DetailFunnyButton(
modifier = Modifier.mapTextSkeletonModifierIfNeed(
isLoading = isLoading,
height = 46.dp
height = 46.dp,
shape = FarmemeRadius.Radius10.shape,
),
reactionCount = uiModel.reactionCount,
isReaction = uiModel.isReaction,
Expand Down Expand Up @@ -127,9 +128,11 @@ private fun Modifier.mapImageSkeletonModifierIfNeed(

private fun Modifier.mapTextSkeletonModifierIfNeed(
isLoading: Boolean,
height: Dp
height: Dp,
shape: RoundedCornerShape,
): Modifier {
return if (isLoading) Modifier
.clip(shape)
.fillMaxWidth()
.height(height)
.showSkeleton(true)
Expand Down Expand Up @@ -179,15 +182,23 @@ internal fun DetailHashTags(
onHashTagsClick: () -> Unit,
) {
Text(
modifier = Modifier.mapTextSkeletonModifierIfNeed(isLoading = isLoading, height = 30.dp),
modifier = Modifier.mapTextSkeletonModifierIfNeed(
isLoading = isLoading,
height = 30.dp,
shape = FarmemeRadius.Radius4.shape,
),
text = name.truncateDisplayedString(16),
color = FarmemeTheme.textColor.primary,
style = FarmemeTheme.typography.heading.large.semibold,
overflow = TextOverflow.Ellipsis
)
Spacer(modifier = Modifier.height(5.dp))
DetailTags(
modifier = Modifier.mapTextSkeletonModifierIfNeed(isLoading = isLoading, height = 18.dp),
modifier = Modifier.mapTextSkeletonModifierIfNeed(
isLoading = isLoading,
height = 18.dp,
shape = FarmemeRadius.Radius4.shape,
),
hashTags = hashTags.truncateDisplayedList(6),
onHashTagsClick = onHashTagsClick
)
Expand All @@ -197,6 +208,7 @@ internal fun DetailHashTags(
modifier = Modifier.mapTextSkeletonModifierIfNeed(
isLoading = isLoading,
height = 15.dp,
shape = FarmemeRadius.Radius4.shape
),
text = "출처 : ${sourceDescription.truncateDisplayedString(32)}",
color = FarmemeTheme.textColor.assistive,
Expand Down Expand Up @@ -243,7 +255,7 @@ fun DetailFunnyButton(
.rippleClickable(
rippleColor = FarmemeTheme.skeletonColor.secondary,
onClick = {
if(!isLoading) {
if (!isLoading) {
coroutineScope.launch {
lottieAnimatable.animate(composition = lottieComposition)
}
Expand Down

0 comments on commit fd0a274

Please sign in to comment.