diff --git a/firstfm.xcodeproj/project.pbxproj b/firstfm.xcodeproj/project.pbxproj index 5f2bc6b..bd3d7df 100644 --- a/firstfm.xcodeproj/project.pbxproj +++ b/firstfm.xcodeproj/project.pbxproj @@ -31,6 +31,7 @@ 822E9A9226A9795200C5307B /* TagInfoResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 822E9A9126A9795200C5307B /* TagInfoResponse.swift */; }; 822E9A9426A97B3600C5307B /* TagTopArtistsResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 822E9A9326A97B3600C5307B /* TagTopArtistsResponse.swift */; }; 822E9A9626A97B7200C5307B /* TagViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 822E9A9526A97B7200C5307B /* TagViewModel.swift */; }; + 8240989C26ADF67F00A789D9 /* ArtistBioView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8240989B26ADF67E00A789D9 /* ArtistBioView.swift */; }; 82505CDF2675074E00CCCB58 /* ArtistRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82505CDC2675074E00CCCB58 /* ArtistRow.swift */; }; 82505CE02675074E00CCCB58 /* ChartListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82505CDD2675074E00CCCB58 /* ChartListView.swift */; }; 82505CE12675074E00CCCB58 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82505CDE2675074E00CCCB58 /* ContentView.swift */; }; @@ -123,6 +124,7 @@ 822E9A9126A9795200C5307B /* TagInfoResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagInfoResponse.swift; sourceTree = ""; }; 822E9A9326A97B3600C5307B /* TagTopArtistsResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagTopArtistsResponse.swift; sourceTree = ""; }; 822E9A9526A97B7200C5307B /* TagViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagViewModel.swift; sourceTree = ""; }; + 8240989B26ADF67E00A789D9 /* ArtistBioView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArtistBioView.swift; sourceTree = ""; }; 82505CDC2675074E00CCCB58 /* ArtistRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArtistRow.swift; sourceTree = ""; }; 82505CDD2675074E00CCCB58 /* ChartListView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChartListView.swift; sourceTree = ""; }; 82505CDE2675074E00CCCB58 /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; @@ -368,6 +370,7 @@ 825F0FBE26A6F4D0007BA84B /* TintOverlayView.swift */, 825F0FC426A74539007BA84B /* TopArtistAlbumsView.swift */, 825F0FC226A721F7007BA84B /* TopArtistTracksView.swift */, + 8240989B26ADF67E00A789D9 /* ArtistBioView.swift */, ); path = Artist; sourceTree = ""; @@ -594,6 +597,7 @@ 82A006B6267960710009BD71 /* TrackRowView.swift in Sources */, 82A006B8267960D90009BD71 /* Track.swift in Sources */, 825F0FA026A5EC82007BA84B /* Session.swift in Sources */, + 8240989C26ADF67F00A789D9 /* ArtistBioView.swift in Sources */, 822E9A9026A9788900C5307B /* TagView.swift in Sources */, 82B6CCE526AB80B4008AFDEF /* TopUserArtistsView.swift in Sources */, 82505CE72675300400CCCB58 /* SpotifyArtistSearchResponse.swift in Sources */, diff --git a/firstfm/Views/Artist/ArtistBioView.swift b/firstfm/Views/Artist/ArtistBioView.swift new file mode 100644 index 0000000..c044aba --- /dev/null +++ b/firstfm/Views/Artist/ArtistBioView.swift @@ -0,0 +1,33 @@ +// +// ArtistBioView.swift +// firstfm +// +// Created by Stanislas Lange on 25/07/2021. +// + +import SwiftUI + +struct ArtistBioView: View { + var artistInfo: ArtistInfo? + + var body: some View { + ScrollView { + VStack(alignment: .leading) { + Text(artistInfo?.bio.content ?? "There is no bio for this artist") + .padding() + .navigationTitle("\(artistInfo?.name ?? "Artist") bio") + .navigationBarItems(trailing: HStack { + if let link = artistInfo?.bio.links.link.href { + + Link(destination: URL(string: link)!) { + Image(systemName: "link.circle.fill") + .imageScale(.large) + .foregroundColor(.white) + } + } + }) + + } + } + } +} diff --git a/firstfm/Views/Artist/ArtistInfoView.swift b/firstfm/Views/Artist/ArtistInfoView.swift index 7626d5f..46ac0d2 100644 --- a/firstfm/Views/Artist/ArtistInfoView.swift +++ b/firstfm/Views/Artist/ArtistInfoView.swift @@ -14,7 +14,15 @@ struct ArtistInfoView: View { .font(.subheadline) .foregroundColor(.gray) } - Text(artistInfo?.bio.content ?? "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.").lineLimit(3) + + NavigationLink(destination: ArtistBioView(artistInfo: artistInfo)) { + VStack(alignment: .leading) { + Text(artistInfo?.bio.content ?? "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.") + .lineLimit(3) + .multilineTextAlignment(.leading) + .foregroundColor(.white) + } + } ScrollView(.horizontal, showsIndicators: false) { HStack {