mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-03-18 23:44:04 +01:00
Add examples project
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
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) }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user