Skip to content

Commit

Permalink
added accent color customisation to message bubbles
Browse files Browse the repository at this point in the history
  • Loading branch information
mani-sh-reddy committed Dec 9, 2023
1 parent efe1f39 commit f6c9d12
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Lunar/Inbox Tab/InboxView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ enum messageDirection {
struct MessageItem: View {
@Default(.fontSize) var fontSize
@Default(.activeAccount) var activeAccount
@Default(.accentColor) var accentColor
@Default(.accentColorString) var accentColorString

@ObservedRealmObject var message: RealmPrivateMessage

Expand Down Expand Up @@ -106,9 +108,20 @@ struct MessageItem: View {
}

var chatBubbleColor: Color {
messageDirection == .incoming ? .messageBubbleBackgroundBlue : .messageBubbleBackgroundGray
if messageDirection == .incoming {
let color = accentColorString == "Default" ? Color.messageBubbleBackgroundBlue : .accentColor
return color
} else {
return Color.messageBubbleBackgroundGray
}
}

// var composerSettings: some View {
// Image(systemSymbol: accentColorString == "Default" ? .textBubbleFill : .textBubble)
// .symbolRenderingMode(accentColorString == "Default" ? .hierarchical : .monochrome)
// .foregroundStyle(accentColorString == "Default" ? .gray : accentColor)
// }

var body: some View {
ChatBubble(position: chatBubbleDirection, color: chatBubbleColor) {
VStack(alignment: .leading) {
Expand Down

0 comments on commit f6c9d12

Please sign in to comment.