another.im-ios/ConversationsClassic/View/Main/Settings/SettingsScreen.swift
2024-10-07 14:54:07 +02:00

91 lines
3.3 KiB
Swift

import SwiftUI
struct SettingsScreen: View {
@EnvironmentObject var clientsStore: ClientsStore
var body: some View {
ZStack {
// Background color
Color.Material.Background.light
.ignoresSafeArea()
// 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
}
.listStyle(.plain)
.environment(\.defaultMinListRowHeight, 10)
Spacer()
}
}
}
}