Source code for the WriteFreely SwiftUI app for iOS, iPadOS, and macOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

68 lines
2.5 KiB

  1. import SwiftUI
  2. struct SettingsView: View {
  3. @EnvironmentObject var model: WriteFreelyModel
  4. var body: some View {
  5. VStack {
  6. SettingsHeaderView()
  7. Form {
  8. Section(header: Text("Login Details")) {
  9. AccountView()
  10. .withErrorHandling()
  11. }
  12. Section(header: Text("Appearance")) {
  13. PreferencesView(preferences: model.preferences)
  14. }
  15. Section(header: Text("External Links")) {
  16. HStack {
  17. Spacer()
  18. Link("View the Guide", destination: model.howToURL)
  19. Spacer()
  20. }
  21. HStack {
  22. Spacer()
  23. Link("Visit the Help Forum", destination: model.helpURL)
  24. Spacer()
  25. }
  26. HStack {
  27. Spacer()
  28. Link("Write a Review on the App Store", destination: model.reviewURL)
  29. Spacer()
  30. }
  31. }
  32. Section(header: Text("Acknowledgements")) {
  33. VStack {
  34. VStack(alignment: .leading) {
  35. Text("This application makes use of the following open-source projects:")
  36. .padding(.bottom)
  37. Text("• Lora typeface")
  38. .padding(.leading)
  39. Text("• Open Sans typeface")
  40. .padding(.leading)
  41. Text("• Hack typeface")
  42. .padding(.leading)
  43. }
  44. .padding(.bottom)
  45. .foregroundColor(.secondary)
  46. HStack {
  47. Spacer()
  48. Link("View the licenses", destination: model.licensesURL)
  49. Spacer()
  50. }
  51. }
  52. .padding()
  53. }
  54. }
  55. }
  56. // .preferredColorScheme(preferences.selectedColorScheme) // See PreferencesModel for info.
  57. }
  58. }
  59. struct SettingsView_Previews: PreviewProvider {
  60. static var previews: some View {
  61. SettingsView()
  62. .environmentObject(WriteFreelyModel())
  63. }
  64. }