Making some changes to the view model. braking but we will survive
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Shimmer
|
||||
|
||||
enum TimelineAction {
|
||||
case chillin
|
||||
@@ -33,6 +34,28 @@ struct InnerTimelineView: View {
|
||||
}
|
||||
}
|
||||
.padding(.horizontal)
|
||||
.refreshable {
|
||||
<#code#>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct InnerTimelineRedactedView: View {
|
||||
let events: [NostrEvent]
|
||||
let damus: DamusState
|
||||
let show_friend_icon: Bool
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
ForEach(events, id: \.id) { event in
|
||||
EventView(event: event, highlight: .none, has_action_bar: true, damus: damus, show_friend_icon: show_friend_icon)
|
||||
.buttonStyle(PlainButtonStyle())
|
||||
}
|
||||
}
|
||||
.shimmer()
|
||||
.redacted(reason: .placeholder)
|
||||
.padding(.horizontal)
|
||||
.disabled(true)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,8 +75,7 @@ struct TimelineView: View {
|
||||
ScrollViewReader { scroller in
|
||||
ScrollView {
|
||||
if loading {
|
||||
ProgressView()
|
||||
.progressViewStyle(.circular)
|
||||
InnerTimelineRedactedView(events: Constants.EXAMPLE_EVENTS, damus: damus, show_friend_icon: true)
|
||||
}
|
||||
InnerTimelineView(events: $events, damus: damus, show_friend_icon: show_friend_icon, filter: filter)
|
||||
}
|
||||
@@ -67,13 +89,11 @@ struct TimelineView: View {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
struct TimelineView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
TimelineView()
|
||||
TimelineView(events: .constant(Constants.EXAMPLE_EVENTS), loading: .constant(true), damus: Constants.EXAMPLE_DEMOS, show_friend_icon: true, filter: { _ in true })
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
struct NavigationLazyView<Content: View>: View {
|
||||
@@ -85,4 +105,3 @@ struct NavigationLazyView<Content: View>: View {
|
||||
build()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user