Browse Source

Make about me multi-line in profile editor

Closes: #138
Changelog-Fixed: Make about me multi-line in profile editor
Signed-off-by: Nitesh Balusu <niteshbalusu@icloud.com>
post-button-style
Nitesh Balusu 2 years ago
committed by William Casarin
parent
commit
1f6585e419
  1. 12
      damus/Views/EditMetadataView.swift

12
damus/Views/EditMetadataView.swift

@ -129,14 +129,16 @@ struct EditMetadataView: View {
}
Section("About Me") {
let placeholder = "Absolute Boss"
ZStack(alignment: .topLeading) {
TextEditor(text: $about)
.textInputAutocapitalization(.sentences)
if about.isEmpty {
Text("Absolute boss")
.offset(x: 0, y: 7)
.foregroundColor(Color(uiColor: .placeholderText))
}
.frame(minHeight: 20, alignment: .leading)
.multilineTextAlignment(.leading)
Text(about.isEmpty ? placeholder : about)
.padding(.leading, 4)
.opacity(about.isEmpty ? 1 : 0)
.foregroundColor(Color(uiColor: .placeholderText))
}
}

Loading…
Cancel
Save