mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-01-15 21:53:29 +01:00
32 lines
875 B
Swift
Executable File
32 lines
875 B
Swift
Executable File
import SwiftUI
|
|
|
|
struct SearchUserBar: View {
|
|
@Binding var text: String
|
|
@State var action: () -> Void
|
|
|
|
var body: some View {
|
|
ZStack {
|
|
HStack {
|
|
TextField(
|
|
$text,
|
|
placeholder: Text("Search User")
|
|
.color(Color.gray)
|
|
)
|
|
.padding([.leading, .trailing], 8)
|
|
.frame(height: 32)
|
|
.background(Color.white.opacity(0.4))
|
|
.cornerRadius(8)
|
|
|
|
Button(
|
|
action: action,
|
|
label: { Text("Search") }
|
|
)
|
|
.foregroundColor(Color.white)
|
|
}
|
|
.padding([.leading, .trailing], 16)
|
|
}
|
|
.frame(height: 64)
|
|
.background(Color.yellow)
|
|
}
|
|
}
|