Hide empty fields on transaction details page

This commit is contained in:
William Brawner 2021-12-07 19:32:27 -07:00
parent 8aa5119e3e
commit 29f6252ae2

View file

@ -58,17 +58,20 @@ struct LabeledField: View {
let value: String?
let showDivider: Bool
@ViewBuilder
var body: some View {
VStack {
HStack {
Text(self.label)
.foregroundColor(.secondary)
Spacer()
Text(verbatim: value ?? "")
.multilineTextAlignment(.trailing)
}
if showDivider {
Divider()
if let val = value, !val.isEmpty {
VStack {
HStack {
Text(self.label)
.foregroundColor(.secondary)
Spacer()
Text(verbatim: value ?? "")
.multilineTextAlignment(.trailing)
}
if showDivider {
Divider()
}
}
}
}