fwe
This commit is contained in:
parent
d805d0c660
commit
77a50a7dd2
@ -12,47 +12,59 @@ public struct SelectView: View {
|
||||
@State var title: String
|
||||
@Binding var text: String
|
||||
let variants: [String]
|
||||
let titleOne: String
|
||||
|
||||
public init(title: String, text: Binding<String>, variants: [String]) {
|
||||
public init(titleOne: String = "",title: String, text: Binding<String>, variants: [String]) {
|
||||
self.title = title
|
||||
self._text = text
|
||||
self.variants = variants
|
||||
self.titleOne = titleOne
|
||||
}
|
||||
|
||||
public var body: some View {
|
||||
ZStack {
|
||||
Menu(content: {
|
||||
ForEach(variants, id: \.self) { variant in
|
||||
Button(variant) {
|
||||
title = variant
|
||||
text = variant
|
||||
}
|
||||
}
|
||||
|
||||
}, label: {
|
||||
Text("")
|
||||
.frame(maxWidth: .infinity)
|
||||
.frame(height: 48)
|
||||
.cornerRadius(10)
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 10)
|
||||
.foregroundStyle(Color("hex#F5F5F9", bundle: .module))
|
||||
.overlay(content: {
|
||||
RoundedRectangle(cornerRadius: 10)
|
||||
.stroke(lineWidth: 1)
|
||||
.foregroundStyle(Color("hex#EBEBEB", bundle: .module))
|
||||
})
|
||||
)
|
||||
})
|
||||
HStack {
|
||||
Text(title)
|
||||
.robotoFlex(size: 16)
|
||||
.foregroundStyle(variants.contains(title) ? Color.black : (Color("hex#939396", bundle: .module)))
|
||||
.tracking(0.32)
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
if !titleOne.isEmpty {
|
||||
Text(titleOne)
|
||||
.robotoFlex(size: 14)
|
||||
.foregroundStyle(Color("hex#7E7E9A", bundle: .module))
|
||||
.tracking(0)
|
||||
.lineSpacing(20)
|
||||
Spacer()
|
||||
Image("down", bundle: .module)
|
||||
}.padding(.horizontal, 14)
|
||||
.padding(.bottom, 4)
|
||||
}
|
||||
ZStack {
|
||||
Menu(content: {
|
||||
ForEach(variants, id: \.self) { variant in
|
||||
Button(variant) {
|
||||
title = variant
|
||||
text = variant
|
||||
}
|
||||
}
|
||||
|
||||
}, label: {
|
||||
Text("")
|
||||
.frame(maxWidth: .infinity)
|
||||
.frame(height: 48)
|
||||
.cornerRadius(10)
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 10)
|
||||
.foregroundStyle(Color("hex#F5F5F9", bundle: .module))
|
||||
.overlay(content: {
|
||||
RoundedRectangle(cornerRadius: 10)
|
||||
.stroke(lineWidth: 1)
|
||||
.foregroundStyle(Color("hex#EBEBEB", bundle: .module))
|
||||
})
|
||||
)
|
||||
})
|
||||
HStack {
|
||||
Text(title)
|
||||
.robotoFlex(size: 16)
|
||||
.foregroundStyle(variants.contains(title) ? Color.black : (Color("hex#939396", bundle: .module)))
|
||||
.tracking(0.32)
|
||||
.lineSpacing(20)
|
||||
Spacer()
|
||||
Image("down", bundle: .module)
|
||||
}.padding(.horizontal, 14)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user