adds a button to see the feed in the RelayInformationScreen

This commit is contained in:
Vitor Pamplona
2026-03-10 08:51:10 -04:00
parent 50a578cfdc
commit c4b4e1b5c8
2 changed files with 22 additions and 2 deletions
@@ -43,6 +43,7 @@ import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.Article import androidx.compose.material.icons.automirrored.filled.Article
import androidx.compose.material.icons.automirrored.filled.ContactSupport import androidx.compose.material.icons.automirrored.filled.ContactSupport
import androidx.compose.material.icons.automirrored.filled.Feed
import androidx.compose.material.icons.automirrored.filled.Label import androidx.compose.material.icons.automirrored.filled.Label
import androidx.compose.material.icons.automirrored.filled.List import androidx.compose.material.icons.automirrored.filled.List
import androidx.compose.material.icons.automirrored.filled.Message import androidx.compose.material.icons.automirrored.filled.Message
@@ -71,6 +72,7 @@ import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedButton
import androidx.compose.material3.OutlinedCard import androidx.compose.material3.OutlinedCard
import androidx.compose.material3.Scaffold import androidx.compose.material3.Scaffold
import androidx.compose.material3.SuggestionChip import androidx.compose.material3.SuggestionChip
@@ -116,9 +118,11 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.chats.rooms.LoadUser
import com.vitorpamplona.amethyst.ui.screen.loggedIn.mockAccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.mockAccountViewModel
import com.vitorpamplona.amethyst.ui.screen.loggedIn.qrcode.BackButton import com.vitorpamplona.amethyst.ui.screen.loggedIn.qrcode.BackButton
import com.vitorpamplona.amethyst.ui.stringRes import com.vitorpamplona.amethyst.ui.stringRes
import com.vitorpamplona.amethyst.ui.theme.ButtonBorder
import com.vitorpamplona.amethyst.ui.theme.Height25Modifier import com.vitorpamplona.amethyst.ui.theme.Height25Modifier
import com.vitorpamplona.amethyst.ui.theme.Size100dp import com.vitorpamplona.amethyst.ui.theme.Size100dp
import com.vitorpamplona.amethyst.ui.theme.Size25dp import com.vitorpamplona.amethyst.ui.theme.Size25dp
import com.vitorpamplona.amethyst.ui.theme.SpacedBy10dp
import com.vitorpamplona.amethyst.ui.theme.StdHorzSpacer import com.vitorpamplona.amethyst.ui.theme.StdHorzSpacer
import com.vitorpamplona.amethyst.ui.theme.StdVertSpacer import com.vitorpamplona.amethyst.ui.theme.StdVertSpacer
import com.vitorpamplona.amethyst.ui.theme.ThemeComparisonRow import com.vitorpamplona.amethyst.ui.theme.ThemeComparisonRow
@@ -366,7 +370,7 @@ fun RelayInformationBody(
) { ) {
// 1. Header Section // 1. Header Section
item { item {
RelayHeader(relay, relayStats, relayInfo, accountViewModel) RelayHeader(relay, relayStats, relayInfo, accountViewModel, nav)
} }
val targetAudience = val targetAudience =
@@ -1062,9 +1066,11 @@ private fun RelayHeader(
relayStats: RelayStat, relayStats: RelayStat,
relayInfo: Nip11RelayInformation, relayInfo: Nip11RelayInformation,
accountViewModel: AccountViewModel, accountViewModel: AccountViewModel,
nav: INav,
) { ) {
Column( Column(
horizontalAlignment = Alignment.CenterHorizontally, horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = SpacedBy10dp,
modifier = modifier =
Modifier Modifier
.fillMaxWidth() .fillMaxWidth()
@@ -1081,13 +1087,25 @@ private fun RelayHeader(
.size(Size100dp) .size(Size100dp)
.clip(shape = CircleShape), .clip(shape = CircleShape),
) )
Spacer(modifier = Modifier.height(12.dp))
Text( Text(
text = relayInfo.description ?: relay.displayUrl(), text = relayInfo.description ?: relay.displayUrl(),
style = MaterialTheme.typography.bodyLarge, style = MaterialTheme.typography.bodyLarge,
color = MaterialTheme.colorScheme.onSurfaceVariant, color = MaterialTheme.colorScheme.onSurfaceVariant,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
) )
OutlinedButton(
modifier = Modifier.padding(horizontal = 30.dp),
shape = ButtonBorder,
onClick = { nav.nav(Route.RelayFeed(url = relay.url)) },
) {
Icon(
imageVector = Icons.AutoMirrored.Filled.Feed,
contentDescription = null,
modifier = Modifier.size(18.dp),
)
Spacer(modifier = Modifier.width(4.dp))
Text(text = stringRes(R.string.see_relay_feed))
}
} }
} }
+2
View File
@@ -463,6 +463,8 @@
<string name="zap_type_section_explainer">Controls how your identity is shown when you send a zap.</string> <string name="zap_type_section_explainer">Controls how your identity is shown when you send a zap.</string>
<string name="wallet_connect_connect_app">Connect Wallet</string> <string name="wallet_connect_connect_app">Connect Wallet</string>
<string name="see_relay_feed">See Relay Feed</string>
<string name="pledge_amount_in_sats">Pledge Amount in Sats</string> <string name="pledge_amount_in_sats">Pledge Amount in Sats</string>
<string name="post_poll">Post Poll</string> <string name="post_poll">Post Poll</string>
<string name="poll_heading_required">Required fields:</string> <string name="poll_heading_required">Required fields:</string>