wip
This commit is contained in:
parent
2e053afea9
commit
4ecd62ffe5
|
@ -1,7 +1,7 @@
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
struct AddContactOrChannelScreen: View {
|
struct AddContactOrChannelScreen: View {
|
||||||
// @EnvironmentObject var store: AppStore
|
@Environment(\.router) var router
|
||||||
|
|
||||||
// enum Field {
|
// enum Field {
|
||||||
// case account
|
// case account
|
||||||
|
@ -31,10 +31,7 @@ struct AddContactOrChannelScreen: View {
|
||||||
leftButton: .init(
|
leftButton: .init(
|
||||||
image: Image(systemName: "xmark"),
|
image: Image(systemName: "xmark"),
|
||||||
action: {
|
action: {
|
||||||
// withAnimation {
|
router.dismissScreen()
|
||||||
// navigation.flow = .main(.contacts(.list))
|
|
||||||
// }
|
|
||||||
// isPresented = false
|
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
centerText: .init(text: L10n.Contacts.Add.title),
|
centerText: .init(text: L10n.Contacts.Add.title),
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
struct ContactsScreen: View {
|
struct ContactsScreen: View {
|
||||||
|
@Environment(\.router) var router
|
||||||
@EnvironmentObject var clientsStore: ClientsStore
|
@EnvironmentObject var clientsStore: ClientsStore
|
||||||
@StateObject var rostersStore = RostersStore(clientsPublisher: ClientsStore.shared.$clients)
|
@StateObject var rostersStore = RostersStore(clientsPublisher: ClientsStore.shared.$clients)
|
||||||
|
|
||||||
// @State private var addPanelPresented = false
|
// @State private var addPanelPresented = false
|
||||||
// @State private var isErrorAlertPresented = false
|
// @State private var isErrorAlertPresented = false
|
||||||
// @State private var errorAlertMessage = ""
|
// @State private var errorAlertMessage = ""
|
||||||
|
@ -22,10 +24,9 @@ struct ContactsScreen: View {
|
||||||
rightButton: .init(
|
rightButton: .init(
|
||||||
image: Image(systemName: "plus"),
|
image: Image(systemName: "plus"),
|
||||||
action: {
|
action: {
|
||||||
// withAnimation {
|
router.showScreen(.fullScreenCover) { _ in
|
||||||
// navigation.flow = .main(.contacts(.add))
|
AddContactOrChannelScreen()
|
||||||
// }
|
}
|
||||||
// addPanelPresented = true
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,78 +0,0 @@
|
||||||
import SwiftUI
|
|
||||||
|
|
||||||
struct SharedTabBar: View {
|
|
||||||
var body: some View {
|
|
||||||
VStack(spacing: 0) {
|
|
||||||
Rectangle()
|
|
||||||
.frame(maxWidth: .infinity)
|
|
||||||
.frame(height: 0.2)
|
|
||||||
.foregroundColor(.Material.Shape.separator)
|
|
||||||
// HStack(spacing: 0) {
|
|
||||||
// SharedTabBarButton(buttonFlow: .main(.contacts(.list)))
|
|
||||||
// SharedTabBarButton(buttonFlow: .main(.conversations))
|
|
||||||
// SharedTabBarButton(buttonFlow: .main(.settings))
|
|
||||||
// }
|
|
||||||
// .background(Color.Material.Background.dark)
|
|
||||||
}
|
|
||||||
.frame(height: 50)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private struct SharedTabBarButton: View {
|
|
||||||
// let buttonFlow: NavigationStore.Flow
|
|
||||||
|
|
||||||
var body: some View {
|
|
||||||
ZStack {
|
|
||||||
VStack(spacing: 2) {
|
|
||||||
buttonImg
|
|
||||||
// .foregroundColor(buttonFlow == navigation.flow ? .Material.Elements.active : .Material.Elements.inactive)
|
|
||||||
.font(.system(size: 24, weight: .light))
|
|
||||||
.symbolRenderingMode(.hierarchical)
|
|
||||||
Text(buttonTitle)
|
|
||||||
.font(.sub1)
|
|
||||||
// .foregroundColor(buttonFlow == navigation.flow ? .Material.Text.main : .Material.Elements.inactive)
|
|
||||||
}
|
|
||||||
Rectangle()
|
|
||||||
.foregroundColor(.white.opacity(0.01))
|
|
||||||
.onTapGesture {
|
|
||||||
// withAnimation {
|
|
||||||
// navigation.flow = buttonFlow
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var buttonImg: Image {
|
|
||||||
// switch buttonFlow {
|
|
||||||
// case .main(.contacts):
|
|
||||||
// return Image(systemName: "person.2.fill")
|
|
||||||
//
|
|
||||||
// case .main(.conversations):
|
|
||||||
// return Image(systemName: "bubble.left.fill")
|
|
||||||
//
|
|
||||||
// case .main(.settings):
|
|
||||||
// return Image(systemName: "gearshape.fill")
|
|
||||||
|
|
||||||
// default:
|
|
||||||
// return Image(systemName: "questionmark.circle")
|
|
||||||
// }
|
|
||||||
Image(systemName: "questionmark.circle")
|
|
||||||
}
|
|
||||||
|
|
||||||
var buttonTitle: String {
|
|
||||||
""
|
|
||||||
// switch buttonFlow {
|
|
||||||
// case .main(.contacts(.list)):
|
|
||||||
// return "Contacts"
|
|
||||||
//
|
|
||||||
// case .main(.conversations):
|
|
||||||
// return "Chats"
|
|
||||||
//
|
|
||||||
// case .main(.settings):
|
|
||||||
// return "Settings"
|
|
||||||
//
|
|
||||||
// default:
|
|
||||||
// return "Unknown"
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue