status: click music urls to display in spotify

Changelog-Added: Click music statuses to display in spotify
This commit is contained in:
William Casarin
2023-08-23 17:17:53 -07:00
parent d02fc9142d
commit 981d500c25
3 changed files with 34 additions and 2 deletions

View File

@@ -15,6 +15,8 @@ struct UserStatusView: View {
var show_general: Bool
var show_music: Bool
@Environment(\.openURL) var openURL
var body: some View {
VStack(alignment: .leading, spacing: 2) {
if show_general, let general = status.general {
@@ -22,6 +24,11 @@ struct UserStatusView: View {
.lineLimit(1)
.foregroundColor(.gray)
.font(.callout.italic())
.onTapGesture {
if let url = general.url {
openURL(url)
}
}
}
if show_music, let playing = status.music {
@@ -29,6 +36,11 @@ struct UserStatusView: View {
.lineLimit(1)
.foregroundColor(.gray)
.font(.callout.italic())
.onTapGesture {
if let url = playing.url {
openURL(url)
}
}
}
}