diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt
index 93003e177..83fc26074 100644
--- a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt
+++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt
@@ -519,10 +519,23 @@ fun LongCommunityHeader(baseNote: Note, accountViewModel: AccountViewModel, nav:
.padding(start = 10.dp)
) {
Row(verticalAlignment = Alignment.CenterVertically) {
- Text(
- text = summary ?: "This group does not have a description or rules. Talk to the owner to add one"
+ val defaultBackground = MaterialTheme.colors.background
+ val background = remember {
+ mutableStateOf(defaultBackground)
+ }
+
+ TranslatableRichTextViewer(
+ content = summary ?: stringResource(id = R.string.community_no_descriptor),
+ canPreview = false,
+ tags = remember { ImmutableListOfLists(emptyList()) },
+ backgroundColor = background,
+ accountViewModel = accountViewModel,
+ nav = nav
)
}
+
+ val hashtags = remember(noteEvent) { noteEvent.hashtags().toImmutableList() }
+ DisplayUncitedHashtags(hashtags, summary ?: "", nav)
}
Column() {
@@ -544,15 +557,31 @@ fun LongCommunityHeader(baseNote: Note, accountViewModel: AccountViewModel, nav:
.fillMaxWidth()
.padding(start = 10.dp)
) {
- Text(
- text = it
+ val defaultBackground = MaterialTheme.colors.background
+ val background = remember {
+ mutableStateOf(defaultBackground)
+ }
+ val tags = remember(noteEvent) { noteEvent?.tags()?.toImmutableListOfLists() ?: ImmutableListOfLists() }
+
+ TranslatableRichTextViewer(
+ content = it,
+ canPreview = false,
+ tags = tags,
+ backgroundColor = background,
+ accountViewModel = accountViewModel,
+ nav = nav
)
}
}
Spacer(DoubleVertSpacer)
- Row(Modifier.fillMaxWidth().padding(start = 10.dp), verticalAlignment = Alignment.CenterVertically) {
+ Row(
+ Modifier
+ .fillMaxWidth()
+ .padding(start = 10.dp),
+ verticalAlignment = Alignment.CenterVertically
+ ) {
Text(
text = stringResource(id = R.string.owner),
maxLines = 1,
@@ -588,7 +617,8 @@ fun LongCommunityHeader(baseNote: Note, accountViewModel: AccountViewModel, nav:
participantUsers.forEach {
Row(
- Modifier.fillMaxWidth()
+ Modifier
+ .fillMaxWidth()
.padding(start = 10.dp, top = 10.dp)
.clickable {
nav("User/${it.second.pubkeyHex}")
diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ChannelScreen.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ChannelScreen.kt
index 8d8dc7886..9452207d3 100644
--- a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ChannelScreen.kt
+++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ChannelScreen.kt
@@ -89,18 +89,22 @@ import com.vitorpamplona.amethyst.model.User
import com.vitorpamplona.amethyst.service.NostrChannelDataSource
import com.vitorpamplona.amethyst.service.model.LiveActivitiesEvent.Companion.STATUS_LIVE
import com.vitorpamplona.amethyst.service.model.Participant
+import com.vitorpamplona.amethyst.ui.actions.ImmutableListOfLists
import com.vitorpamplona.amethyst.ui.actions.NewChannelView
import com.vitorpamplona.amethyst.ui.actions.NewMessageTagger
import com.vitorpamplona.amethyst.ui.actions.NewPostViewModel
import com.vitorpamplona.amethyst.ui.actions.PostButton
import com.vitorpamplona.amethyst.ui.actions.ServersAvailable
import com.vitorpamplona.amethyst.ui.actions.UploadFromGallery
+import com.vitorpamplona.amethyst.ui.actions.toImmutableListOfLists
import com.vitorpamplona.amethyst.ui.components.LoadNote
import com.vitorpamplona.amethyst.ui.components.RobohashAsyncImageProxy
+import com.vitorpamplona.amethyst.ui.components.TranslatableRichTextViewer
import com.vitorpamplona.amethyst.ui.components.ZoomableContentView
import com.vitorpamplona.amethyst.ui.components.ZoomableUrlVideo
import com.vitorpamplona.amethyst.ui.note.ChatroomMessageCompose
import com.vitorpamplona.amethyst.ui.note.ClickableUserPicture
+import com.vitorpamplona.amethyst.ui.note.DisplayUncitedHashtags
import com.vitorpamplona.amethyst.ui.note.LikeReaction
import com.vitorpamplona.amethyst.ui.note.MoreOptionsButton
import com.vitorpamplona.amethyst.ui.note.NoteAuthorPicture
@@ -742,10 +746,33 @@ private fun LongChannelHeader(
.padding(start = 10.dp)
) {
Row(verticalAlignment = Alignment.CenterVertically) {
- Text(
- text = summary ?: "This group does not have a description or rules. Talk to the owner to add one"
+ val defaultBackground = MaterialTheme.colors.background
+ val background = remember {
+ mutableStateOf(defaultBackground)
+ }
+
+ val tags = remember(channelState) {
+ if (baseChannel is LiveActivitiesChannel) {
+ baseChannel.info?.tags()?.toImmutableListOfLists() ?: ImmutableListOfLists()
+ } else {
+ ImmutableListOfLists()
+ }
+ }
+
+ TranslatableRichTextViewer(
+ content = summary ?: stringResource(id = R.string.groups_no_descriptor),
+ canPreview = false,
+ tags = tags,
+ backgroundColor = background,
+ accountViewModel = accountViewModel,
+ nav = nav
)
}
+
+ if (baseChannel is LiveActivitiesChannel) {
+ val hashtags = remember(baseChannel.info) { baseChannel.info?.hashtags()?.toImmutableList() ?: persistentListOf() }
+ DisplayUncitedHashtags(hashtags, summary ?: "", nav)
+ }
}
Column() {
@@ -760,7 +787,12 @@ private fun LongChannelHeader(
Spacer(DoubleVertSpacer)
- Row(Modifier.fillMaxWidth().padding(start = 10.dp), verticalAlignment = Alignment.CenterVertically) {
+ Row(
+ Modifier
+ .fillMaxWidth()
+ .padding(start = 10.dp),
+ verticalAlignment = Alignment.CenterVertically
+ ) {
LoadNote(baseNoteHex = channel.idHex) {
it?.let {
Text(
@@ -800,7 +832,8 @@ private fun LongChannelHeader(
participantUsers.forEach {
Row(
- Modifier.fillMaxWidth()
+ Modifier
+ .fillMaxWidth()
.padding(start = 10.dp, top = 10.dp)
.clickable {
nav("User/${it.second.pubkeyHex}")
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 535ffffa9..d03ad8ab7 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -477,4 +477,7 @@
Community
Chats
Approved Posts
+
+ This group does not have a description or rules. Talk to the owner to add one
+ This community does not have a description. Talk to the owner to add one