Fix PDF button display and improve hymn/bible verse fallback handling
This commit is contained in:
parent
7e6e0178eb
commit
781d187aff
|
@ -505,7 +505,7 @@
|
|||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CODE_SIGN_ENTITLEMENTS = RTSDA.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
CURRENT_PROJECT_VERSION = 2;
|
||||
DEVELOPMENT_ASSET_PATHS = "\"Preview Content\"";
|
||||
DEVELOPMENT_TEAM = TQMND62F2W;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
|
@ -548,7 +548,7 @@
|
|||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CODE_SIGN_ENTITLEMENTS = RTSDA.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
CURRENT_PROJECT_VERSION = 2;
|
||||
DEVELOPMENT_ASSET_PATHS = "\"Preview Content\"";
|
||||
DEVELOPMENT_TEAM = TQMND62F2W;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
|
|
|
@ -241,7 +241,7 @@ struct BulletinDetailView: View {
|
|||
.padding(.horizontal)
|
||||
|
||||
// PDF Download Button
|
||||
if !bulletin.pdfUrl.isEmpty {
|
||||
if let pdf = bulletin.pdf, !pdf.isEmpty {
|
||||
if let url = URL(string: bulletin.pdfUrl) {
|
||||
Button(action: {
|
||||
UIApplication.shared.open(url)
|
||||
|
|
|
@ -52,47 +52,6 @@ struct BulletinListView: View {
|
|||
}
|
||||
}
|
||||
|
||||
struct BulletinDetailView: View {
|
||||
let bulletin: Bulletin
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
VStack(alignment: .leading, spacing: 20) {
|
||||
// Header
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
Text(bulletin.date.formatted(date: .long, time: .omitted))
|
||||
.font(.subheadline)
|
||||
.foregroundColor(.secondary)
|
||||
|
||||
Text(bulletin.title)
|
||||
.font(.title)
|
||||
.fontWeight(.bold)
|
||||
}
|
||||
|
||||
// PDF Download Button
|
||||
if let pdfUrl = bulletin.pdfUrl, let url = URL(string: pdfUrl) {
|
||||
Link(destination: url) {
|
||||
Label("Download PDF", systemImage: "doc.fill")
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding()
|
||||
.background(Color.blue)
|
||||
.foregroundColor(.white)
|
||||
.cornerRadius(10)
|
||||
}
|
||||
}
|
||||
|
||||
// Sections
|
||||
ForEach(bulletin.sections, id: \.title) { section in
|
||||
BulletinSectionView(section: section)
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
}
|
||||
}
|
||||
|
||||
struct BulletinSectionView: View {
|
||||
let section: BulletinSection
|
||||
|
||||
|
@ -181,7 +140,7 @@ struct BulletinRowView: View {
|
|||
.font(.headline)
|
||||
.lineLimit(2)
|
||||
|
||||
if bulletin.pdfUrl != nil {
|
||||
if let pdf = bulletin.pdf, !pdf.isEmpty {
|
||||
Label("PDF Available", systemImage: "doc.fill")
|
||||
.font(.caption)
|
||||
.foregroundColor(.blue)
|
||||
|
|
Loading…
Reference in a new issue