commit 1f6585e4193dd4f9ee2d47b2c85606c54cdbd7d6 parent 8844764e0c26d552d384284d5f31b3f6be7b5a2b Author: Nitesh Balusu <niteshbalusu@icloud.com> Date: Sun, 25 Dec 2022 13:52:58 -0500 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> Diffstat:
M | damus/Views/EditMetadataView.swift | | | 12 | +++++++----- |
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/damus/Views/EditMetadataView.swift b/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)) } }