mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-03-22 17:39:26 +01:00
Update
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user