fwe
This commit is contained in:
parent
d805d0c660
commit
77a50a7dd2
@ -12,47 +12,59 @@ public struct SelectView: View {
|
|||||||
@State var title: String
|
@State var title: String
|
||||||
@Binding var text: String
|
@Binding var text: String
|
||||||
let variants: [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.title = title
|
||||||
self._text = text
|
self._text = text
|
||||||
self.variants = variants
|
self.variants = variants
|
||||||
|
self.titleOne = titleOne
|
||||||
}
|
}
|
||||||
|
|
||||||
public var body: some View {
|
public var body: some View {
|
||||||
ZStack {
|
VStack(alignment: .leading, spacing: 0) {
|
||||||
Menu(content: {
|
if !titleOne.isEmpty {
|
||||||
ForEach(variants, id: \.self) { variant in
|
Text(titleOne)
|
||||||
Button(variant) {
|
.robotoFlex(size: 14)
|
||||||
title = variant
|
.foregroundStyle(Color("hex#7E7E9A", bundle: .module))
|
||||||
text = variant
|
.tracking(0)
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}, 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)
|
.lineSpacing(20)
|
||||||
Spacer()
|
.padding(.bottom, 4)
|
||||||
Image("down", bundle: .module)
|
}
|
||||||
}.padding(.horizontal, 14)
|
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