another.im-ios/AnotherIM/View/Main/ChatList/ChatsCreateScreenMain.swift
2024-10-31 12:43:16 +01:00

81 lines
2.7 KiB
Swift

import SwiftUI
struct ChatsCreateScreenMain: View {
@Environment(\.router) var router
var body: some View {
ZStack {
// Background color
Color.Material.Background.light
.ignoresSafeArea()
// Content
VStack(spacing: 0) {
// Header
SharedNavigationBar(
leftButton: .init(
image: Image(systemName: "xmark"),
action: {
router.dismissScreen()
}
),
centerText: .init(text: L10n.Chats.Create.Main.title)
)
// List
List {
// Groups creation buttons
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.createPrivateGroup,
controlType: .none
).onTapGesture {
print("Tapped createPrivateGroup")
}
// Channel buttons
SharedListRow(
iconType: .image(Image(systemName: "globe.americas"), .Material.Elements.active),
text: L10n.Chats.Create.Main.createChannel,
controlType: .none
).onTapGesture {
print("Tapped createChannel")
}
SharedListRow(
iconType: .image(Image(systemName: "magnifyingglass"), .Material.Elements.active),
text: L10n.Chats.Create.Main.findChannel,
controlType: .none
).onTapGesture {
print("Tapped findChannel")
}
// for contacts list (later)
// let rosters = store.state.rostersState.rosters.filter { !$0.locallyDeleted }
// if rosters.isEmpty {
// ChatsCreateRowSeparator()
// }
}
.listStyle(.plain)
Spacer()
}
}
}
}
private struct ChatsCreateRowSeparator: View {
var body: some View {
Text("aa")
}
}