Add links for email, phone and domain
This commit is contained in:
@ -1,20 +1,20 @@
|
||||
import SwiftUI
|
||||
import SFSafeSymbols
|
||||
|
||||
struct LeftImageLabel: View {
|
||||
|
||||
let text: String
|
||||
struct LeftImageLabel<Content>: View where Content: View {
|
||||
|
||||
let systemSymbol: SFSymbol
|
||||
|
||||
let content: Content
|
||||
|
||||
init(_ text: String, systemSymbol: SFSymbol) {
|
||||
self.text = text
|
||||
init(systemSymbol: SFSymbol, @ViewBuilder content: () -> Content) {
|
||||
self.systemSymbol = systemSymbol
|
||||
self.content = content()
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
HStack(alignment: .firstTextBaseline, spacing: 0) {
|
||||
Text(text)
|
||||
HStack(alignment: .center, spacing: 0) {
|
||||
content
|
||||
Image(systemSymbol: systemSymbol)
|
||||
.frame(width: 20)
|
||||
}
|
||||
@ -23,6 +23,6 @@ struct LeftImageLabel: View {
|
||||
|
||||
struct LeftImageLabel_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
LeftImageLabel("Home address", systemSymbol: .house)
|
||||
LeftImageLabel(systemSymbol: .house) { Text("Home address") }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user