mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
set navBarHeight in one place
This commit is contained in:
parent
201576ec7a
commit
6a41484bca
3 changed files with 5 additions and 4 deletions
|
|
@ -180,7 +180,7 @@ struct LinkItemDetailView: View {
|
|||
.padding(.horizontal)
|
||||
.scaleEffect(navBarVisibilityRatio)
|
||||
}
|
||||
.frame(height: LinkItemDetailView.navBarHeight * navBarVisibilityRatio)
|
||||
.frame(height: readerViewNavBarHeight * navBarVisibilityRatio)
|
||||
.opacity(navBarVisibilityRatio)
|
||||
.background(Color.systemBackground)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ import SwiftUI
|
|||
import Utils
|
||||
import WebKit
|
||||
|
||||
public let readerViewNavBarHeight = 50.0
|
||||
|
||||
#if os(iOS)
|
||||
struct WebAppView: UIViewRepresentable {
|
||||
let request: URLRequest
|
||||
|
|
@ -34,8 +36,8 @@ import WebKit
|
|||
webView.backgroundColor = UIColor.clear
|
||||
webView.configuration.userContentController = contentController
|
||||
webView.scrollView.delegate = context.coordinator
|
||||
webView.scrollView.contentInset.top = 50.0 // TODO: LinkItemDetailView.navBarHeight
|
||||
webView.scrollView.verticalScrollIndicatorInsets.top = 50.0 // TODO: LinkItemDetailView.navBarHeight
|
||||
webView.scrollView.contentInset.top = readerViewNavBarHeight
|
||||
webView.scrollView.verticalScrollIndicatorInsets.top = readerViewNavBarHeight
|
||||
|
||||
for action in WebViewAction.allCases {
|
||||
webView.configuration.userContentController.add(context.coordinator, name: action.rawValue)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import SwiftUI
|
|||
import WebKit
|
||||
|
||||
final class WebAppViewCoordinator: NSObject {
|
||||
let navBarHeight = 50.0 // TODO: LinkItemDetailView.navBarHeight
|
||||
var webViewActionHandler: (WKScriptMessage) -> Void = { _ in }
|
||||
var linkHandler: (URL) -> Void = { _ in }
|
||||
var needsReload = true
|
||||
|
|
|
|||
Loading…
Reference in a new issue