mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-08 23:54:39 +00:00
Merge pull request #3379 from vitorpamplona/claude/notecompose-zap-split-preview-dgn0js
Show boosted notes as compact preview in activity cards
This commit is contained in:
@@ -769,6 +769,7 @@ fun InnerNoteWithReactions(
|
||||
unPackReply = unPackReply,
|
||||
accountViewModel = accountViewModel,
|
||||
nav = nav,
|
||||
isBoostedNote = isBoostedNote,
|
||||
)
|
||||
|
||||
if (!makeItShort) {
|
||||
@@ -917,6 +918,7 @@ private fun RenderNoteRow(
|
||||
editState: State<GenericLoadable<EditState>>,
|
||||
accountViewModel: AccountViewModel,
|
||||
nav: INav,
|
||||
isBoostedNote: Boolean = false,
|
||||
) {
|
||||
when (val noteEvent = baseNote.event) {
|
||||
is AppDefinitionEvent -> {
|
||||
@@ -1395,6 +1397,7 @@ private fun RenderNoteRow(
|
||||
backgroundColor,
|
||||
accountViewModel,
|
||||
nav,
|
||||
isBoostedNote = isBoostedNote,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1407,6 +1410,7 @@ private fun RenderNoteRow(
|
||||
backgroundColor,
|
||||
accountViewModel,
|
||||
nav,
|
||||
isBoostedNote = isBoostedNote,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1419,6 +1423,7 @@ private fun RenderNoteRow(
|
||||
backgroundColor,
|
||||
accountViewModel,
|
||||
nav,
|
||||
isBoostedNote = isBoostedNote,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1554,6 +1559,7 @@ private fun RenderNoteRow(
|
||||
backgroundColor,
|
||||
accountViewModel,
|
||||
nav,
|
||||
isBoostedNote = isBoostedNote,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1568,6 +1574,7 @@ private fun RenderNoteRow(
|
||||
editState,
|
||||
accountViewModel,
|
||||
nav,
|
||||
isBoostedNote = isBoostedNote,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,11 +49,15 @@ fun RenderChat(
|
||||
backgroundColor: MutableState<Color>,
|
||||
accountViewModel: AccountViewModel,
|
||||
nav: INav,
|
||||
isBoostedNote: Boolean = false,
|
||||
) {
|
||||
val noteEvent = note.event ?: return
|
||||
val eventContent = remember(noteEvent) { noteEvent.content }
|
||||
|
||||
if (makeItShort && accountViewModel.isLoggedUser(note.author)) {
|
||||
// A boosted note inside a zap/nutzap/onchain activity card is always shown as a
|
||||
// compact 2-line preview, even when the logged-in user is only a zap-split
|
||||
// beneficiary (and thus not the author) of the post being zapped.
|
||||
if (makeItShort && (isBoostedNote || accountViewModel.isLoggedUser(note.author))) {
|
||||
Text(
|
||||
text = eventContent,
|
||||
color = MaterialTheme.colorScheme.placeholderText,
|
||||
|
||||
@@ -116,10 +116,14 @@ fun RenderPoll(
|
||||
backgroundColor: MutableState<Color>,
|
||||
accountViewModel: AccountViewModel,
|
||||
nav: INav,
|
||||
isBoostedNote: Boolean = false,
|
||||
) {
|
||||
val noteEvent = note.event as? PollEvent ?: return
|
||||
|
||||
if (makeItShort && accountViewModel.isLoggedUser(note.author)) {
|
||||
// A boosted note inside a zap/nutzap/onchain activity card is always shown as a
|
||||
// compact 2-line preview, even when the logged-in user is only a zap-split
|
||||
// beneficiary (and thus not the author) of the post being zapped.
|
||||
if (makeItShort && (isBoostedNote || accountViewModel.isLoggedUser(note.author))) {
|
||||
Text(
|
||||
text = noteEvent.content,
|
||||
color = MaterialTheme.colorScheme.placeholderText,
|
||||
|
||||
@@ -55,11 +55,15 @@ fun RenderPublicMessage(
|
||||
backgroundColor: MutableState<Color>,
|
||||
accountViewModel: AccountViewModel,
|
||||
nav: INav,
|
||||
isBoostedNote: Boolean = false,
|
||||
) {
|
||||
val noteEvent = note.event as? PublicMessageEvent ?: return
|
||||
val content = remember(noteEvent) { noteEvent.peopleAndContent() }
|
||||
|
||||
if (makeItShort && accountViewModel.isLoggedUser(note.author)) {
|
||||
// A boosted note inside a zap/nutzap/onchain activity card is always shown as a
|
||||
// compact 2-line preview, even when the logged-in user is only a zap-split
|
||||
// beneficiary (and thus not the author) of the post being zapped.
|
||||
if (makeItShort && (isBoostedNote || accountViewModel.isLoggedUser(note.author))) {
|
||||
Text(
|
||||
text = content,
|
||||
color = MaterialTheme.colorScheme.placeholderText,
|
||||
|
||||
@@ -79,6 +79,7 @@ fun RenderTextEvent(
|
||||
editState: State<GenericLoadable<EditState>>,
|
||||
accountViewModel: AccountViewModel,
|
||||
nav: INav,
|
||||
isBoostedNote: Boolean = false,
|
||||
) {
|
||||
val noteEvent = note.event ?: return
|
||||
|
||||
@@ -183,7 +184,10 @@ fun RenderTextEvent(
|
||||
}
|
||||
}
|
||||
|
||||
if (makeItShort && accountViewModel.isLoggedUser(note.author)) {
|
||||
// A boosted note inside a zap/nutzap/onchain activity card is always shown as a
|
||||
// compact 2-line preview, even when the logged-in user is only a zap-split
|
||||
// beneficiary (and thus not the author) of the post being zapped.
|
||||
if (makeItShort && (isBoostedNote || accountViewModel.isLoggedUser(note.author))) {
|
||||
Text(
|
||||
text = eventContent,
|
||||
color = MaterialTheme.colorScheme.placeholderText,
|
||||
|
||||
@@ -60,6 +60,7 @@ fun RenderZapPoll(
|
||||
backgroundColor: MutableState<Color>,
|
||||
accountViewModel: AccountViewModel,
|
||||
nav: INav,
|
||||
isBoostedNote: Boolean = false,
|
||||
) {
|
||||
val noteEvent = note.event as? ZapPollEvent ?: return
|
||||
val eventContent = noteEvent.content
|
||||
@@ -92,7 +93,10 @@ fun RenderZapPoll(
|
||||
}
|
||||
}
|
||||
|
||||
if (makeItShort && accountViewModel.isLoggedUser(note.author)) {
|
||||
// A boosted note inside a zap/nutzap/onchain activity card is always shown as a
|
||||
// compact 2-line preview, even when the logged-in user is only a zap-split
|
||||
// beneficiary (and thus not the author) of the post being zapped.
|
||||
if (makeItShort && (isBoostedNote || accountViewModel.isLoggedUser(note.author))) {
|
||||
Text(
|
||||
text = eventContent,
|
||||
color = MaterialTheme.colorScheme.placeholderText,
|
||||
|
||||
Reference in New Issue
Block a user