[ADD] Hint for new users who don't have any sources

This commit is contained in:
Fabian Thies
2023-01-16 19:02:58 +01:00
committed by Joe Mattiello
parent 6aaadc79e5
commit fc974a8079
4 changed files with 90 additions and 19 deletions

View File

@@ -42,15 +42,34 @@ struct BrowseView: View {
.bold()
}
}
LazyVStack(spacing: 32) {
ForEach(filteredApps, id: \.bundleIdentifier) { app in
NavigationLink {
AppDetailView(storeApp: app)
if searchText.isEmpty, filteredApps.count == 0 {
HintView {
Text("You don't have any apps yet.")
.bold()
Text("Apps are provided by \"sources\". The specification for them is an open standard, so everyone can create their own source. To get you started, we have compiled a list of \"Trusted Sources\" which you can check out by tapping the button below.")
.font(.callout)
.foregroundColor(.secondary)
SwiftUI.Button {
self.isShowingSourcesView = true
} label: {
BrowseAppPreviewView(storeApp: app)
Label("Add Source", systemSymbol: .plus)
}
.buttonStyle(FilledButtonStyle())
.padding(.top, 8)
}
} else {
LazyVStack(spacing: 32) {
ForEach(filteredApps, id: \.bundleIdentifier) { app in
NavigationLink {
AppDetailView(storeApp: app)
} label: {
BrowseAppPreviewView(storeApp: app)
}
.buttonStyle(PlainButtonStyle())
}
.buttonStyle(PlainButtonStyle())
}
}
}
@@ -111,7 +130,9 @@ struct BrowseView: View {
struct BrowseView_Previews: PreviewProvider {
static var previews: some View {
BrowseView()
NavigationView {
BrowseView()
}
}
}