Skip to content

Commit 94631af

Browse files
authored
chore: update mention editor to use new colors (#754)
1 parent 3c00dc1 commit 94631af

6 files changed

Lines changed: 14 additions & 9 deletions

File tree

.github/workflows/go.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ on:
1010
branches: ["main"]
1111
pull_request:
1212
branches: ["main"]
13+
paths:
14+
- "api/**"
1315

1416
jobs:
1517
build:

Splajompy.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Splajompy/Utilities/AttributedTextEditor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ struct AttributedTextEditor: UIViewRepresentable {
179179

180180
textView.typingAttributes = [
181181
.font: UIFont.preferredFont(forTextStyle: .body),
182-
.foregroundColor: isInMention ? UIColor.systemBlue : UIColor.label,
182+
.foregroundColor: isInMention ? UIColor(.accent) : UIColor.label,
183183
]
184184
}
185185
}

Splajompy/Utilities/AttributedTextEditorMac.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ struct AttributedTextEditor: NSViewRepresentable {
226226
at: position
227227
)
228228

229-
let typingColor: NSColor = isInMention ? .systemBlue : .labelColor
229+
let typingColor: NSColor = isInMention ? NSColor(.accent) : .labelColor
230230
textView.typingAttributes = [
231231
.font: NSFont.preferredFont(forTextStyle: .body),
232232
.foregroundColor: typingColor,

Splajompy/Utilities/MentionTextEditor.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ struct MentionUtilities {
6666
#endif
6767

6868
#if os(iOS)
69-
let mentionColor = UIColor.systemBlue
69+
let mentionColor = UIColor(.accent)
7070
#else
71-
let mentionColor = NSColor.systemBlue
71+
let mentionColor = NSColor(.accent)
7272
#endif
7373

7474
mutableAttributedText.addAttribute(
@@ -93,7 +93,10 @@ struct MentionUtilities {
9393
text.matches(of: mentionPattern).compactMap { match in
9494
let atUsername = match.output.1
9595
let username = String(atUsername.dropFirst())
96-
let fullRange = NSRange(atUsername.startIndex..<atUsername.endIndex, in: text)
96+
let fullRange = NSRange(
97+
atUsername.startIndex..<atUsername.endIndex,
98+
in: text
99+
)
97100
return Mention(username: username, range: fullRange)
98101
}
99102
}

Splajompy/Utilities/MentionTextEditorViewModel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ extension MentionTextEditor {
9696
#if os(iOS)
9797
let bodyFont = UIFont.preferredFont(forTextStyle: .body)
9898
let labelColor = UIColor.label
99-
let mentionColor = UIColor.systemBlue
99+
let mentionColor = UIColor(.accent)
100100
#else
101101
let bodyFont = NSFont.preferredFont(forTextStyle: .body)
102102
let labelColor = NSColor.labelColor
103-
let mentionColor = NSColor.systemBlue
103+
let mentionColor = NSColor(.accent)
104104
#endif
105105

106106
mutableAttributedText.addAttribute(

0 commit comments

Comments
 (0)