mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-04-10 12:59:51 +02:00
Simple refactoring.
This commit is contained in:
parent
b75c3e3031
commit
a5496445d2
@ -728,57 +728,23 @@ private fun RenderNoteRow(
|
||||
) {
|
||||
val noteEvent = baseNote.event
|
||||
when (noteEvent) {
|
||||
is AppDefinitionEvent -> {
|
||||
RenderAppDefinition(baseNote, accountViewModel, nav)
|
||||
}
|
||||
is AudioTrackEvent -> {
|
||||
RenderAudioTrack(baseNote, accountViewModel, nav)
|
||||
}
|
||||
is AudioHeaderEvent -> {
|
||||
RenderAudioHeader(baseNote, accountViewModel, nav)
|
||||
}
|
||||
is ReactionEvent -> {
|
||||
RenderReaction(baseNote, quotesLeft, backgroundColor, accountViewModel, nav)
|
||||
}
|
||||
is RepostEvent -> {
|
||||
RenderRepost(baseNote, quotesLeft, backgroundColor, accountViewModel, nav)
|
||||
}
|
||||
is GenericRepostEvent -> {
|
||||
RenderRepost(baseNote, quotesLeft, backgroundColor, accountViewModel, nav)
|
||||
}
|
||||
is ReportEvent -> {
|
||||
RenderReport(baseNote, quotesLeft, backgroundColor, accountViewModel, nav)
|
||||
}
|
||||
is LongTextNoteEvent -> {
|
||||
RenderLongFormContent(baseNote, accountViewModel, nav)
|
||||
}
|
||||
is WikiNoteEvent -> {
|
||||
RenderWikiContent(baseNote, accountViewModel, nav)
|
||||
}
|
||||
is BadgeAwardEvent -> {
|
||||
RenderBadgeAward(baseNote, backgroundColor, accountViewModel, nav)
|
||||
}
|
||||
is FhirResourceEvent -> {
|
||||
RenderFhirResource(baseNote, accountViewModel, nav)
|
||||
}
|
||||
is PeopleListEvent -> {
|
||||
DisplayPeopleList(baseNote, backgroundColor, accountViewModel, nav)
|
||||
}
|
||||
is RelaySetEvent -> {
|
||||
DisplayRelaySet(baseNote, backgroundColor, accountViewModel, nav)
|
||||
}
|
||||
is PinListEvent -> {
|
||||
RenderPinListEvent(baseNote, backgroundColor, accountViewModel, nav)
|
||||
}
|
||||
is EmojiPackEvent -> {
|
||||
RenderEmojiPack(baseNote, true, backgroundColor, accountViewModel)
|
||||
}
|
||||
is LiveActivitiesEvent -> {
|
||||
RenderLiveActivityEvent(baseNote, accountViewModel, nav)
|
||||
}
|
||||
is GitRepositoryEvent -> {
|
||||
RenderGitRepositoryEvent(baseNote, accountViewModel, nav)
|
||||
}
|
||||
is AppDefinitionEvent -> RenderAppDefinition(baseNote, accountViewModel, nav)
|
||||
is AudioTrackEvent -> RenderAudioTrack(baseNote, accountViewModel, nav)
|
||||
is AudioHeaderEvent -> RenderAudioHeader(baseNote, accountViewModel, nav)
|
||||
is ReactionEvent -> RenderReaction(baseNote, quotesLeft, backgroundColor, accountViewModel, nav)
|
||||
is RepostEvent -> RenderRepost(baseNote, quotesLeft, backgroundColor, accountViewModel, nav)
|
||||
is GenericRepostEvent -> RenderRepost(baseNote, quotesLeft, backgroundColor, accountViewModel, nav)
|
||||
is ReportEvent -> RenderReport(baseNote, quotesLeft, backgroundColor, accountViewModel, nav)
|
||||
is LongTextNoteEvent -> RenderLongFormContent(baseNote, accountViewModel, nav)
|
||||
is WikiNoteEvent -> RenderWikiContent(baseNote, accountViewModel, nav)
|
||||
is BadgeAwardEvent -> RenderBadgeAward(baseNote, backgroundColor, accountViewModel, nav)
|
||||
is FhirResourceEvent -> RenderFhirResource(baseNote, accountViewModel, nav)
|
||||
is PeopleListEvent -> DisplayPeopleList(baseNote, backgroundColor, accountViewModel, nav)
|
||||
is RelaySetEvent -> DisplayRelaySet(baseNote, backgroundColor, accountViewModel, nav)
|
||||
is PinListEvent -> RenderPinListEvent(baseNote, backgroundColor, accountViewModel, nav)
|
||||
is EmojiPackEvent -> RenderEmojiPack(baseNote, true, backgroundColor, accountViewModel)
|
||||
is LiveActivitiesEvent -> RenderLiveActivityEvent(baseNote, accountViewModel, nav)
|
||||
is GitRepositoryEvent -> RenderGitRepositoryEvent(baseNote, accountViewModel, nav)
|
||||
is GitPatchEvent -> {
|
||||
RenderGitPatchEvent(
|
||||
baseNote,
|
||||
@ -842,18 +808,10 @@ private fun RenderNoteRow(
|
||||
nav,
|
||||
)
|
||||
}
|
||||
is FileHeaderEvent -> {
|
||||
FileHeaderDisplay(baseNote, true, accountViewModel)
|
||||
}
|
||||
is VideoHorizontalEvent -> {
|
||||
VideoDisplay(baseNote, makeItShort, canPreview, backgroundColor, accountViewModel, nav)
|
||||
}
|
||||
is VideoVerticalEvent -> {
|
||||
VideoDisplay(baseNote, makeItShort, canPreview, backgroundColor, accountViewModel, nav)
|
||||
}
|
||||
is FileStorageHeaderEvent -> {
|
||||
FileStorageHeaderDisplay(baseNote, true, accountViewModel)
|
||||
}
|
||||
is FileHeaderEvent -> FileHeaderDisplay(baseNote, true, accountViewModel)
|
||||
is VideoHorizontalEvent -> VideoDisplay(baseNote, makeItShort, canPreview, backgroundColor, accountViewModel, nav)
|
||||
is VideoVerticalEvent -> VideoDisplay(baseNote, makeItShort, canPreview, backgroundColor, accountViewModel, nav)
|
||||
is FileStorageHeaderEvent -> FileStorageHeaderDisplay(baseNote, true, accountViewModel)
|
||||
is CommunityPostApprovalEvent -> {
|
||||
RenderPostApproval(
|
||||
baseNote,
|
||||
|
@ -325,10 +325,10 @@ private fun RenderGitRepositoryEvent(
|
||||
accountViewModel: AccountViewModel,
|
||||
nav: (String) -> Unit,
|
||||
) {
|
||||
val title = remember(noteEvent) { noteEvent.name() ?: noteEvent.dTag() }
|
||||
val summary = remember(noteEvent) { noteEvent.description() }
|
||||
val web = remember(noteEvent) { noteEvent.web() }
|
||||
val clone = remember(noteEvent) { noteEvent.clone() }
|
||||
val title = noteEvent.name() ?: noteEvent.dTag()
|
||||
val summary = noteEvent.description()
|
||||
val web = noteEvent.web()
|
||||
val clone = noteEvent.clone()
|
||||
|
||||
Row(
|
||||
modifier =
|
||||
|
Loading…
x
Reference in New Issue
Block a user