feat: make relay rows clickable to open relay info dialog on profile page
Adds onClick parameter to RelayCompose and navigates to RelayInformationScreen when a relay row is tapped in the profile relay tab. https://claude.ai/code/session_01PBFQz53xzXoFsEHD5Ghyqr
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.vitorpamplona.amethyst.ui.note
|
package com.vitorpamplona.amethyst.ui.note
|
||||||
|
|
||||||
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
@@ -59,11 +60,12 @@ fun RelayCompose(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
onAddRelay: () -> Unit,
|
onAddRelay: () -> Unit,
|
||||||
onRemoveRelay: () -> Unit,
|
onRemoveRelay: () -> Unit,
|
||||||
|
onClick: (() -> Unit)? = null,
|
||||||
) {
|
) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
modifier = StdPadding,
|
modifier = StdPadding.then(if (onClick != null) Modifier.clickable(onClick = onClick) else Modifier),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
|
|||||||
+3
@@ -105,6 +105,9 @@ private fun RenderRelayRow(
|
|||||||
onRemoveRelay = {
|
onRemoveRelay = {
|
||||||
nav.nav(Route.EditRelays)
|
nav.nav(Route.EditRelays)
|
||||||
},
|
},
|
||||||
|
onClick = {
|
||||||
|
nav.nav(Route.RelayInfo(relay.url.url))
|
||||||
|
},
|
||||||
)
|
)
|
||||||
HorizontalDivider(
|
HorizontalDivider(
|
||||||
thickness = DividerThickness,
|
thickness = DividerThickness,
|
||||||
|
|||||||
Reference in New Issue
Block a user