From d06dfe188559c4cd5fd6f349caffaed5207d2a9e Mon Sep 17 00:00:00 2001 From: Christian Skorobogatow Date: Wed, 11 Dec 2024 09:34:37 +0100 Subject: [PATCH 1/3] Add Bluesky as a social media platform option --- Sources/LinksKit/Model/SocialPlatform.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/LinksKit/Model/SocialPlatform.swift b/Sources/LinksKit/Model/SocialPlatform.swift index 5b3fca7..bec2352 100644 --- a/Sources/LinksKit/Model/SocialPlatform.swift +++ b/Sources/LinksKit/Model/SocialPlatform.swift @@ -15,6 +15,7 @@ public enum SocialPlatform: Hashable { case tiktok case twitter case youtube + case bluesky var systemImage: String { switch self { @@ -29,6 +30,7 @@ public enum SocialPlatform: Hashable { case .tiktok: "music.note" case .twitter: "bird" case .youtube: "play.rectangle.fill" + case .bluesky: "b.circle.fill" } } @@ -45,6 +47,7 @@ public enum SocialPlatform: Hashable { case .tiktok: URL(string: "https://www.tiktok.com/@\(handle)")! case .twitter: URL(string: "https://twitter.com/\(handle)")! case .youtube: URL(string: "https://www.youtube.com/\(handle)")! + case .bluesky: URL(string: "https://app.bsky.cz/profile/\(handle)")! } } } @@ -71,6 +74,7 @@ extension SocialPlatform: CustomStringConvertible { case .tiktok: "TikTok" case .twitter: "X/Twitter" case .youtube: "YouTube" + case .bluesky: "Bluesky" } } } From a84b10753404755d5c3b9478343390fa74b9a68d Mon Sep 17 00:00:00 2001 From: Christian Skorobogatow Date: Wed, 11 Dec 2024 14:09:08 +0100 Subject: [PATCH 2/3] Update the order of the bluesky case to be in alphabetical order of the enum. --- Sources/LinksKit/Model/SocialPlatform.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/LinksKit/Model/SocialPlatform.swift b/Sources/LinksKit/Model/SocialPlatform.swift index bec2352..6a79838 100644 --- a/Sources/LinksKit/Model/SocialPlatform.swift +++ b/Sources/LinksKit/Model/SocialPlatform.swift @@ -4,6 +4,7 @@ import Foundation /// /// Use this enum to specify social media platforms when configuring social links in LinksKit. public enum SocialPlatform: Hashable { + case bluesky case facebook case github case instagram @@ -15,10 +16,10 @@ public enum SocialPlatform: Hashable { case tiktok case twitter case youtube - case bluesky var systemImage: String { switch self { + case .bluesky: "b.circle.fill" case .facebook: "hand.thumbsup" case .github: "cat.circle.fill" case .instagram: "camera.circle" @@ -30,12 +31,12 @@ public enum SocialPlatform: Hashable { case .tiktok: "music.note" case .twitter: "bird" case .youtube: "play.rectangle.fill" - case .bluesky: "b.circle.fill" } } func url(handle: String) -> URL { switch self { + case .bluesky: URL(string: "https://app.bsky.cz/profile/\(handle)")! case .facebook: URL(string: "https://facebook.com/\(handle)")! case .github: URL(string: "https://github.com/\(handle)")! case .instagram: URL(string: "https://instagram.com/\(handle)")! @@ -47,7 +48,6 @@ public enum SocialPlatform: Hashable { case .tiktok: URL(string: "https://www.tiktok.com/@\(handle)")! case .twitter: URL(string: "https://twitter.com/\(handle)")! case .youtube: URL(string: "https://www.youtube.com/\(handle)")! - case .bluesky: URL(string: "https://app.bsky.cz/profile/\(handle)")! } } } @@ -63,6 +63,7 @@ extension SocialPlatform: CustomStringConvertible { /// ``` public var description: String { switch self { + case .bluesky: "Bluesky" case .facebook: "Facebook" case .github: "GitHub" case .instagram: "Instagram" @@ -74,7 +75,6 @@ extension SocialPlatform: CustomStringConvertible { case .tiktok: "TikTok" case .twitter: "X/Twitter" case .youtube: "YouTube" - case .bluesky: "Bluesky" } } } From 2c1f25e91bb1937001991ee99c21416cedab1110 Mon Sep 17 00:00:00 2001 From: Christian Skorobogatow Date: Wed, 11 Dec 2024 14:38:44 +0100 Subject: [PATCH 3/3] Fix incorrect URL for bluesky --- Sources/LinksKit/Model/SocialPlatform.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/LinksKit/Model/SocialPlatform.swift b/Sources/LinksKit/Model/SocialPlatform.swift index 6a79838..9b25c4b 100644 --- a/Sources/LinksKit/Model/SocialPlatform.swift +++ b/Sources/LinksKit/Model/SocialPlatform.swift @@ -36,7 +36,7 @@ public enum SocialPlatform: Hashable { func url(handle: String) -> URL { switch self { - case .bluesky: URL(string: "https://app.bsky.cz/profile/\(handle)")! + case .bluesky: URL(string: "https://bsky.app/profile/\(handle)")! case .facebook: URL(string: "https://facebook.com/\(handle)")! case .github: URL(string: "https://github.com/\(handle)")! case .instagram: URL(string: "https://instagram.com/\(handle)")!