dms: make chat area more obvious
This was an ios16 bug Changelog-Fixed: Make dm chat area visible again
This commit is contained in:
@@ -12,6 +12,12 @@ struct DMChatView: View {
|
|||||||
let pubkey: String
|
let pubkey: String
|
||||||
@EnvironmentObject var dms: DirectMessageModel
|
@EnvironmentObject var dms: DirectMessageModel
|
||||||
@State var message: String = ""
|
@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 {
|
var Messages: some View {
|
||||||
ScrollViewReader { scroller in
|
ScrollViewReader { scroller in
|
||||||
@@ -47,11 +53,9 @@ struct DMChatView: View {
|
|||||||
|
|
||||||
var InputField: some View {
|
var InputField: some View {
|
||||||
TextEditor(text: $message)
|
TextEditor(text: $message)
|
||||||
.textEditorBackground {
|
|
||||||
InputBackground()
|
|
||||||
}
|
|
||||||
.cornerRadius(20)
|
.cornerRadius(20)
|
||||||
.padding(16)
|
.padding(8)
|
||||||
|
.background(InputBackground().cornerRadius(20))
|
||||||
.foregroundColor(Color.primary)
|
.foregroundColor(Color.primary)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,9 +63,9 @@ struct DMChatView: View {
|
|||||||
|
|
||||||
func InputBackground() -> Color {
|
func InputBackground() -> Color {
|
||||||
if colorScheme == .light {
|
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 {
|
} 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 {
|
var Footer: some View {
|
||||||
ZStack {
|
//ZStack {
|
||||||
BackgroundColor()
|
//BackgroundColor()
|
||||||
|
|
||||||
HStack(spacing: 0) {
|
HStack(spacing: 0) {
|
||||||
InputField
|
InputField
|
||||||
|
|
||||||
if !message.isEmpty {
|
if !message.isEmpty {
|
||||||
Button(role: .none, action: send_message) {
|
Button(role: .none, action: send_message) {
|
||||||
Label("", systemImage: "arrow.right.circle")
|
Label("", systemImage: "arrow.right.circle")
|
||||||
.font(.title)
|
.font(.title)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.frame(height: 50 + 20 * CGFloat(text_lines))
|
.frame(height: 50 + 20 * CGFloat(text_lines))
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
var text_lines: Int {
|
var text_lines: Int {
|
||||||
|
|||||||
Reference in New Issue
Block a user