Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.
Merged

Emojis! #2685

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Classes/Issues/Labeled/IssueLabeledModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ final class IssueLabeledModel: ListDiffable {
) {
self.id = id
self.actor = actor
self.title = title
self.title = title.replacingGithubEmoji
self.color = color
self.date = date
self.type = type

let labelColor = color.color
let actionString: String
switch type {
case .added: actionString = NSLocalizedString(" added ", comment: "")
case .removed: actionString = NSLocalizedString(" removed ", comment: "")
}


let builder = StyledTextBuilder(styledText: StyledText(
style: Styles.Text.secondary.with(foreground: Styles.Colors.Gray.medium.color)
))
Expand All @@ -64,11 +64,11 @@ final class IssueLabeledModel: ListDiffable {
.restore()
.add(text: actionString)
.save()
.add(styledText: StyledText(text: title, style: Styles.Text.smallTitle.with(attributes: [
.add(styledText: StyledText(text: self.title, style: Styles.Text.smallTitle.with(attributes: [
.backgroundColor: labelColor,
.foregroundColor: labelColor.textOverlayColor ?? .black,
.baselineOffset: 1, // offset for better rounded background colors
MarkdownAttribute.label: LabelDetails(owner: repoOwner, repo: repoName, label: title)
MarkdownAttribute.label: LabelDetails(owner: repoOwner, repo: repoName, label: self.title)
]
)))
.restore()
Expand Down
4 changes: 2 additions & 2 deletions Classes/Models/RepositoryLabel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import IGListKit
final class RepositoryLabel: ListDiffable, Hashable, Equatable, ListSwiftDiffable {

let color: String
let name: String
var name: String = ""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason you changed this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If let you can’t mutate. Meaning I can’t switch :bug: no?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're only setting it once in the initializer though, isn't it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes! I originally had a separate fix (I created my
Own method that did the mapping. And I needed self but that doesn’t apply anymore. I’ll PR a quick fix to this soon. Thank you for pointing that out


init(color: String, name: String) {
self.color = color
self.name = name
self.name = name.replacingGithubEmoji
}

// MARK: ListDiffable
Expand Down