From 1f6585e4193dd4f9ee2d47b2c85606c54cdbd7d6 Mon Sep 17 00:00:00 2001 From: Nitesh Balusu Date: Sun, 25 Dec 2022 13:52:58 -0500 Subject: [PATCH] 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 --- damus/Views/EditMetadataView.swift | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/damus/Views/EditMetadataView.swift b/damus/Views/EditMetadataView.swift index 4bbe868..9513a7d 100644 --- 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)) } }