Ferrite-backup/Ferrite/Views/CommonViews/TestHostingView.swift
kingbri 438e48be66 Ferrite: Format
Signed-off-by: kingbri <bdashore3@proton.me>
2023-03-03 15:09:34 -05:00

75 lines
2.4 KiB
Swift

//
// TestHostingView.swift
// Ferrite
//
// Created by Brian Dashore on 2/13/23.
//
import SwiftUI
struct TestHostingView: View {
@State private var textName = "First"
@State private var secondTextName = "First"
var body: some View {
ScrollView(.horizontal, showsIndicators: false) {
HStack {
Menu {
Picker("", selection: $textName) {
Text("First").tag("First")
Text("Second").tag("Second")
Text("Third").tag("Third")
}
} label: {
HStack(spacing: 2) {
Text(textName)
.opacity(0.6)
.foregroundColor(.primary)
Image(systemName: "chevron.down")
.foregroundColor(.tertiaryLabel)
}
.padding(.horizontal, 9)
.padding(.vertical, 7)
.font(.caption, weight: .bold)
.background(Capsule().foregroundColor(.secondarySystemFill))
}
.id(textName)
.transaction {
$0.animation = .none
}
Menu {
Picker("", selection: $secondTextName) {
Text("First").tag("First")
Text("Second").tag("Second")
Text("Third").tag("Third")
}
} label: {
HStack(spacing: 2) {
Text(secondTextName)
.opacity(0.6)
.foregroundColor(.primary)
Image(systemName: "chevron.down")
.foregroundColor(.tertiaryLabel)
}
.padding(.horizontal, 9)
.padding(.vertical, 7)
.font(.caption, weight: .bold)
.background(Capsule().foregroundColor(.secondarySystemFill))
}
.id(secondTextName)
.transaction {
$0.animation = .none
}
}
.padding(.horizontal, 18)
}
}
}
struct TestHostingView_Previews: PreviewProvider {
static var previews: some View {
TestHostingView()
}
}