- LegalDocumentView: renderiza HTML do bundle usando WebView nativo do WebKit (iOS 26+) com suporte a dark mode - AboutView: tela com identidade visual do app, links para os documentos legais e contato - politicadeprivacidade.html / termosecondicoes.html: adicionados ao bundle com CSS para dark mode - BooksView: botão ⓘ na barra de navegação abre AboutView como sheet - PlanSettingsView: seção "Legal" com links diretos para os documentos Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
35 lines
840 B
Swift
35 lines
840 B
Swift
//
|
|
// LegalDocumentView.swift
|
|
// Bible-Week
|
|
//
|
|
// Renderiza documentos legais em HTML usando o WebView nativo do SwiftUI/WebKit.
|
|
//
|
|
|
|
import SwiftUI
|
|
import WebKit
|
|
|
|
struct LegalDocumentView: View {
|
|
let title: String
|
|
let htmlFileName: String
|
|
|
|
private var fileURL: URL? {
|
|
Bundle.main.url(forResource: htmlFileName, withExtension: "html")
|
|
}
|
|
|
|
var body: some View {
|
|
Group {
|
|
if let url = fileURL {
|
|
WebView(url: url)
|
|
} else {
|
|
ContentUnavailableView(
|
|
"Documento não encontrado",
|
|
systemImage: "doc.slash",
|
|
description: Text("O documento não pôde ser carregado.")
|
|
)
|
|
}
|
|
}
|
|
.navigationTitle(title)
|
|
.navigationBarTitleDisplayMode(.inline)
|
|
}
|
|
}
|