mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-01-16 14:06:40 +01:00
27 lines
801 B
Swift
Executable File
27 lines
801 B
Swift
Executable File
import SwiftUI
|
|
|
|
struct SearchUserRow: View {
|
|
@EnvironmentObject var viewModel: SearchUserViewModel
|
|
@State var user: User
|
|
|
|
var body: some View {
|
|
HStack {
|
|
self.viewModel.userImages[user].map { image in
|
|
Image(uiImage: image)
|
|
.frame(width: 44, height: 44)
|
|
.aspectRatio(contentMode: .fit)
|
|
.clipShape(Circle())
|
|
.overlay(Circle().stroke(Color.gray, lineWidth: 1))
|
|
}
|
|
|
|
Text(user.login)
|
|
.font(Font.system(size: 18).bold())
|
|
|
|
Spacer()
|
|
}
|
|
.padding(EdgeInsets(top: 8, leading: 16, bottom: 8, trailing: 16))
|
|
.frame(height: 60)
|
|
.onAppear { self.viewModel.getImage(for: self.user) }
|
|
}
|
|
}
|