Skip to content

Instantly share code, notes, and snippets.

@hmlongco
Created June 19, 2022 21:05
Show Gist options
  • Save hmlongco/7796d477b1644e8699236bfece280b2c to your computer and use it in GitHub Desktop.
Save hmlongco/7796d477b1644e8699236bfece280b2c to your computer and use it in GitHub Desktop.
Builder: DetailCardView
struct DetailCardView: ViewBuilder {
@Injected var viewModel: DetailViewModel
init(user: User) {
viewModel.configure(user)
}
var body: View {
StandardCardView {
VStackView {
LabeledPhotoView(photo: viewModel.photo(), name: viewModel.fullname)
.height(250)
VStackView {
NameValueView(name: "Address", value: viewModel.street)
NameValueView(name: "", value: viewModel.cityStateZip)
SpacerView(8)
NameValueView(name: "Email", value: viewModel.email)
NameValueView(name: "Phone1", value: viewModel.phone)
SpacerView(8)
NameValueView(name: "Age", value: viewModel.age)
}
.spacing(0)
.padding(20)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment