another.im-ios/ConversationsClassic/View/SharedComponents/SharedTabBar.swift

79 lines
2.4 KiB
Swift
Raw Normal View History

2024-06-19 15:15:27 +00:00
import SwiftUI
struct SharedTabBar: View {
var body: some View {
VStack(spacing: 0) {
Rectangle()
.frame(maxWidth: .infinity)
.frame(height: 0.2)
2024-07-04 08:21:12 +00:00
.foregroundColor(.Material.Shape.separator)
2024-08-11 15:04:42 +00:00
// HStack(spacing: 0) {
// SharedTabBarButton(buttonFlow: .main(.contacts(.list)))
// SharedTabBarButton(buttonFlow: .main(.conversations))
// SharedTabBarButton(buttonFlow: .main(.settings))
// }
// .background(Color.Material.Background.dark)
2024-06-19 15:15:27 +00:00
}
.frame(height: 50)
}
}
private struct SharedTabBarButton: View {
2024-08-11 15:04:42 +00:00
// let buttonFlow: NavigationStore.Flow
2024-06-19 15:15:27 +00:00
var body: some View {
ZStack {
VStack(spacing: 2) {
buttonImg
2024-08-11 15:04:42 +00:00
// .foregroundColor(buttonFlow == navigation.flow ? .Material.Elements.active : .Material.Elements.inactive)
2024-06-19 15:15:27 +00:00
.font(.system(size: 24, weight: .light))
.symbolRenderingMode(.hierarchical)
Text(buttonTitle)
.font(.sub1)
2024-08-11 15:04:42 +00:00
// .foregroundColor(buttonFlow == navigation.flow ? .Material.Text.main : .Material.Elements.inactive)
2024-06-19 15:15:27 +00:00
}
Rectangle()
.foregroundColor(.white.opacity(0.01))
.onTapGesture {
2024-08-11 15:04:42 +00:00
// withAnimation {
// navigation.flow = buttonFlow
// }
2024-06-19 15:15:27 +00:00
}
}
}
var buttonImg: Image {
2024-08-11 15:04:42 +00:00
// 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")
2024-06-19 15:15:27 +00:00
2024-08-11 15:04:42 +00:00
// default:
// return Image(systemName: "questionmark.circle")
// }
Image(systemName: "questionmark.circle")
2024-06-19 15:15:27 +00:00
}
var buttonTitle: String {
2024-08-11 15:04:42 +00:00
""
// switch buttonFlow {
// case .main(.contacts(.list)):
// return "Contacts"
//
// case .main(.conversations):
// return "Chats"
//
// case .main(.settings):
// return "Settings"
//
// default:
// return "Unknown"
// }
2024-06-19 15:15:27 +00:00
}
}