Message for no statuses

This commit is contained in:
Lumaa 2023-12-29 12:54:11 +01:00
parent 0a30ba67ed
commit c70a9b6bb4
1 changed files with 39 additions and 13 deletions

View File

@ -13,22 +13,48 @@ struct TimelineView: View {
var body: some View { var body: some View {
NavigationStack(path: $navigator.path) { NavigationStack(path: $navigator.path) {
if statuses != nil { if statuses != nil {
ScrollView(showsIndicators: false) { if !statuses!.isEmpty {
Image("HeroIcon") ScrollView(showsIndicators: false) {
.resizable() Image("HeroIcon")
.aspectRatio(contentMode: .fit) .resizable()
.frame(width: 30) .aspectRatio(contentMode: .fit)
.padding(.bottom) .frame(width: 30)
.padding(.bottom)
ForEach(statuses!, id: \.id) { status in
VStack(spacing: 2) { ForEach(statuses!, id: \.id) { status in
CompactPostView(status: status, navigator: navigator) VStack(spacing: 2) {
CompactPostView(status: status, navigator: navigator)
}
} }
} }
.padding(.top)
.background(Color.appBackground)
.withAppRouter()
} else {
ZStack {
Color.appBackground
.ignoresSafeArea()
VStack {
Image("HeroIcon")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 50)
.padding(.bottom)
ContentUnavailableView {
Text("timeline.empty")
.bold()
} description: {
Text("timeline.empty.description")
}
.scrollDisabled(true)
}
.scrollDisabled(true)
.background(Color.appBackground)
.frame(height: 150)
}
} }
.padding(.top)
.background(Color.appBackground)
.withAppRouter()
} else { } else {
ZStack { ZStack {
Color.appBackground Color.appBackground