mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 16:05:19 +00:00
Bold user's own nickname in chat messages
- Added font weight logic to formatMessageAsText and formatMessage - User's own @nickname appears bold (weight: .bold) - Other nicknames remain medium weight - Helps visually distinguish own messages from others
This commit is contained in:
@@ -983,7 +983,9 @@ class ChatViewModel: ObservableObject {
|
||||
|
||||
// Use consistent color for all senders
|
||||
senderStyle.foregroundColor = primaryColor
|
||||
senderStyle.font = .system(size: 14, weight: .medium, design: .monospaced)
|
||||
// Bold the user's own nickname
|
||||
let fontWeight: Font.Weight = message.sender == nickname ? .bold : .medium
|
||||
senderStyle.font = .system(size: 14, weight: fontWeight, design: .monospaced)
|
||||
result.append(sender.mergingAttributes(senderStyle))
|
||||
|
||||
// Process content with hashtags and mentions
|
||||
@@ -1104,7 +1106,9 @@ class ChatViewModel: ObservableObject {
|
||||
|
||||
// Use consistent color for all senders
|
||||
senderStyle.foregroundColor = primaryColor
|
||||
senderStyle.font = .system(size: 12, weight: .medium, design: .monospaced)
|
||||
// Bold the user's own nickname
|
||||
let fontWeight: Font.Weight = message.sender == nickname ? .bold : .medium
|
||||
senderStyle.font = .system(size: 12, weight: fontWeight, design: .monospaced)
|
||||
result.append(sender.mergingAttributes(senderStyle))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user