mirror of
https://github.com/yattee/yattee.git
synced 2026-06-07 15:24:21 +00:00
Present instance login as full-screen cover on tvOS
The .sheet rendering on tvOS produced a tiny floating modal where the "Sign In" title wrapped onto two lines and form fields overflowed. Use .fullScreenCover on tvOS and wrap the login form in TVSidebarDetailContainer so the title/icon sit in the standard 400pt left sidebar. iOS and macOS keep the existing sheet presentation.
This commit is contained in:
@@ -353,12 +353,21 @@ private struct EditRemoteServerContent: View {
|
||||
Button(String(localized: "common.cancel"), role: .cancel) {}
|
||||
}
|
||||
.presentationCompactAdaptation(.sheet)
|
||||
#if os(tvOS)
|
||||
.fullScreenCover(isPresented: $showLoginSheet) {
|
||||
InstanceLoginView(instance: instance) { credential in
|
||||
appEnvironment?.credentialsManager(for: instance)?.setCredential(credential, for: instance)
|
||||
isLoggedIn = true
|
||||
}
|
||||
}
|
||||
#else
|
||||
.sheet(isPresented: $showLoginSheet) {
|
||||
InstanceLoginView(instance: instance) { credential in
|
||||
appEnvironment?.credentialsManager(for: instance)?.setCredential(credential, for: instance)
|
||||
isLoggedIn = true
|
||||
}
|
||||
}
|
||||
#endif
|
||||
.onAppear {
|
||||
isLoggedIn = appEnvironment?.credentialsManager(for: instance)?.isLoggedIn(for: instance) ?? false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user