Created
June 19, 2022 21:05
-
-
Save hmlongco/7796d477b1644e8699236bfece280b2c to your computer and use it in GitHub Desktop.
Builder: DetailCardView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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