32 lines
865 B
Swift
32 lines
865 B
Swift
|
import SwiftUI
|
||
|
import SFSafeSymbols
|
||
|
|
||
|
struct CapNameEntryView: View {
|
||
|
|
||
|
@Binding
|
||
|
var name: String
|
||
|
|
||
|
var body: some View {
|
||
|
TextField("Name", text: $name, prompt: Text("Enter name..."))
|
||
|
.padding(7)
|
||
|
.padding(.horizontal, 25)
|
||
|
.background(Color(.systemGray5))
|
||
|
.cornerRadius(8)
|
||
|
.overlay(
|
||
|
HStack {
|
||
|
Image(systemSymbol: .squareAndPencil)
|
||
|
.foregroundColor(.gray)
|
||
|
.frame(minWidth: 0, maxWidth: .infinity, alignment: .leading)
|
||
|
.padding(.leading, 8)
|
||
|
}
|
||
|
)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
struct CapNameEntryView_Previews: PreviewProvider {
|
||
|
static var previews: some View {
|
||
|
CapNameEntryView(name: .constant(""))
|
||
|
.previewLayout(.fixed(width: 375, height: 50))
|
||
|
}
|
||
|
}
|