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") { Section("About Me") {
let placeholder = "Absolute Boss"
ZStack(alignment: .topLeading) { ZStack(alignment: .topLeading) {
TextEditor(text: $about) TextEditor(text: $about)
.textInputAutocapitalization(.sentences) .textInputAutocapitalization(.sentences)
if about.isEmpty { .frame(minHeight: 20, alignment: .leading)
Text("Absolute boss") .multilineTextAlignment(.leading)
.offset(x: 0, y: 7) Text(about.isEmpty ? placeholder : about)
.foregroundColor(Color(uiColor: .placeholderText)) .padding(.leading, 4)
} .opacity(about.isEmpty ? 1 : 0)
.foregroundColor(Color(uiColor: .placeholderText))
} }
} }

Loading…
Cancel
Save