From 5d935972280850c0bb7d9e0f3ac7437dd599ad6f Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 5 Aug 2021 02:11:21 +0530 Subject: [PATCH] common: remove laggy SubmitterAvatar composable --- .../claw/common/posts/LobstersItem.kt | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/posts/LobstersItem.kt b/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/posts/LobstersItem.kt index 4b6a5b95..828c9a70 100644 --- a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/posts/LobstersItem.kt +++ b/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/posts/LobstersItem.kt @@ -13,7 +13,6 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.requiredSize import androidx.compose.foundation.layout.width -import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Icon import androidx.compose.material.IconButton @@ -24,7 +23,6 @@ import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import com.google.accompanist.flowlayout.FlowRow @@ -33,8 +31,6 @@ import dev.msfjarvis.claw.common.res.heartBorderIcon import dev.msfjarvis.claw.common.res.heartIcon import dev.msfjarvis.claw.common.theme.titleColor import dev.msfjarvis.claw.database.local.SavedPost -import io.kamel.image.KamelImage -import io.kamel.image.lazyImageResource val TEST_POST = SavedPost( @@ -88,8 +84,6 @@ fun LobstersItem( } SubmitterName( text = "Submitted by ${post.submitterName}", - avatarUrl = post.submitterAvatarUrl, - contentDescription = "Submitted by ${post.submitterName}", ) } } @@ -111,44 +105,24 @@ fun PostTitle( @Composable fun SubmitterName( text: String, - avatarUrl: String, - contentDescription: String, modifier: Modifier = Modifier, ) { Row( modifier = Modifier.then(modifier), verticalAlignment = Alignment.CenterVertically, ) { - SubmitterAvatar( - avatarUrl = avatarUrl, - contentDescription = contentDescription, - ) SubmitterNameText( text = text, ) } } -@Composable -fun SubmitterAvatar( - avatarUrl: String, - contentDescription: String, -) { - KamelImage( - resource = lazyImageResource(avatarUrl), - contentDescription = contentDescription, - modifier = Modifier.requiredSize(24.dp).clip(CircleShape), - crossfade = true, - ) -} - @Composable fun SubmitterNameText( text: String, ) { Text( text = text, - modifier = Modifier.padding(start = 4.dp), ) }