another.im-ios/ConversationsClassic/View/Main/Settings/SettingsScreen.swift

91 lines
3.3 KiB
Swift
Raw Normal View History

2024-06-19 15:15:27 +00:00
import SwiftUI
struct SettingsScreen: View {
2024-10-04 15:58:04 +00:00
@EnvironmentObject var clientsStore: ClientsStore
2024-06-19 15:15:27 +00:00
var body: some View {
ZStack {
2024-10-07 12:54:07 +00:00
// Background color
2024-07-04 08:21:12 +00:00
Color.Material.Background.light
2024-06-19 15:15:27 +00:00
.ignoresSafeArea()
2024-10-07 12:54:07 +00:00
// Content
VStack(spacing: 0) {
// Header
SharedNavigationBar(
centerText: .init(text: L10n.Settings.Main.title)
)
// List
List {
// Accounts section
SharedSectionTitle(text: L10n.Settings.Section.Accounts.title)
ForEach(clientsStore.clients) { client in
SharedListRow(
iconType: .image(Image(systemName: "person.fill"), .Material.Elements.active),
text: "name",
controlType: .none
)
.onTapGesture {
print("Tapped client: \(client.name)")
}
}
SharedListRow(
iconType: .image(Image(systemName: "person.2.fill"), .Material.Elements.active),
text: L10n.Chats.Create.Main.createGroup,
controlType: .none
)
.onTapGesture {
print("Tapped createGroup")
}
SharedListRow(
iconType: .image(Image(systemName: "person.2.fill"), .Material.Elements.active),
text: L10n.Chats.Create.Main.createGroup,
controlType: .none
)
.onTapGesture {
print("Tapped createGroup")
}
SharedListRow(
iconType: .image(Image(systemName: "person.2.fill"), .Material.Elements.active),
text: L10n.Chats.Create.Main.createGroup,
controlType: .none
)
.onTapGesture {
print("Tapped createGroup")
}
SharedListRow(
iconType: .image(Image(systemName: "person.2.fill"), .Material.Elements.active),
text: L10n.Chats.Create.Main.createGroup,
controlType: .none
)
.onTapGesture {
print("Tapped createGroup")
}
// Dev section
#if DEBUG
SharedSectionTitle(text: "Dev tools")
SharedListRow(
iconType: .image(Image(systemName: "xmark.octagon"), .Material.Elements.active),
text: "Clean all data",
controlType: .none
)
.onTapGesture {
clientsStore.flushAllData()
Database.shared.flushAllData()
}
#endif
2024-10-04 15:58:04 +00:00
}
2024-10-07 12:54:07 +00:00
.listStyle(.plain)
.environment(\.defaultMinListRowHeight, 10)
Spacer()
}
2024-06-19 15:15:27 +00:00
}
}
}