ShareLogNoticeView.swift 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // LoopFollow
  2. // ShareLogNoticeView.swift
  3. import SwiftUI
  4. struct ShareLogNoticeView: View {
  5. @State private var noticeText: String = ""
  6. let onCancel: () -> Void
  7. let onShare: (String) -> Void
  8. var body: some View {
  9. NavigationView {
  10. Form {
  11. Section {
  12. Text("Thanks for sharing these logs to help us find the problem. Please describe it in as much detail as possible — what time did it happen, what did you do, and what did you expect to happen that didn't?")
  13. .font(.callout)
  14. .foregroundColor(.secondary)
  15. }
  16. Section(header: Text("Description")) {
  17. TextEditor(text: $noticeText)
  18. .frame(minHeight: 180)
  19. }
  20. }
  21. .preferredColorScheme(Storage.shared.appearanceMode.value.colorScheme)
  22. .navigationBarTitle("Share Logs", displayMode: .inline)
  23. .toolbar {
  24. ToolbarItem(placement: .cancellationAction) {
  25. Button("Cancel", action: onCancel)
  26. }
  27. ToolbarItem(placement: .confirmationAction) {
  28. Button("Share") { onShare(noticeText) }
  29. }
  30. }
  31. }
  32. }
  33. }