damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 95250286684852469483afb9fa4378e7a8096fd6
parent 053812ba95d743369b7a1adff1847706d1e1676d
Author: William Casarin <jb55@jb55.com>
Date:   Fri, 16 Dec 2022 15:35:28 -0800

dms: make chat area more obvious

This was an ios16 bug

Changelog-Fixed: Make dm chat area visible again

Diffstat:
Mdamus/Views/DMChatView.swift | 34+++++++++++++++++++---------------
1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/damus/Views/DMChatView.swift b/damus/Views/DMChatView.swift @@ -12,6 +12,12 @@ struct DMChatView: View { let pubkey: String @EnvironmentObject var dms: DirectMessageModel @State var message: String = "" + + init(damus_state: DamusState, pubkey: String) { + self.damus_state = damus_state + self.pubkey = pubkey + UITextView.appearance().backgroundColor = .clear + } var Messages: some View { ScrollViewReader { scroller in @@ -47,11 +53,9 @@ struct DMChatView: View { var InputField: some View { TextEditor(text: $message) - .textEditorBackground { - InputBackground() - } .cornerRadius(20) - .padding(16) + .padding(8) + .background(InputBackground().cornerRadius(20)) .foregroundColor(Color.primary) } @@ -59,9 +63,9 @@ struct DMChatView: View { func InputBackground() -> Color { if colorScheme == .light { - return Color.init(.sRGB, red: 0.9, green: 0.9, blue: 0.9, opacity: 1.0) + return Color.init(.sRGB, red: 0.8, green: 0.8, blue: 0.8, opacity: 1.0) } else { - return Color.init(.sRGB, red: 0.1, green: 0.1, blue: 0.1, opacity: 1.0) + return Color.init(.sRGB, red: 0.2, green: 0.2, blue: 0.2, opacity: 1.0) } } @@ -74,21 +78,21 @@ struct DMChatView: View { } var Footer: some View { - ZStack { - BackgroundColor() + //ZStack { + //BackgroundColor() - HStack(spacing: 0) { - InputField + HStack(spacing: 0) { + InputField - if !message.isEmpty { - Button(role: .none, action: send_message) { - Label("", systemImage: "arrow.right.circle") - .font(.title) - } + if !message.isEmpty { + Button(role: .none, action: send_message) { + Label("", systemImage: "arrow.right.circle") + .font(.title) } } } .frame(height: 50 + 20 * CGFloat(text_lines)) + //} } var text_lines: Int {