mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Merge pull request #145 from writeas/fix-ui-for-log-out-alert
Show alert instead of sheet on logout
This commit is contained in:
commit
c87309d6b0
@ -43,22 +43,13 @@ struct AccountLogoutView: View {
|
||||
Text("Log Out")
|
||||
})
|
||||
}
|
||||
.sheet(isPresented: $isPresentingLogoutConfirmation) {
|
||||
VStack {
|
||||
Text("Log Out?")
|
||||
.font(.title)
|
||||
Text("\(editedPostsWarningString)You won't lose any local posts. Are you sure?")
|
||||
HStack {
|
||||
Button(action: model.logout, label: {
|
||||
Text("Log Out")
|
||||
})
|
||||
Button(action: {
|
||||
self.isPresentingLogoutConfirmation = false
|
||||
}, label: {
|
||||
Text("Cancel")
|
||||
}).keyboardShortcut(.cancelAction)
|
||||
}
|
||||
}
|
||||
.alert(isPresented: $isPresentingLogoutConfirmation) {
|
||||
Alert(
|
||||
title: Text("Log Out?"),
|
||||
message: Text("\(editedPostsWarningString)You won't lose any local posts. Are you sure?"),
|
||||
primaryButton: .cancel(Text("Cancel"), action: { self.isPresentingLogoutConfirmation = false }),
|
||||
secondaryButton: .destructive(Text("Log Out"), action: model.logout )
|
||||
)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user