Hide empty fields on transaction details page
This commit is contained in:
parent
8aa5119e3e
commit
29f6252ae2
1 changed files with 13 additions and 10 deletions
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue