copinism-ios/copinism/Views/Home/Components/NavBarView.swift
2024-06-04 09:41:01 +08:00

45 lines
1.2 KiB
Swift

//
//
import SwiftUI
struct NavBarView: View {
@Binding var tags: [Tag]
@Binding var tagActiveIndex: Int
@Binding var isShowPopup: Bool
var body: some View {
HStack {
ScrollView(.horizontal, showsIndicators: false) {
HStack(spacing: 16) {
ForEach(tags.indices, id: \.self) { index in
Button {
tagActiveIndex = index
} label: {
Text(tags[index].name)
.SetTextStyle(size: tagActiveIndex == index ? 15 : 14, color: tagActiveIndex == index ? .black : .gray)
}
}
}
.font(.system(size: 16))
}
//
Button {
withAnimation {
isShowPopup = true
}
} label: {
Image(systemName: "chevron.down")
}
.foregroundStyle(.black.opacity(0.5))
}
.padding(.horizontal, 12)
.padding(.vertical, 3)
.background(.white)
}
}