mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 16:33:27 +00:00
fix: size accepted-by-relays icons to match gallery author pictures
The relay favicons rendered at 17dp while the zap/boost/reaction gallery rows use 35dp author pictures, so the "accepted by relays" line looked out of scale. Parameterize RenderRelay with a box size and icon modifier (defaults unchanged for the existing compact relay lists) and render the gallery relays at 35dp with MediumRelayIconModifier to match. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GVPYTTnMbxwi5hUAagsKVc
This commit is contained in:
+10
-1
@@ -41,7 +41,9 @@ import com.vitorpamplona.amethyst.model.Note
|
||||
import com.vitorpamplona.amethyst.ui.navigation.navs.INav
|
||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
||||
import com.vitorpamplona.amethyst.ui.stringRes
|
||||
import com.vitorpamplona.amethyst.ui.theme.MediumRelayIconModifier
|
||||
import com.vitorpamplona.amethyst.ui.theme.Size20dp
|
||||
import com.vitorpamplona.amethyst.ui.theme.Size35dp
|
||||
import com.vitorpamplona.amethyst.ui.theme.StdStartPadding
|
||||
import com.vitorpamplona.amethyst.ui.theme.WidthAuthorPictureModifier
|
||||
import com.vitorpamplona.amethyst.ui.theme.placeholderText
|
||||
@@ -116,7 +118,14 @@ private fun RelayGallery(
|
||||
Column(modifier = StdStartPadding) {
|
||||
FlowRow {
|
||||
relays.forEach { relay ->
|
||||
RenderRelay(relay, accountViewModel, nav)
|
||||
// Match the 35dp author pictures of the sibling zap/boost/reaction lines.
|
||||
RenderRelay(
|
||||
relay = relay,
|
||||
accountViewModel = accountViewModel,
|
||||
nav = nav,
|
||||
boxSize = Size35dp,
|
||||
iconModifier = MediumRelayIconModifier,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.platform.LocalClipboard
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
@@ -128,15 +129,17 @@ fun RenderRelay(
|
||||
relay: NormalizedRelayUrl,
|
||||
accountViewModel: AccountViewModel,
|
||||
nav: INav,
|
||||
boxSize: Dp = Size17dp,
|
||||
iconModifier: Modifier = MaterialTheme.colorScheme.relayIconModifier,
|
||||
) {
|
||||
val relayInfo by loadRelayInfo(relay)
|
||||
|
||||
val clipboardManager = LocalClipboard.current
|
||||
val scope = rememberCoroutineScope()
|
||||
val clickableModifier =
|
||||
remember(relay) {
|
||||
remember(relay, boxSize) {
|
||||
Modifier
|
||||
.size(Size17dp)
|
||||
.size(boxSize)
|
||||
.combinedClickable(
|
||||
indication = ripple24dp,
|
||||
interactionSource = MutableInteractionSource(),
|
||||
@@ -159,6 +162,7 @@ fun RenderRelay(
|
||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
||||
pingInMs = 0,
|
||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
||||
iconModifier = iconModifier,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user