watchOS notification screen

This commit is contained in:
2025-10-29 22:13:29 +08:00
parent fcbd5fe680
commit 82682cae9a
6 changed files with 342 additions and 7 deletions

View File

@@ -17,23 +17,24 @@ struct ComposePostView: View {
Form {
TextField("Title", text: $viewModel.title)
TextField("Content", text: $viewModel.content)
.frame(height: 100)
}
.navigationTitle("New Post")
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Button("Cancel") {
Button("Cancel", systemImage: "xmark") {
dismiss()
}
.labelStyle(.iconOnly)
}
ToolbarItem(placement: .confirmationAction) {
Button("Post") {
Button("Post", systemImage: "square.and.arrow.up") {
Task {
if let token = appState.token, let serverUrl = appState.serverUrl {
await viewModel.createPost(token: token, serverUrl: serverUrl)
}
}
}
.labelStyle(.iconOnly)
.disabled(viewModel.isPosting)
}
}