mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Improve layout of the feature card block
This commit is contained in:
parent
2d021c2683
commit
cf82f05a93
4 changed files with 96 additions and 50 deletions
|
|
@ -98,8 +98,8 @@ struct AnimatingCellHeight: AnimatableModifier {
|
|||
let title = (LinkedItemFilter(rawValue: viewModel.appliedFilter) ?? LinkedItemFilter.inbox).displayName
|
||||
Text(title)
|
||||
.font(Font.system(size: 18, weight: .semibold))
|
||||
Image(systemName: "chevron.down")
|
||||
.font(Font.system(size: 13, weight: .regular))
|
||||
// Image(systemName: "chevron.down")
|
||||
// .font(Font.system(size: 13, weight: .regular))
|
||||
}.frame(maxWidth: .infinity, alignment: .leading)
|
||||
})
|
||||
}
|
||||
|
|
@ -361,38 +361,45 @@ struct AnimatingCellHeight: AnimatableModifier {
|
|||
|
||||
var featureCard: some View {
|
||||
VStack {
|
||||
Color.thBorderColor.frame(maxWidth: .infinity, maxHeight: 0.5)
|
||||
|
||||
VStack(alignment: .leading, spacing: 15) {
|
||||
Menu(content: {
|
||||
Button(action: {
|
||||
viewModel.updateFeatureFilter(dataService: dataService, filter: .continueReading)
|
||||
HStack {
|
||||
Menu(content: {
|
||||
Button(action: {
|
||||
viewModel.updateFeatureFilter(dataService: dataService, filter: .continueReading)
|
||||
}, label: {
|
||||
Text("Continue Reading")
|
||||
})
|
||||
Button(action: {
|
||||
viewModel.updateFeatureFilter(dataService: dataService, filter: .pinned)
|
||||
}, label: {
|
||||
Text("Pinned")
|
||||
})
|
||||
Button(action: {
|
||||
viewModel.updateFeatureFilter(dataService: dataService, filter: .newsletters)
|
||||
}, label: {
|
||||
Text("Newsletters")
|
||||
})
|
||||
Button(action: {
|
||||
showHideFeatureAlert = true
|
||||
}, label: {
|
||||
Text("Hide this Section")
|
||||
})
|
||||
}, label: {
|
||||
Text("Continue Reading")
|
||||
})
|
||||
Button(action: {
|
||||
viewModel.updateFeatureFilter(dataService: dataService, filter: .pinned)
|
||||
}, label: {
|
||||
Text("Pinned")
|
||||
})
|
||||
Button(action: {
|
||||
viewModel.updateFeatureFilter(dataService: dataService, filter: .newsletters)
|
||||
}, label: {
|
||||
Text("Newsletters")
|
||||
})
|
||||
Button(action: {
|
||||
showHideFeatureAlert = true
|
||||
}, label: {
|
||||
Text("Hide this Section")
|
||||
})
|
||||
}, label: {
|
||||
HStack(alignment: .center) {
|
||||
Text((FeaturedItemFilter(rawValue: viewModel.featureFilter) ?? .continueReading).title)
|
||||
.font(Font.system(size: 13, weight: .medium))
|
||||
Image(systemName: "chevron.down")
|
||||
.font(Font.system(size: 13, weight: .regular))
|
||||
}.frame(maxWidth: .infinity, alignment: .leading)
|
||||
HStack(alignment: .center) {
|
||||
Text((FeaturedItemFilter(rawValue: viewModel.featureFilter) ?? .continueReading).title)
|
||||
.font(Font.system(size: 13, weight: .medium))
|
||||
Image(systemName: "chevron.down")
|
||||
.font(Font.system(size: 13, weight: .regular))
|
||||
}
|
||||
.tint(Color(hex: "#007AFF"))
|
||||
})
|
||||
.padding(.top, 15)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
})
|
||||
Spacer()
|
||||
}
|
||||
.padding(.top, 10)
|
||||
.padding(.horizontal, 15)
|
||||
|
||||
GeometryReader { geo in
|
||||
ScrollView(.horizontal, showsIndicators: false) {
|
||||
|
|
@ -412,13 +419,11 @@ struct AnimatingCellHeight: AnimatableModifier {
|
|||
.fixedSize(horizontal: false, vertical: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}.padding(.horizontal, 15)
|
||||
Color.thBorderColor.frame(maxWidth: .infinity, maxHeight: 0.5)
|
||||
}
|
||||
.padding(.horizontal, 20)
|
||||
|
||||
Color.thFeatureSeparator
|
||||
.frame(maxWidth: .infinity, maxHeight: 10)
|
||||
}
|
||||
.background(Color.systemGray6)
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
|
|
@ -430,14 +435,20 @@ struct AnimatingCellHeight: AnimatableModifier {
|
|||
}
|
||||
|
||||
List {
|
||||
filtersHeader
|
||||
.listRowSeparator(.hidden, edges: .all)
|
||||
.listRowInsets(.init(top: 0, leading: 10, bottom: 0, trailing: 10))
|
||||
|
||||
if viewModel.listConfig.hasFeatureCards,
|
||||
!viewModel.hideFeatureSection,
|
||||
viewModel.items.count > 0,
|
||||
viewModel.searchTerm.isEmpty, viewModel.selectedLabels.isEmpty,
|
||||
viewModel.searchTerm.isEmpty,
|
||||
viewModel.selectedLabels.isEmpty,
|
||||
viewModel.negatedLabels.isEmpty
|
||||
{
|
||||
featureCard
|
||||
.listRowInsets(.init(top: 0, leading: 0, bottom: 0, trailing: 0))
|
||||
.listRowSeparator(.hidden, edges: .all)
|
||||
.modifier(AnimatingCellHeight(height: viewModel.featureItems.count > 0 ? 200 : 130))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,14 +47,14 @@ struct LibraryTabView: View {
|
|||
EmptyView()
|
||||
}
|
||||
TabView {
|
||||
HomeView(viewModel: subViewModel)
|
||||
.tabItem {
|
||||
Label {
|
||||
Text("Subscriptions")
|
||||
} icon: {
|
||||
Image.tabSubscriptions
|
||||
}
|
||||
}
|
||||
// HomeView(viewModel: subViewModel)
|
||||
// .tabItem {
|
||||
// Label {
|
||||
// Text("Subscriptions")
|
||||
// } icon: {
|
||||
// Image.tabSubscriptions
|
||||
// }
|
||||
// }
|
||||
HomeView(viewModel: libraryViewModel)
|
||||
.tabItem {
|
||||
Label {
|
||||
|
|
@ -71,7 +71,7 @@ struct LibraryTabView: View {
|
|||
Image.tabHighlights
|
||||
}
|
||||
}
|
||||
}
|
||||
}.ignoresSafeArea()
|
||||
}
|
||||
}
|
||||
.navigationViewStyle(.stack)
|
||||
|
|
|
|||
|
|
@ -112,10 +112,7 @@ struct LinkItemDetailView: View {
|
|||
if isPDF {
|
||||
pdfContainerView
|
||||
} else if let item = viewModel.item {
|
||||
GeometryReader { geo in
|
||||
let foo = print("READER", geo.size)
|
||||
WebReaderContainerView(item: item)
|
||||
}
|
||||
WebReaderContainerView(item: item)
|
||||
}
|
||||
}
|
||||
.task {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0xEB",
|
||||
"green" : "0xEB",
|
||||
"red" : "0xEB"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0x2A",
|
||||
"green" : "0x2A",
|
||||
"red" : "0x2A"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue